Code Monkey home page Code Monkey logo

perl-dbd-firebird's Introduction

DBD::Firebird version 1.32

DBI driver for the Firebird RDBMS server.

  • Copyright © 2015 Stefan Roas
  • Copyright © 2014 H.Merijn Brand - Tux
  • Copyright © 2010-2020 Popa Adrian Marius
  • Copyright © 2011-2013 Stefan Suciu
  • Copyright © 2011-2015, 2024 Damyan Ivanov
  • Copyright © 2011 Alexandr Ciornii
  • Copyright © 2010-2014 Mike Pomraning
  • Copyright © 1999-2005 Edwin Pratomo
  • Portions Copyright © 2001-2005 Daniel Ritz

License

You may distribute under the terms of either the GNU General Public License or the Artistic License, as specified in the Perl README file. (https://dev.perl.org/licenses/artistic.html)

Installation

Requirements:

  • Perl (Threaded and version 5.8.1 or higher)
  • Perl DBI (1.41 or higher)
  • Firebird (2.5.1 or higher)
  • A C compiler
    • UN*X GCC or Clang

    • Windows

    • Freebsd

      • Threaded Perl is required (You have to re-install Perl from ports and you have to select the config option that says 'build a Perl with threads')

BEFORE BUILDING, TESTING AND INSTALLING this you will need to:

  • Build, test and install Perl 5 (at least 5.8.1).

  • Build, test and install the DBI module (at least DBI 1.41).

    On Debian/Ubuntu you can do a simple: sudo apt-get install firebird2.5-dev libdbi-perl

  • Remember to read the DBI README file if you installed it from source

  • Make sure that Firebird server is running (for testing telnet localhost 3050)

BUILDING: Win32/Win64 with Strawberry type 'dmake' from the console

Win32/Win64 with MS compiler: type 'nmake', not just 'make'

To Configure and build the DBD: perl Makefile.PL make

TESTING To run tests module Test::Exception is required on Debian/Ubuntu systems: sudo apt-get install libtest-exception-perl

Please, set at least DBI_PASS (or ISC_PASSWORD), before 'make test'. The default for DBI_USER is 'SYSDBA'.(masterkey password is given here as example only) ISC_PASSWORD=masterkey make test

INSTALLING: make install

perl-dbd-firebird's People

Contributors

chorny avatar hrdwrbob avatar ilmari avatar mapopa avatar mariuz avatar pilcrow avatar real-dam avatar ribasushi avatar rkitover avatar robert-scheck avatar stefansbv avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

perl-dbd-firebird's Issues

commercial distribution still limitted

The following two files still contain the limitting with the exception that it cannot be placed on a CD-ROM or similar media for commercial distribution without the prior approval of the author.

  • lib/DBD/Firebird/GetInfo.pm
  • lib/DBD/Firebird/TypeInfo.pm

I know I could remove that myself, but I don't feel like having the authority to change the distribution terms of something somebody else wrote :)

DBD::Firebird 0.7 on strawberry perl windows XP failures

I have installed DBD::Firebird 0.7 on strawberry perl, on two different computers (windows 7 and windows vista), and dmake test runs fine. But two other boxes with win xp, I get lots of test failures:

t/40-alltypes.t ........... 1/24
Failed test 'TEST No 15'
at t/40-alltypes.t line 145.
got: '853744080.3'
expected: '86753090000.868'
Looks like you failed 1 test of 24.

I have looked for old gds32.dll and fbclient.dll, but cannot find any. (The only fbclient.dll found is in my path, and is in C:\Program Files\Firebird\Firebird_2_1\bin).

In the readme file, I see Firebird (2.5 and higher) is required. Is that correct?. I'm stuck on 2.1 for now, and cant update yet.

Any ideas why xp would fail?

-Andy

[patch] compiler warnings

Hi,

This is the first patch of a series trying to send all the patches that DBD::Interbase Debian package has. Adapted to DBD::Firebird (package pending).

The changes fix compile time warnings of various types. Most notable printf format characters, NULL vs. 0 etc.

There are more warnings that I need to track down, but these are a good start.

https://gist.github.com/2d8c7e13c9a5d74335fc

can not build

make

cc -c -I"1" -I"/usr/local/lib/perl5/site_perl/5.10.1/mach/auto/DBI" -Wall -fno-strict-aliasing -O2 -pipe -fno-strict-
aliasing -DVERSION="0.52" -DXS_VERSION="0.52" -DPIC -fPIC "-I/usr/local/lib/perl5/5.10.1/mach/CORE" Firebird.
c
In file included from Firebird.h:13,
from Firebird.xs:13:
dbdimp.h:66:19: error: ibase.h: No such file or directory
In file included from Firebird.h:13,
from Firebird.xs:13:

patch
-- INC = -I"1" -I"/usr/local/lib/perl5/site_perl/5.10.1/mach/auto/DBI"
++ INC = -I"1" -I"/usr/local/lib/perl5/site_perl/5.10.1/mach/auto/DBI" -I"/usr/local/include"

use Perl Unicode for character data

Here is another topic I would like to work on.

The idea is that any textual data should use Perl's Unicode support. The functionality would be activated by an option in the DSN or maybe via some other way. For example, DBD::Pg has this db handle attribute:

pg_enable_utf8 (boolean)

DBD::Pg specific attribute. If true, then the "utf8" flag will be
turned on for returned character data (if the data is valid UTF-8). For
details about the "utf8" flag, see the "Encode" module. This attribute
is only relevant under perl 5.8 and later.

Returned data being valid UTF8 can be ensured by using UTF8 connection character set.

'make test' hangs up

make test

PERL_DL_NONLAZY=1 /usr/bin/perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t
t/00base.t ................ 1/2 # $DBI::VERSION=1.615
t/00base.t ................ ok
t/20createdrop.t ..........

60065 root 1 68 0 12512K 6068K umtxn 2 0:00 0.34% perl5.10.1
60062 root 1 68 0 15360K 6632K select 1 0:00 0.15% perl5.10.1

procstat -k 60065

PID TID COMM TDNAME KSTACK
60065 100173 perl5.10.1 initial thread mi_switch sleepq_switch sleepq_catch_signals sleepq_wait_sig _sleep _do_lock_umutex do_lock_umutex __umtx_op_wait_umutex syscallenter syscall Xint0x80_syscall

procstat -k 60062

PID TID COMM TDNAME KSTACK
60062 100267 perl5.10.1 - mi_switch sleepq_switch sleepq_catch_signals sleepq_wait_sig _cv_wait_sig seltdwait kern_select select syscallenter syscall Xint0x80_syscall

How can I help to fix this?

perl-dbd-firebird don't build with perl 5.14

I upgrade perl 5.12.3 to perl 5.14 and can't install DBD::Firebird
OS is
FreeBSD localhost.celebithil.my 8.2-STABLE FreeBSD 8.2-STABLE #1: Wed May 4 17:01:12 MSD 2011 [email protected]:/usr/obj/usr/src/sys/CELEBITHIL i386

Firebird.c from port of firebird 2.5

localhost# git pull
Already up-to-date.
localhost# git checkout -f master
Already on 'master'
localhost# perl Makefile.PL
Firebird bin directory : [/usr/local/bin]
Firebird include directory : [/usr/include/firebird]
Firebird/Firebird lib directory : [/usr/local/lib]
Build with libfbembed? (y/n) [n]

Reading cached test configuration...
Full path to test database to create or use: [/mnt/firebird/first.db]
Test database path is /mnt/firebird/first.db
Username : [SYSDBA]
Password : [masterkey]
Enter full path to isql: /usr/local/bin/isql-fb
The isql path is /usr/local/bin/isql-fb
Checking if your kit is complete...
Looks good
Using DBI 1.616 (for perl 5.014000 on i386-freebsd-thread-multi-64int) installed in /usr/local/lib/perl5/site_perl/5.14.0/mach/auto/DBI/
Writing Makefile for DBD::Firebird
Writing MYMETA.yml
localhost# make
cp lib/DBD/Firebird/TableInfo.pm blib/lib/DBD/Firebird/TableInfo.pm
cp Firebird.pm blib/lib/DBD/Firebird.pm
cp lib/DBD/Firebird/TypeInfo.pm blib/lib/DBD/Firebird/TypeInfo.pm
cp lib/DBD/Firebird/TableInfo/Basic.pm blib/lib/DBD/Firebird/TableInfo/Basic.pm
cp lib/DBD/Firebird/TableInfo/Firebird21.pm blib/lib/DBD/Firebird/TableInfo/Firebird21.pm
cp lib/DBD/Firebird/GetInfo.pm blib/lib/DBD/Firebird/GetInfo.pm
/usr/bin/perl -p -e "s/DRIVER/Firebird/g" /usr/local/lib/perl5/site_perl/5.14.0/mach/auto/DBI/Driver.xst > Firebird.xsi
/usr/bin/perl /usr/local/lib/perl5/site_perl/5.14.0/ExtUtils/xsubpp -noprototypes -typemap /usr/local/lib/perl5/5.14.0/ExtUtils/typemap -typemap typemap Firebird.xs > Firebird.xsc && mv Firebird.xsc Firebird.c
cc -c -I"/usr/include/firebird" -I"/usr/local/lib/perl5/site_perl/5.14.0/mach/auto/DBI" -Wall -fno-strict-aliasing -O2 -pipe -march=pentium3 -fno-strict-aliasing -DVERSION="0.52" -DXS_VERSION="0.52" -DPIC -fPIC "-I/usr/local/lib/perl5/5.14.0/mach/CORE" Firebird.c
Firebird.c: In function 'XS_DBD__Firebird__db_ib_register_callback':
Firebird.c:2646: warning: cast to pointer from integer of different size
Firebird.c: In function 'XS_DBD__Firebird__db_ib_cancel_callback':
Firebird.c:2705: warning: cast to pointer from integer of different size
Firebird.c: In function 'XS_DBD__Firebird__db_ib_wait_event':
Firebird.c:2741: warning: cast to pointer from integer of different size
Firebird.c: In function 'XS_DBD__Firebird__Event_DESTROY':
Firebird.c:2800: warning: cast to pointer from integer of different size
cc -c -I"/usr/include/firebird" -I"/usr/local/lib/perl5/site_perl/5.14.0/mach/auto/DBI" -Wall -fno-strict-aliasing -O2 -pipe -march=pentium3 -fno-strict-aliasing -DVERSION="0.52" -DXS_VERSION="0.52" -DPIC -fPIC "-I/usr/local/lib/perl5/5.14.0/mach/CORE" dbdimp.c
dbdimp.c: In function 'create_cursor_name':
dbdimp.c:48: warning: '0' flag ignored with precision and '%x' printf format
dbdimp.c:48: warning: format '%016.16x' expects type 'unsigned int', but argument 3 has type 'isc_stmt_handle'
dbdimp.c: In function 'do_error':
dbdimp.c:104: error: 'na' undeclared (first use in this function)
dbdimp.c:104: error: (Each undeclared identifier is reported only once
dbdimp.c:104: error: for each function it appears in.)
dbdimp.c:104: warning: left-hand operand of comma expression has no effect
dbdimp.c: In function 'ib_db_FETCH_attrib':
dbdimp.c:680: error: 'sv_yes' undeclared (first use in this function)
dbdimp.c:680: error: 'sv_no' undeclared (first use in this function)
dbdimp.c: In function 'dbd_preparse':
dbdimp.c:705: warning: assignment from incompatible pointer type
dbdimp.c: In function 'ib_st_prepare':
dbdimp.c:796: warning: assignment from incompatible pointer type
dbdimp.c:804: warning: assignment from incompatible pointer type
dbdimp.c:927: warning: assignment from incompatible pointer type
dbdimp.c: In function 'ib_st_fetch':
dbdimp.c:1314: warning: '0' flag ignored with precision and '%d' printf format
dbdimp.c:1314: warning: '0' flag ignored with precision and '%d' printf format
dbdimp.c:1315: warning: '0' flag ignored with precision and '%d' printf format
dbdimp.c:1446: warning: format '%04d' expects type 'int', but argument 9 has type 'long int'
dbdimp.c:1461: warning: format '%04d' expects type 'int', but argument 6 has type 'long int'
dbdimp.c:1536: warning: cast from pointer to integer of different size
dbdimp.c: In function 'ib_discon_all':
dbdimp.c:1978: warning: value computed is not used
dbdimp.c:1981: error: 'perl_destruct_level' undeclared (first use in this function)
dbdimp.c: In function 'ib_blob_write':
dbdimp.c:2024: warning: format '%d' expects type 'int', but argument 3 has type 'long int'
dbdimp.c: In function 'ib_fill_isqlda':
dbdimp.c:2085: warning: format '%ld' expects type 'long int', but argument 5 has type 'int'
dbdimp.c:2172: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'STRLEN'
dbdimp.c:2172: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'unsigned int'
dbdimp.c:2195: warning: format '%lu' expects type 'long unsigned int', but argument 3 has type 'STRLEN'
dbdimp.c:2195: warning: format '%lu' expects type 'long unsigned int', but argument 4 has type 'unsigned int'
dbdimp.c: In function 'ib_commit_transaction':
dbdimp.c:2679: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'
*** Error code 1

Stop in /mnt/work/perl-dbd-firebird.

dbdimp.c:sv_setbool not available before perl 5.36

Building DBD::Firebird 1.36 against Firebird 4.0.0.2496, as shipped by EPEL 8 and 9 for CentOS/RHEL/Rocky Linux 8 and 9 (which contain both Perl 5.26.3), fails like this (while 1.34 built fine before):

gcc -c  -I"/usr/include" -I"/usr/lib64/perl5/vendor_perl/auto/DBI" -Wall -fno-strict-aliasing -D_REENTRANT -D_GNU_SOURCE -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -Wno-incompatible-pointer-types   -DVERSION=\"1.36\" -DXS_VERSION=\"1.36\" -fPIC "-I/usr/lib64/perl5/CORE"   dbdimp.c
dbdimp.c: In function 'ib_st_fetch':
dbdimp.c:1379:21: error: a label can only be part of a statement and a declaration is not a statement
                     FB_BOOLEAN b = (*((FB_BOOLEAN *) (var->sqldata)));
                     ^~~~~~~~~~
dbdimp.c:1383:21: warning: implicit declaration of function 'sv_setbool'; did you mean 'sv_2bool'? [-Wimplicit-function-declaration]
                     sv_setbool(sv, b == FB_TRUE);
                     ^~~~~~~~~~
                     sv_2bool
dbdimp.c:1701:36: warning: pointer targets in passing argument 7 of 'isc_open_blob2' differ in signedness [-Wpointer-sign]
                                    (char *) NULL);  /* no Blob filter */
                                    ^
In file included from dbdimp.h:77,
                 from Firebird.h:12,
                 from dbdimp.c:15:
/usr/include/ibase.h:556:23: note: expected 'const ISC_UCHAR *' {aka 'const unsigned char *'} but argument is of type 'char *'
 ISC_STATUS ISC_EXPORT isc_open_blob2(ISC_STATUS*,
                       ^~~~~~~~~~~~~~

Fixed (I hope) the test for ib_set_tx_param and the corresponding XS code

I thing the issue was "The new TPB validation logic" starting with Firebird 2.1

The new TPB validation logic now rejects:

  • incorrect order of table reservation options, e.g.
    PROTECTED READ instead of READ
    PROTECTED

    So, I switched order of table reservation options and fixed test 61settx.t

    Please check if it's correct because my knowledge about XS and C, is very limited, to say the least :)

    If it's OK, than remains only the big num tests that fail.

SQL default dialect

Is there any reason not to use default dialect 3 for DBD::Firebird? Now the default is 1.

dbi link is requiring table_info column_info and quote

Hello
I am trying to use your firebird DBI driver for firebird (perl-dbd-firebird). We are currently using firebird very much in our company. These are mainly versions 1.5 and 2.1, 2.5 (i hope it will work with your driver).
I want to use your driver for connecting using dbi link (for postgresql). The problem is that dbi link is requiring table_info column_info and quote.
And as far as i found out, your driver does not have needed 'column_info' method. Do you think you would be able to add this support?
Unfortunately I am not perl guy, so I cannot handle this development stuff easily.

The code which dblink is using for testing dbi driver capabilities is also @github:
https://github.com/davidfetter/DBI-Link/blob/master/dbi_link.sql#L1063

Unfortunatelly the code is 2 years old, but it is our only hope to connect internaly from postgres to firebird :)

regards!

Mariusz Białończyk

DBD::Firebird Install Problem

Your email address was the first listed in the README file downloaded using CPAN.

I've been successfully using DBD::Interbase with various Firebird DBMS installs for the last five years, and wanted to use the latest DBD::Firebird for some of the bug fixes and new features.

The CPAN install failed and I attempted a manual make. This was my result:

root@tek2:~/.cpan/build/DBD-Firebird-1.00-s5CVME# perl Makefile.PL
Possible unintended interpolation of @fid in string at inc/FirebirdMaker.pm line 211.
Possible unintended interpolation of @fid in string at inc/FirebirdMaker.pm line 211.
Possible unintended interpolation of @fid in string at inc/FirebirdMaker.pm line 211.
Possible unintended interpolation of @fid in string at inc/FirebirdMaker.pm line 211.
Bareword found where operator expected at inc/FirebirdMaker.pm line 258, near "/opt"
(Might be a runaway multi-line // string starting on line 211)
Global symbol "$dir" requires explicit package name at inc/FirebirdMaker.pm line 211.
Global symbol "$dir" requires explicit package name at inc/FirebirdMaker.pm line 211.
Global symbol "$find_what" requires explicit package name at inc/FirebirdMaker.pm line 211.
Global symbol "@fid" requires explicit package name at inc/FirebirdMaker.pm line 211.
Global symbol "@fid" requires explicit package name at inc/FirebirdMaker.pm line 211.
Global symbol "$find_what" requires explicit package name at inc/FirebirdMaker.pm line 211.
Global symbol "@fid" requires explicit package name at inc/FirebirdMaker.pm line 211.
Global symbol "$find_what" requires explicit package name at inc/FirebirdMaker.pm line 211.
Global symbol "$dir" requires explicit package name at inc/FirebirdMaker.pm line 211.
Global symbol "@fid" requires explicit package name at inc/FirebirdMaker.pm line 211.
Global symbol "$dir" requires explicit package name at inc/FirebirdMaker.pm line 211.
Global symbol "$dir" requires explicit package name at inc/FirebirdMaker.pm line 211.
Global symbol "$find_what" requires explicit package name at inc/FirebirdMaker.pm line 211.
inc/FirebirdMaker.pm has too many errors.
Compilation failed in require at Makefile.PL line 84.
BEGIN failed--compilation aborted at Makefile.PL line 87.

Any help would be greatly appreciated.

Thank You,
Jim Hapenney

Cleanup temporary files at tests end

Just added code to cleanup temporary files including the test database, (assuming that 'xx-cleanup.t' will be always called last).
Comments are always welcome, if you think is not a good idea revert it. :)

macOS: ld: framework not found Firebird

I am trying to build on macOS 12.0.1 (Monterey) with Apple M1 chip, Firebird DB version 3.0.7:

$ perl Makefile.PL
Configuring DBD::Firebird (on darwin)
Detected Firebird API version 30

FIREBIRD_HOME   : /Library/Frameworks/Firebird.framework/Resources
FIREBIRD_INCLUDE: /Library/Frameworks/Firebird.framework/Headers
FIREBIRD_LIB    : /Library/Frameworks/Firebird.framework/Libraries
Client library  : fbclient

Using DBI 1.643 (for perl 5.034000 on darwin-2level) installed in /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/darwin-2level/auto/DBI/
Found libfbembed, will build DBD::FirebirdEmbed too.
Configuring DBD::FirebirdEmbedded (on darwin)

FIREBIRD_HOME   : /Library/Frameworks/Firebird.framework/Resources
FIREBIRD_INCLUDE: /Library/Frameworks/Firebird.framework/Headers
FIREBIRD_LIB    : /Library/Frameworks/Firebird.framework/Libraries
Client library  : fbclient

Writing MYMETA.yml and MYMETA.json
Generating a Unix-style Makefile
Writing Makefile for DBD::Firebird
Writing MYMETA.yml and MYMETA.json

$ make
Skip blib/lib/DBD/Firebird/TableInfo.pm (unchanged)
Skip blib/lib/DBD/Firebird/TableInfo/Firebird21.pm (unchanged)
Skip blib/lib/DBD/Firebird.pm (unchanged)
Skip blib/lib/DBD/Firebird/TableInfo/Basic.pm (unchanged)
Skip blib/lib/DBD/Firebird/GetInfo.pm (unchanged)
Skip blib/lib/DBD/Firebird/TypeInfo.pm (unchanged)
Skip ../blib/lib/DBD/FirebirdEmbedded.pm (unchanged)
Running Mkbootstrap for FirebirdEmbedded ()
chmod 644 "FirebirdEmbedded.bs"
"/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- FirebirdEmbedded.bs ../blib/arch/auto/DBD/FirebirdEmbedded/FirebirdEmbedded.bs 644
"/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/bin/perl" "/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/ExtUtils/xsubpp" -noprototypes -typemap '/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/ExtUtils/typemap'  FirebirdEmbedded.xs > FirebirdEmbedded.xsc
mv FirebirdEmbedded.xsc FirebirdEmbedded.c
cc -c -I"/Library/Frameworks/Firebird.framework/Headers" -I"/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/darwin-2level/auto/DBI"  -I"/Library/Frameworks/Firebird.framework/Headers" -I"/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/darwin-2level/auto/DBI" -fno-common -DPERL_DARWIN -mmacosx-version-min=11.4 -fno-strict-aliasing -pipe -fstack-protector-strong -DPERL_USE_SAFE_PUTENV -Wno-error=implicit-function-declaration -O3   -DVERSION=\"1.32\" -DXS_VERSION=\"1.32\"  "-I/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/CORE"  -DEMBEDDED FirebirdEmbedded.c
In file included from FirebirdEmbedded.xs:20:
In file included from ./FirebirdEmbedded.h:18:
In file included from ./dbdimp.h:19:
In file included from /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/darwin-2level/auto/DBI/DBIXS.h:23:
In file included from /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/CORE/perl.h:4085:
In file included from /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/CORE/hv.h:659:
In file included from /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/CORE/hv_func.h:34:
In file included from /Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/CORE/sbox32_hash.h:4:
/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/CORE/zaphod32_hash.h:150:5: warning: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
    ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/CORE/zaphod32_hash.h:80:38: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
#define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                     ^~~~~~~~~~
/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/CORE/perl.h:737:29: note: expanded from macro 'STMT_START'
#   define STMT_START   (void)( /* gcc supports "({ STATEMENTS; })" */
                              ^
/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/CORE/zaphod32_hash.h:150:5: note: '{' token is here
    ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/CORE/zaphod32_hash.h:80:49: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
#define ZAPHOD32_SCRAMBLE32(v,prime) STMT_START {  \
                                                ^
/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/CORE/zaphod32_hash.h:150:5: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro]
    ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/CORE/zaphod32_hash.h:87:41: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
    v ^= (v>>23);                       \
                                        ^
/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/CORE/zaphod32_hash.h:150:5: note: ')' token is here
    ZAPHOD32_SCRAMBLE32(state[0],0x9fade23b);
    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/CORE/zaphod32_hash.h:88:3: note: expanded from macro 'ZAPHOD32_SCRAMBLE32'
} STMT_END
  ^~~~~~~~

[...]

dbdimp.c:1530:25: note: ')' token is here
                        SvCUR_set(sv, len/bpc);
                        ^~~~~~~~~~~~~~~~~~~~~~
/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/5.34.0/darwin-2level/CORE/sv.h:1376:45: note: expanded from macro 'SvCUR_set'
                (((XPV*)  SvANY(sv))->xpv_cur = (val)); } STMT_END
                                                          ^~~~~~~~
/Users/hakonhaegland/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/darwin-2level/auto/DBI/dbipport.h:4186:25: note: expanded from macro 'STMT_END'
#  define STMT_END      )
                        ^
84 warnings generated.
rm -f ../blib/arch/auto/DBD/FirebirdEmbedded/FirebirdEmbedded.bundle
cc  -mmacosx-version-min=11.4 -bundle -undefined dynamic_lookup -fstack-protector-strong -framework Firebird   FirebirdEmbedded.o dbdimp.o  -o ../blib/arch/auto/DBD/FirebirdEmbedded/FirebirdEmbedded.bundle  \
	      \

ld: framework not found Firebird
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [../blib/arch/auto/DBD/FirebirdEmbedded/FirebirdEmbedded.bundle] Error 1
make: *** [subdirs] Error 2

This seems to be a problem on macOS 10.15 also, see this comment.

Firebird.xs:1277:13: error: passing argument 1 of ‘isc_event_block’ from incompatible pointer type

DBD::Firebird fails to build in Fedora 40 like this:

gcc -c  -I"/usr/include" -I"/usr/lib64/perl5/vendor_perl/auto/DBI" -Wall -fno-strict-aliasing -D_REENTRANT -D_GNU_SOURCE -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer -fwrapv -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64   -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer  -O2 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches -pipe -Wall -Wno-complain-wrong-lang -Werror=format-security -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1  -m64   -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer   -DVERSION=\"1.34\" -DXS_VERSION=\"1.34\" -fPIC "-I/usr/lib64/perl5/CORE"   Firebird.c
[...]
Firebird.xs: In function ‘XS_DBD__Firebird__db_ib_init_event’:
Firebird.xs:1277:13: error: passing argument 1 of ‘isc_event_block’ from incompatible pointer type [-Wincompatible-pointer-types]
 1277 |             &(ev.event_buffer),
      |             ^~~~~~~~~~~~~~~~~~
      |             |
      |             char **
/usr/include/ibase.h:503:44: note: expected ‘ISC_UCHAR **’ {aka ‘unsigned char **’} but argument is of type ‘char **’
  503 | ISC_LONG ISC_EXPORT_VARARG isc_event_block(ISC_UCHAR**,
      |                                            ^~~~~~~~~~~
Firebird.xs:1278:13: error: passing argument 2 of ‘isc_event_block’ from incompatible pointer type [-Wincompatible-pointer-types]
 1278 |             &(ev.result_buffer),
      |             ^~~~~~~~~~~~~~~~~~~
      |             |
      |             char **
/usr/include/ibase.h:504:84: note: expected ‘ISC_UCHAR **’ {aka ‘unsigned char **’} but argument is of type ‘char **’
  504 |                                                                                    ISC_UCHAR**,
      |                                                                                    ^~~~~~~~~~~

This is most likely related to GCC 14.

Firebird 4: timestamp with timezone in dateadd

Hi, when I use a timestamp with timezone in dateadd, the result is unknown. The Firebird version is '4.0.4'.


my $dbh = DBI->connect( "dbi:Firebird:dbname=$db", $user, $passwd ) or die DBI->errstr;

my $table = 'test_table_unix_seconds';
my $col = 'sec';

$dbh->do( "RECREATE TABLE $table ($col INT)" );
$dbh->do( "INSERT INTO $table ($col) VALUES(86400)" );

my $sth = $dbh->prepare( "SELECT $col, dateadd(SECOND,$col,TIMESTAMP '1970-01-01') FROM $table" );
$sth->execute();
$sth->dump_results;
# 86400, 'Fr 02 Jan 1970 00:00:00 CET'

$sth = $dbh->prepare( "SELECT $col, dateadd(SECOND,$col,TIMESTAMP '1970-01-01 UTC') at time zone 'CET' as ts FROM $table" );
$sth->execute();
$sth->dump_results;
# 86400, '** unknown **'

It works using isql:

#SQL> SELECT sec, dateadd(SECOND,sec,TIMESTAMP '1970-01-01 UTC') at time zone 'CET' as ts FROM test_table_unix_seconds;
#
#         SEC                                                        TS
#============ =========================================================
#       86400 1970-01-02 01:00:00.0000 CET

Non interactive setup for tests with Makefile.PL, by default

I made a comment on the "Integrate patches from fedora/mandriva downstream", but no one seems to noticed it, so i decided to make it a new issue.

The comment was:
"Made some experimental changes in a new branch named newsetup. By default Makefile.PL uses env vars and default values to run as automatic as possible. And now there is also the old behavior with prompts, at request, with the -i[nteractive] command line option. ..."

Changes to the test system includes: All tests use the new 'tests-setup.pl' library. (Old ones used 'lib.pl', 'testlib.pl' and 'Firebird.dbtest'). Renamed some tests and deprecated other.

Makefile.PL has a default non interactive default behavior that, I think, is better for the CPAN testers, but preserves also the old
behavior with prompts, at request, with the -i[nteractive] command line option.

Great work, is nice to see:

All tests successful.  Files=33, Tests=842, 52 wallclock secs ( 0.98 usr 0.15 sys + 9.99 cusr 1.37 csys = 12.49 CPU)
Result: PASS

Thank you, Stefan.

Test fails due to missing symbol: is_ascii_string

Hello Mariuz!

Trying to install (from github clone) on

centos 6
firebird 2.5.0

It builds but gives the following error in make test:

t/00-base.t ............... 1/2 
#   Failed test 'use DBD::Firebird;'
#   at t/00-base.t line 18.
#     Tried to use 'DBD::Firebird'.
#     Error:  Can't load '/development/perl/perl-dbd-firebird/blib/arch/auto/DBD/Firebird/Firebird.so' for module DBD::Firebird: /development/perl/perl-dbd-firebird/blib/arch/auto/DBD/Firebird/Firebird.so: undefined symbol: is_ascii_string at /usr/lib64/perl5/DynaLoader.pm line 200.
#  at (eval 7) line 2
# Compilation failed in require at (eval 7) line 2.
# BEGIN failed--compilation aborted at (eval 7) line 2.
# Looks like you failed 1 test of 2.

optionally link with libfbembed

(In the absence of a mailing list for discussions, I open a ticket)

I have implemented optional linking with libfbembed in the optional-libfbembed branch. The changes are many, so I hesitated to put the work right into master.

Default behavior not changed

Linking with libfbembed is activated only when Makefile.PL has DBD_FIREBIRD_EMBED set to a true value in the environment.

My long-term goal is to be able to produce DBD::Firebird::Embeded together with DBD::Firebird, or otherwise give the user the possibility to choose whether to use the embedded variant or not (defaulting to the current state -- libfbclient). I haven't figured out yet how to achieve this, so as an intermediate step and a prove of concept -- an option to link DBD::Firebird with libfbembed.

Linking with the embedded library drops the need of Firebird server on the system and makes it possible to run the tests in automated environment -- be it CPAN testers or Debian/Ubuntu build daemons, as well as for tests to be run by unprivileged users, with no access to Firebird administrator credentials.

Comments/blame welcome :)

Fix for Interactive mode

Because of the 'skip_all' from the beginning of 'test-setup.pl' helper script, the interactive mode was disabled.
Simple fix by adding test for 'pass' parameter.

Sorry, waned to amend the commit message and got a merge.

user/password for tests visible in process list

The check_database subroutine of t/tests-setup.pl gives the admin user/password as arguments to ISQL's command line. These are visible in ps process list.

my $ocmd = qq("$isql" -u "$user" -p "$pass" -x "$path" 2>&1);

I'll work on modifying the code to put the user/password in the SQL given to ISQL, as this is made in other places.

CPAN Testers reports for DBD::Firebird = UNKNOWN

I have noticed that all CPAN Testers reports for DBD::Firebird are with
UNKNOWN grade.

The reason is always:

In file included from Firebird.h:12,
                           from Firebird.xs:14:
dbdimp.h:13:67: error: DBIXS.h: No such file or directory

Maybe the fix might be to include dbivport.h, like in Pg.h from DBD::Pg?

#include <DBIXS.h>      /* installed by the DBI module */
#include <dbivport.h>   /* DBI portability macros */

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.