You can subscribe to this list here.
2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(77) |
Sep
(18) |
Oct
(29) |
Nov
(13) |
Dec
(5) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2002 |
Jan
(18) |
Feb
(18) |
Mar
(10) |
Apr
(22) |
May
(2) |
Jun
(25) |
Jul
(12) |
Aug
(10) |
Sep
(19) |
Oct
(19) |
Nov
(20) |
Dec
(16) |
2003 |
Jan
(5) |
Feb
(5) |
Mar
(30) |
Apr
(1) |
May
(4) |
Jun
(37) |
Jul
(23) |
Aug
(3) |
Sep
|
Oct
|
Nov
|
Dec
(5) |
2004 |
Jan
(2) |
Feb
(5) |
Mar
(31) |
Apr
(3) |
May
(2) |
Jun
(3) |
Jul
(22) |
Aug
|
Sep
(1) |
Oct
|
Nov
(3) |
Dec
(6) |
2005 |
Jan
|
Feb
(4) |
Mar
|
Apr
(15) |
May
(5) |
Jun
(1) |
Jul
(29) |
Aug
(42) |
Sep
(24) |
Oct
(11) |
Nov
(8) |
Dec
|
2006 |
Jan
(3) |
Feb
(3) |
Mar
(1) |
Apr
(10) |
May
(21) |
Jun
(3) |
Jul
|
Aug
(2) |
Sep
|
Oct
|
Nov
(2) |
Dec
|
2007 |
Jan
(2) |
Feb
(20) |
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(3) |
Aug
(6) |
Sep
|
Oct
|
Nov
|
Dec
(9) |
2008 |
Jan
(8) |
Feb
(27) |
Mar
(24) |
Apr
(17) |
May
(9) |
Jun
(11) |
Jul
(9) |
Aug
|
Sep
(7) |
Oct
(14) |
Nov
(6) |
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(6) |
2010 |
Jan
(32) |
Feb
|
Mar
|
Apr
|
May
(2) |
Jun
(1) |
Jul
(4) |
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
(6) |
2011 |
Jan
(10) |
Feb
(3) |
Mar
|
Apr
|
May
|
Jun
|
Jul
(4) |
Aug
(10) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(8) |
Dec
(4) |
2013 |
Jan
(23) |
Feb
(15) |
Mar
(1) |
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
(6) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(4) |
Oct
|
Nov
(5) |
Dec
|
2015 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(6) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
|
2018 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
2019 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(5) |
Dec
|
From: Alex B. <al...@al...> - 2014-11-02 18:25:08
|
I have a very simple program (below) only marginally adapted from the example here: http://libdbi.sourceforge.net/docs/programmers-guide/quickstart-code.html which works, but when run through valgrind produces an enormous number of errors. The program in its entirety is below. It makes a connection to pgsql, does no queries, and immediately shuts the connection. I'm not so much worried about the alleged memory leaks but the 85 instances of "Conditional jump or move depends on uninitialised value(s)". I don't know if this is a real problem, but even if not the challenge here is that /any/ query via dbi is now tainted as uninitialised, so it's impossible to see 'real' errors. I've not attached a full valgrind dump as it's enormous. However, you can see the first two below. Any ideas? My platform is stock Ubuntu 14.04: libdbd-pgsql:amd64 0.9.0-2ubuntu2 libdbi1:amd64 0.9.0-1 libdbi-dev 0.9.0-1 -- Alex Bligh #include <stdio.h> #include <stdlib.h> #include <dbi/dbi.h> #include <string.h> /* * test.c * * compile with: * gcc -Wall -o test test.c -ldbi * * Run with: * ./test USERNAME PASSWORD [DBNAME] * */ int main (int argc, char **argv) { dbi_conn conn = NULL; dbi_inst conn_instance; if (argc < 3) { fprintf (stderr, "Syntax: test USERNAME PASSWORD [DBNAME]\n"); exit (1); } /* return if already started */ if (conn) return 0; /* should be unnecessary */ memset (&conn_instance, 0, sizeof (conn_instance)); dbi_initialize_r (NULL, &conn_instance); conn = dbi_conn_new_r ("pgsql", conn_instance); dbi_conn_set_option (conn, "host", "127.0.0.1"); dbi_conn_set_option (conn, "username", argv[1]); dbi_conn_set_option (conn, "password", argv[2]); if (argv[3]) dbi_conn_set_option (conn, "dbname", argv[3]); dbi_conn_set_option (conn, "encoding", "UTF-8"); if (dbi_conn_connect (conn) < 0) { fprintf (stderr, "CONN error: cannot connect\n"); exit (1); } dbi_conn_close (conn); dbi_shutdown_r (conn_instance); fprintf (stderr, "CONN test passed\n"); exit (0); } ==28748== Memcheck, a memory error detector ==28748== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. ==28748== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info ==28748== Command: ./test tigerlily 6LXKKJV1QsbR38Hw tigerlily ==28748== Parent PID: 39449 ==28748== ==28748== Conditional jump or move depends on uninitialised value(s) ==28748== at 0x5E77048: ??? (in /lib/x86_64-linux-gnu/libssl.so.1.0.0) ==28748== by 0x5E6DA22: ??? (in /lib/x86_64-linux-gnu/libssl.so.1.0.0) ==28748== by 0x5E6B053: ??? (in /lib/x86_64-linux-gnu/libssl.so.1.0.0) ==28748== by 0x5C3A936: ??? (in /usr/lib/libpq.so.5.6) ==28748== by 0x5C316B6: ??? (in /usr/lib/libpq.so.5.6) ==28748== by 0x5C2AA34: PQconnectPoll (in /usr/lib/libpq.so.5.6) ==28748== by 0x5C2BB8D: ??? (in /usr/lib/libpq.so.5.6) ==28748== by 0x5C2C496: PQconnectdb (in /usr/lib/libpq.so.5.6) ==28748== by 0x5A16EA9: _dbd_real_connect (in /usr/lib/x86_64-linux-gnu/dbd/libdbdpgsql.so) ==28748== by 0x4E3C7BE: dbi_conn_connect (in /usr/lib/x86_64-linux-gnu/libdbi.so.1.1.0) ==28748== by 0x400A2C: main (in /home/amb/extility/git/superproject-3.1/extility-vncforwarder/vncforwarder/test) ==28748== ==28748== Conditional jump or move depends on uninitialised value(s) ==28748== at 0x5C2ACEF: PQconnectPoll (in /usr/lib/libpq.so.5.6) ==28748== by 0x5C2BB8D: ??? (in /usr/lib/libpq.so.5.6) ==28748== by 0x5C2C496: PQconnectdb (in /usr/lib/libpq.so.5.6) ==28748== by 0x5A16EA9: _dbd_real_connect (in /usr/lib/x86_64-linux-gnu/dbd/libdbdpgsql.so) ==28748== by 0x4E3C7BE: dbi_conn_connect (in /usr/lib/x86_64-linux-gnu/libdbi.so.1.1.0) ==28748== by 0x400A2C: main (in /home/amb/extility/git/superproject-3.1/extility-vncforwarder/vncforwarder/test) (and on and on and on) |
From: Markus H. <mar...@mh...> - 2014-09-09 23:28:25
|
At 2014-09-09 23:50 S M was heard to say: > I installed the 0.8.3 libdbi/libdbi-devl packages from the yum repos. I did clone the latest version from git but there was configure file to compile it.-- If you work straight from a repo you need to bootstrap your local sources. Both libdbi and libdbi-drivers contain an autogen.sh script in the top-level directory which will generate an appropriate configure script for you. regards Markus -- Markus Hoenicka http://www.mhoenicka.de AQ score 38 |
From: S M <sad...@ya...> - 2014-09-09 21:50:41
|
I installed the 0.8.3 libdbi/libdbi-devl packages from the yum repos. I did clone the latest version from git but there was configure file to compile it. At 2014-09-08 15:50 S M was heard to say: Hi, > >I'm trying compile libdbi with DB2 support. I've downloaded the latest version (libdbi-drivers-0.9.0) and exec'ed > >./configure --with-db2 --with-db2-incdir=/opt/ibm/db2/V10.5/include --with-db2-dir=/opt/ibm/db2/V10.5 > >That part worked. But when running 'make' it fails with: >[...] >dbd_db2.c: At top level: >dbd_db2.c:267: error: conflicting types for 'dbd_goto_row' >/usr/include/dbi/dbd.h:41: note: previous declaration of 'dbd_goto_row' was here Hi, this smells like a mismatch between your libdbi headers/libraries and the driver version you're trying to build. The dbd_goto_row() prototype and driver implementations were changed in early 2013. Make sure you have a matching libdbi 0.9 for your libdbi-drivers 0.9, or better yet, use the git versions of both if you're fiddling with experimental drivers. regards, Markus -- Markus Hoenicka http://www.mhoenicka.de AQ score 38 |
From: Markus H. <mar...@mh...> - 2014-09-08 21:27:41
|
At 2014-09-08 15:50 S M was heard to say: > Hi, > > I'm trying compile libdbi with DB2 support. I've downloaded the latest version (libdbi-drivers-0.9.0) and exec'ed > > ./configure --with-db2 --with-db2-incdir=/opt/ibm/db2/V10.5/include --with-db2-dir=/opt/ibm/db2/V10.5 > > That part worked. But when running 'make' it fails with: > [...] > dbd_db2.c: At top level: > dbd_db2.c:267: error: conflicting types for 'dbd_goto_row' > /usr/include/dbi/dbd.h:41: note: previous declaration of 'dbd_goto_row' was here Hi, this smells like a mismatch between your libdbi headers/libraries and the driver version you're trying to build. The dbd_goto_row() prototype and driver implementations were changed in early 2013. Make sure you have a matching libdbi 0.9 for your libdbi-drivers 0.9, or better yet, use the git versions of both if you're fiddling with experimental drivers. regards, Markus -- Markus Hoenicka http://www.mhoenicka.de AQ score 38 |
From: S M <sad...@ya...> - 2014-09-08 13:50:55
|
Hi, I'm trying compile libdbi with DB2 support. I've downloaded the latest version (libdbi-drivers-0.9.0) and exec'ed ./configure --with-db2 --with-db2-incdir=/opt/ibm/db2/V10.5/include --with-db2-dir=/opt/ibm/db2/V10.5 That part worked. But when running 'make' it fails with: make all-recursive make[1]: Entering directory `/var/tmp/libdbi-drivers-0.9.0' Making all in drivers make[2]: Entering directory `/var/tmp/libdbi-drivers-0.9.0/drivers' Making all in mysql make[3]: Entering directory `/var/tmp/libdbi-drivers-0.9.0/drivers/mysql' make[3]: Nothing to be done for `all'. make[3]: Leaving directory `/var/tmp/libdbi-drivers-0.9.0/drivers/mysql' Making all in pgsql make[3]: Entering directory `/var/tmp/libdbi-drivers-0.9.0/drivers/pgsql' make[3]: Nothing to be done for `all'. make[3]: Leaving directory `/var/tmp/libdbi-drivers-0.9.0/drivers/pgsql' Making all in sqlite make[3]: Entering directory `/var/tmp/libdbi-drivers-0.9.0/drivers/sqlite' make[3]: Nothing to be done for `all'. make[3]: Leaving directory `/var/tmp/libdbi-drivers-0.9.0/drivers/sqlite' Making all in sqlite3 make[3]: Entering directory `/var/tmp/libdbi-drivers-0.9.0/drivers/sqlite3' make[3]: Nothing to be done for `all'. make[3]: Leaving directory `/var/tmp/libdbi-drivers-0.9.0/drivers/sqlite3' Making all in msql make[3]: Entering directory `/var/tmp/libdbi-drivers-0.9.0/drivers/msql' make[3]: Nothing to be done for `all'. make[3]: Leaving directory `/var/tmp/libdbi-drivers-0.9.0/drivers/msql' Making all in oracle make[3]: Entering directory `/var/tmp/libdbi-drivers-0.9.0/drivers/oracle' make[3]: Nothing to be done for `all'. make[3]: Leaving directory `/var/tmp/libdbi-drivers-0.9.0/drivers/oracle' Making all in firebird make[3]: Entering directory `/var/tmp/libdbi-drivers-0.9.0/drivers/firebird' make[3]: Nothing to be done for `all'. make[3]: Leaving directory `/var/tmp/libdbi-drivers-0.9.0/drivers/firebird' Making all in freetds make[3]: Entering directory `/var/tmp/libdbi-drivers-0.9.0/drivers/freetds' make[3]: Nothing to be done for `all'. make[3]: Leaving directory `/var/tmp/libdbi-drivers-0.9.0/drivers/freetds' Making all in ingres make[3]: Entering directory `/var/tmp/libdbi-drivers-0.9.0/drivers/ingres' make[3]: Nothing to be done for `all'. make[3]: Leaving directory `/var/tmp/libdbi-drivers-0.9.0/drivers/ingres' Making all in db2 make[3]: Entering directory `/var/tmp/libdbi-drivers-0.9.0/drivers/db2' /bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../include -I/opt/ibm/db2/V10.5/include -I/include -std=gnu99 -MT dbd_db2.lo -MD -MP -MF .deps/dbd_db2.Tpo -c -o dbd_db2.lo dbd_db2.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../include -I/opt/ibm/db2/V10.5/include -I/include -std=gnu99 -MT dbd_db2.lo -MD -MP -MF .deps/dbd_db2.Tpo -c dbd_db2.c -fPIC -DPIC -o .libs/dbd_db2.o dbd_db2.c: In function 'dbd_connect': dbd_db2.c:134: warning: cast from pointer to integer of different size dbd_db2.c:140: warning: cast from pointer to integer of different size dbd_db2.c:145: warning: cast from pointer to integer of different size dbd_db2.c:154: warning: cast from pointer to integer of different size dbd_db2.c:156: warning: cast from pointer to integer of different size dbd_db2.c:162: warning: cast from pointer to integer of different size dbd_db2.c:169: warning: cast from pointer to integer of different size dbd_db2.c: In function 'dbd_disconnect': dbd_db2.c:185: warning: cast from pointer to integer of different size dbd_db2.c:187: warning: cast from pointer to integer of different size dbd_db2.c:190: warning: cast from pointer to integer of different size dbd_db2.c:192: warning: cast from pointer to integer of different size dbd_db2.c:195: warning: cast from pointer to integer of different size dbd_db2.c:197: warning: cast from pointer to integer of different size dbd_db2.c: In function 'dbd_geterror': dbd_db2.c:230: warning: cast from pointer to integer of different size dbd_db2.c: At top level: dbd_db2.c:267: error: conflicting types for 'dbd_goto_row' /usr/include/dbi/dbd.h:41: note: previous declaration of 'dbd_goto_row' was here dbd_db2.c: In function 'dbd_free_query': dbd_db2.c:291: warning: cast from pointer to integer of different size dbd_db2.c:293: warning: cast from pointer to integer of different size dbd_db2.c: In function 'dbd_get_engine_version': dbd_db2.c:348: warning: cast from pointer to integer of different size dbd_db2.c:350: warning: cast from pointer to integer of different size dbd_db2.c: In function 'dbd_list_tables': dbd_db2.c:383: warning: cast from pointer to integer of different size dbd_db2.c:385: warning: cast from pointer to integer of different size dbd_db2.c:409: warning: cast from pointer to integer of different size dbd_db2.c:414: warning: cast to pointer from integer of different size dbd_db2.c: In function 'dbd_query': dbd_db2.c:472: warning: cast from pointer to integer of different size dbd_db2.c:474: warning: cast from pointer to integer of different size dbd_db2.c:483: warning: cast from pointer to integer of different size dbd_db2.c:517: warning: cast from pointer to integer of different size dbd_db2.c:551: warning: cast from pointer to integer of different size dbd_db2.c:553: warning: cast from pointer to integer of different size dbd_db2.c:562: warning: cast from pointer to integer of different size dbd_db2.c:573: warning: cast to pointer from integer of different size dbd_db2.c: In function '_get_field_info': dbd_db2.c:817: warning: cast from pointer to integer of different size dbd_db2.c:827: warning: cast from pointer to integer of different size dbd_db2.c: In function '_get_row_data': dbd_db2.c:872: warning: cast from pointer to integer of different size dbd_db2.c:874: warning: cast from pointer to integer of different size dbd_db2.c:905: warning: cast from pointer to integer of different size dbd_db2.c:910: warning: cast from pointer to integer of different size dbd_db2.c:916: warning: cast from pointer to integer of different size dbd_db2.c:923: warning: cast from pointer to integer of different size dbd_db2.c:935: warning: cast from pointer to integer of different size dbd_db2.c:940: warning: cast from pointer to integer of different size dbd_db2.c:950: warning: cast from pointer to integer of different size dbd_db2.c:958: warning: cast from pointer to integer of different size dbd_db2.c:969: warning: cast from pointer to integer of different size dbd_db2.c:973: warning: passing argument 1 of 'snprintf' discards qualifiers from pointer target type /usr/include/stdio.h:385: note: expected 'char * restrict' but argument is of type 'const char *' dbd_db2.c:976: warning: cast from pointer to integer of different size dbd_db2.c:980: warning: passing argument 1 of 'snprintf' discards qualifiers from pointer target type /usr/include/stdio.h:385: note: expected 'char * restrict' but argument is of type 'const char *' dbd_db2.c:983: warning: cast from pointer to integer of different size dbd_db2.c:990: warning: passing argument 1 of 'snprintf' discards qualifiers from pointer target type /usr/include/stdio.h:385: note: expected 'char * restrict' but argument is of type 'const char *' dbd_db2.c: In function '_set_error_handle': dbd_db2.c:1017: warning: cast to pointer from integer of different size make[3]: *** [dbd_db2.lo] Error 1 make[3]: Leaving directory `/var/tmp/libdbi-drivers-0.9.0/drivers/db2' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/var/tmp/libdbi-drivers-0.9.0/drivers' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/var/tmp/libdbi-drivers-0.9.0' make: *** [all] Error 2 Any idea how to make this work? Thanks, Sadek |
From: Rick R. <spl...@gm...> - 2014-01-10 15:42:49
|
As you suggested, switch to dbi_conn_query and it took care of the issue. Appreciate the quick responses and suggestions. Ill be spending more time on the manual this week:) Thanks, Rj On Fri, Jan 10, 2014 at 10:23 AM, Markus Hoenicka < mar...@mh...> wrote: > At 2014-01-10 15:56, Rick Robinson was heard to say: > > I have tried the following, which I believe is on the right track but the > program crashes as soon as it gets to dbi_conn_quote_string_copy. I try to > use dbi_conn_quote_string_copy to keep the bad string locked down, and then > use dbi_conn_queryf to read the new locked down value into the db. Sadly, I > am not the greatest C coder so I am probably overlooking something > relatively simple to make this work. > > char *pTitle=NULL; > char *pTitle2=NULL; > > if ((ch)->player.title) > { > sprintf (pTitle, (ch)->player.title); > } > else > { > sprintf (pTitle, "None"); > } > > dbi_conn_quote_string_copy(conn, pTitle, &pTitle2); > > sprintf (sql_columns, "name, title"); > sprintf (sql_string, "REPLACE into data (%s) VALUES (\"%s\", > \"%s\")", > sql_columns, > GET_NAME (ch), > pTitle2 ); > > result = dbi_conn_queryf (conn, sql_string); > > > Well, this is not a list about C coding, but it looks like you sprintf() some string to a non-allocated buffer. I'm just wondering why the code doesn't crash in sprintf() then. > > In any case, it is far simpler to use dbi_conn_quote_string_copy() on the assembled SQL query string rather than on single items. E.g. the quoted string is surrounded by escape characters, and you subsequently wrap another pair around the title. This does not seem to generate valid SQL. Also, if you don't use the printf()-like capabilities of dbi_conn_queryf(), there is no point in using this function. Use dbi_conn_query() instead. > > > regards, > Markus > > -- > Markus Hoenickahttp://www.mhoenicka.de > AQ score 38 > > > > ------------------------------------------------------------------------------ > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > Learn Why More Businesses Are Choosing CenturyLink Cloud For > Critical Workloads, Development Environments & Everything In Between. > Get a Quote or Start a Free Trial Today. > > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > _______________________________________________ > libdbi-users mailing list > lib...@li... > https://lists.sourceforge.net/lists/listinfo/libdbi-users > > |
From: Markus H. <mar...@mh...> - 2014-01-10 15:23:28
|
At 2014-01-10 15:56, Rick Robinson was heard to say: > I have tried the following, which I believe is on the right track but the program crashes as soon as it gets to dbi_conn_quote_string_copy. I try to use dbi_conn_quote_string_copy to keep the bad string locked down, and then use dbi_conn_queryf to read the new locked down value into the db. Sadly, I am not the greatest C coder so I am probably overlooking something relatively simple to make this work. > > char *pTitle=NULL; > > char *pTitle2=NULL; > > if ((ch)->player.title) > { > sprintf (pTitle, (ch)->player.title); > } > else > { > sprintf (pTitle, "None"); > } > > dbi_conn_quote_string_copy(conn, pTitle, &pTitle2); > > sprintf (sql_columns, "name, title"); > sprintf (sql_string, "REPLACE into data (%s) VALUES ("%s", "%s")", > sql_columns, > GET_NAME (ch), > pTitle2 ); > > result = dbi_conn_queryf (conn, sql_string); Well, this is not a list about C coding, but it looks like you sprintf() some string to a non-allocated buffer. I'm just wondering why the code doesn't crash in sprintf() then. In any case, it is far simpler to use dbi_conn_quote_string_copy() on the assembled SQL query string rather than on single items. E.g. the quoted string is surrounded by escape characters, and you subsequently wrap another pair around the title. This does not seem to generate valid SQL. Also, if you don't use the printf()-like capabilities of dbi_conn_queryf(), there is no point in using this function. Use dbi_conn_query() instead. regards, Markus -- Markus Hoenicka http://www.mhoenicka.de AQ score 38 |
From: Rick R. <spl...@gm...> - 2014-01-10 14:56:37
|
I am pretty sure I am using dbi_conn_queryf correctly, the code below is actually much longer but I have shortened it to just show an example of the issue. I have two column names, name and title, and want to read in two string values using dbi_conn_queryf. I need to lock down the second value being read into the DB and read it as is. sprintf (sql_columns, "name, title"); sprintf (sql_string, "REPLACE into data (%s) VALUES (\"%s\", \"%s\")", sql_columns, GET_NAME (ch), ch->player.title ? ch->player.title : "None") ); result = dbi_conn_queryf (conn, sql_string); I have tried the following, which I believe is on the right track but the program crashes as soon as it gets to dbi_conn_quote_string_copy. I try to use dbi_conn_quote_string_copy to keep the bad string locked down, and then use dbi_conn_queryf to read the new locked down value into the db. Sadly, I am not the greatest C coder so I am probably overlooking something relatively simple to make this work. char *pTitle=NULL; char *pTitle2=NULL; if ((ch)->player.title) { sprintf (pTitle, (ch)->player.title); } else { sprintf (pTitle, "None"); } dbi_conn_quote_string_copy(conn, pTitle, &pTitle2); sprintf (sql_columns, "name, title"); sprintf (sql_string, "REPLACE into data (%s) VALUES (\"%s\", \"%s\")", sql_columns, GET_NAME (ch), pTitle2 ); result = dbi_conn_queryf (conn, sql_string); Thank you for any help or thoughts provided and the library! On Fri, Jan 10, 2014 at 8:40 AM, Markus Hoenicka < mar...@mh...> wrote: > Am 2014-01-10 14:17, schrieb Markus Hoenicka: > > > > if I understand you correctly, you attempt to insert a value containing the string "%s Saints going down tonight!!!!!" using the libdbi function dbi_conn_queryf(). Thing is, dbi_conn_queryf() is intended to make dbi_conn_query() behave somewhat like sprintf() in that you can specify a formatting string containing placeholders like "%s", followed by parameters that are filled in. If you want to preserve the "%s" literally, you either need to escape or quote the values properly, or you should rather use dbi_conn_query() which sends the string parameter to the db engine literally. You still need to watch out for proper quoting and escaping as per the language specs of your db engine. > > I forgot to mention that the dbi_conn_quote_string() and dbi_conn_escape_string() functions and their relatives can do the quoting and escaping for you, please check the manual. > > regards, > > Markus > > -- > Markus Hoenickahttp://www.mhoenicka.de > AQ score 38 > > > > ------------------------------------------------------------------------------ > CenturyLink Cloud: The Leader in Enterprise Cloud Services. > Learn Why More Businesses Are Choosing CenturyLink Cloud For > Critical Workloads, Development Environments & Everything In Between. > Get a Quote or Start a Free Trial Today. > > http://pubads.g.doubleclick.net/gampad/clk?id=119420431&iu=/4140/ostg.clktrk > _______________________________________________ > libdbi-users mailing list > lib...@li... > https://lists.sourceforge.net/lists/listinfo/libdbi-users > > |
From: Markus H. <mar...@mh...> - 2014-01-10 13:41:02
|
Am 2014-01-10 14:17, schrieb Markus Hoenicka: > if I understand you correctly, you attempt to insert a value containing the string "%s Saints going down tonight!!!!!" using the libdbi function dbi_conn_queryf(). Thing is, dbi_conn_queryf() is intended to make dbi_conn_query() behave somewhat like sprintf() in that you can specify a formatting string containing placeholders like "%s", followed by parameters that are filled in. If you want to preserve the "%s" literally, you either need to escape or quote the values properly, or you should rather use dbi_conn_query() which sends the string parameter to the db engine literally. You still need to watch out for proper quoting and escaping as per the language specs of your db engine. I forgot to mention that the dbi_conn_quote_string() and dbi_conn_escape_string() functions and their relatives can do the quoting and escaping for you, please check the manual. regards, Markus -- Markus Hoenicka http://www.mhoenicka.de AQ score 38 |
From: Markus H. <mar...@mh...> - 2014-01-10 13:32:05
|
Am 2014-01-09 18:49, schrieb Rick Robinson: > I am new to both DBs and this library. I am attempting to save a string and insert it into my MYSQL DB. > > An example of the data being read into the db is here: > > The name is Krolps, and title is everything after it: > Krolps %s Saints going down tonight!!!!! > > The title entry in the MYSQL DB is turned into > name, title > > Here is my small program below: > > void > website_pfile_phase_one (struct char_data *ch) > { > dbi_conn conn; > dbi_result result; > dbi_inst instance; > > dbi_initialize_r (NULL, &instance); > conn = dbi_conn_new_r ("mysql", instance); > > dbi_conn_set_option (conn, "host", "box"); > dbi_conn_set_option (conn, "username", "username"); > dbi_conn_set_option (conn, "password", "password"); > dbi_conn_set_option (conn, "dbname", "dnbname"); > dbi_conn_set_option (conn, "encoding", "UTF-8"); > > if (dbi_conn_connect (conn) < 0) > { > puts ("Could not connect. Please check the option settingsn"); > } > else > { > char sql_string[MAX_STRING_LENGTH], sql_columns[MAX_STRING_LENGTH]; > > sprintf (sql_columns, > "name, title"); > sprintf (sql_string, > "REPLACE into data (%s) VALUES ("%s", "%s")", > sql_columns, GET_NAME (ch), ch->player.title ? ch->player.title : "None") ); > > result = dbi_conn_queryf (conn, sql_string); > > if (result) > { > puts ("SUCCESS Website Data"); > } > dbi_result_free (result); > } > dbi_conn_close (conn); > puts ("END of website data"); > dbi_shutdown_r (instance); > } > > Any suggestions on what I am doing wrong? My guess is I need to chanfge dbi_conn_queryf to something else? Hi, if I understand you correctly, you attempt to insert a value containing the string "%s Saints going down tonight!!!!!" using the libdbi function dbi_conn_queryf(). Thing is, dbi_conn_queryf() is intended to make dbi_conn_query() behave somewhat like sprintf() in that you can specify a formatting string containing placeholders like "%s", followed by parameters that are filled in. If you want to preserve the "%s" literally, you either need to escape or quote the values properly, or you should rather use dbi_conn_query() which sends the string parameter to the db engine literally. You still need to watch out for proper quoting and escaping as per the language specs of your db engine. hope this helps Markus -- Markus Hoenicka http://www.mhoenicka.de AQ score 38 |
From: Rick R. <spl...@gm...> - 2014-01-09 17:50:04
|
I am new to both DBs and this library. I am attempting to save a string and insert it into my MYSQL DB. An example of the data being read into the db is here: The name is Krolps, and title is everything after it: Krolps %s Saints going down tonight!!!!! The title entry in the MYSQL DB is turned into name, title Here is my small program below: void website_pfile_phase_one (struct char_data *ch) { dbi_conn conn; dbi_result result; dbi_inst instance; dbi_initialize_r (NULL, &instance); conn = dbi_conn_new_r ("mysql", instance); dbi_conn_set_option (conn, "host", "box"); dbi_conn_set_option (conn, "username", "username"); dbi_conn_set_option (conn, "password", "password"); dbi_conn_set_option (conn, "dbname", "dnbname"); dbi_conn_set_option (conn, "encoding", "UTF-8"); if (dbi_conn_connect (conn) < 0) { puts ("Could not connect. Please check the option settings\n"); } else { char sql_string[MAX_STRING_LENGTH], sql_columns[MAX_STRING_LENGTH]; sprintf (sql_columns, "name, title"); sprintf (sql_string, "REPLACE into data (%s) VALUES (\"%s\", \"%s\")", sql_columns, GET_NAME (ch), ch->player.title ? ch->player.title : "None") ); result = dbi_conn_queryf (conn, sql_string); if (result) { puts ("SUCCESS Website Data"); } dbi_result_free (result); } dbi_conn_close (conn); puts ("END of website data"); dbi_shutdown_r (instance); } Any suggestions on what I am doing wrong? My guess is I need to chanfge dbi_conn_queryf to something else? I subscribed today so I may not get any responses, if you could reply to my address also, it would be appreciated! spl...@gm... Thanks for any help or suggestions, Rj |
From: Markus H. <mar...@mh...> - 2013-06-11 09:22:56
|
Am 2013-06-11 10:53, schrieb Flur Blubr: > ./configure --prefix=/apps/cactiprod/syslog-ng/libdbi-drivers --with-dbi-incdir=/apps/cactiprod/syslog-ng/libdbi/include/dbi --with-dbi-libdir=/apps/cactiprod/syslog-ng/libdbi/lib --with-mysql --with-mysql-libdir=/apps/cactiprod/mariadb/lib --with-mysql-incdir=/apps/cactiprod/mariadb/include/mysql --disable-docs > > [...] dbd_mysql.c:50:21: error: dbi/dbi.h: No such file or directory Hi there, I haven't tested this yet, but you should get better results if you specify the libdbi include directory as "--with-dbi-incdir=/apps/cactiprod/syslog-ng/libdbi/include" (no trailing "/dbi"). The sources reference the include files as "dbi/foo.h", so the trailing "dbi" in your specification confused the preprocessor. NB the --XX-incdir and --XX-libdir options should be avoided anyway and should probably have been removed or at least be deprecated. For a cleaner solution, please define CFLAGS and LDFLAGS appropriately before running configure and make. regards, Markus -- Markus Hoenicka http://www.mhoenicka.de AQ score 38 |
From: Flur B. <fb...@gm...> - 2013-06-11 08:53:35
|
Dear all, trying to compile syslog-ng from scratch on RHEL Santiago with MySQL support [MariaDB], I believe that last dependency missing is libdbi-drivers however there is and issue i cannot understand --> libdbi compiled fine with following ./configure --prefix=/apps/cactiprod/syslog-ng/libdbi / and i have tryied also ./configure --with-ltdl --prefix=/apps/cactiprod/syslog-ng/libdbi make && make install - but libdbi-drives are failing during compilation ["make"] Can somebody please explain to me what I am doing wrong and why it cannot compile? Doing everything as root, versions are following: libdbi-drivers-0.9.0 libdbi-0.9.0 ./configure --prefix=/apps/cactiprod/syslog-ng/libdbi-drivers --with-dbi-incdir=/apps/cactiprod/syslog-ng/libdbi/include/dbi --with-dbi-libdir=/apps/cactiprod/syslog-ng/libdbi/lib --with-mysql --with-mysql-libdir=/apps/cactiprod/mariadb/lib --with-mysql-incdir=/apps/cactiprod/mariadb/include/mysql --disable-docs checking whether to enable maintainer-specific portions of Makefiles... no checking for a BSD-compatible install... /bin/install -c checking whether build environment is sane... yes checking for a thread-safe mkdir -p... /bin/mkdir -p checking for gawk... gawk checking whether make sets $(MAKE)... yes checking build system type... x86_64-unknown-linux-gnu checking host system type... x86_64-unknown-linux-gnu checking for gcc... gcc checking whether the C compiler works... yes checking for C compiler default output file name... a.out checking for suffix of executables... checking whether we are cross compiling... no checking for suffix of object files... o checking whether we are using the GNU C compiler... yes checking whether gcc accepts -g... yes checking for gcc option to accept ISO C89... none needed checking for style of include used by make... GNU checking dependency style of gcc... gcc3 checking for a sed that does not truncate output... /bin/sed checking for grep that handles long lines and -e... /bin/grep checking for egrep... /bin/grep -E checking for fgrep... /bin/grep -F checking how to print strings... printf checking for ld used by gcc... /bin/ld checking if the linker (/bin/ld) is GNU ld... yes checking for BSD- or MS-compatible name lister (nm)... /bin/nm -B checking the name lister (/bin/nm -B) interface... BSD nm checking whether ln -s works... yes checking the maximum length of command line arguments... 1966080 checking whether the shell understands some XSI constructs... yes checking whether the shell understands "+="... yes checking how to convert x86_64-unknown-linux-gnu file names to x86_64-unknown-linux-gnu format... func_convert_file_noop checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop checking for /bin/ld option to reload object files... -r checking for objdump... objdump checking how to recognize dependent libraries... pass_all checking for dlltool... dlltool checking how to associate runtime and link libraries... printf %s\n checking for ar... ar checking for archiver @FILE support... @ checking for strip... strip checking for ranlib... ranlib checking command to parse /bin/nm -B output from gcc object... ok checking for sysroot... no checking for mt... no checking if : is a manifest tool... no checking how to run the C preprocessor... gcc -E checking for ANSI C header files... yes checking for sys/types.h... yes checking for sys/stat.h... yes checking for stdlib.h... yes checking for string.h... yes checking for memory.h... yes checking for strings.h... yes checking for inttypes.h... yes checking for stdint.h... yes checking for unistd.h... yes checking for dlfcn.h... yes checking for objdir... .libs checking if gcc supports -fno-rtti -fno-exceptions... no checking for gcc option to produce PIC... -fPIC -DPIC checking if gcc PIC flag -fPIC -DPIC works... yes checking if gcc static flag -static works... no checking if gcc supports -c -o file.o... yes checking if gcc supports -c -o file.o... (cached) yes checking whether the gcc linker (/bin/ld -m elf_x86_64) supports shared libraries... yes checking whether -lc should be explicitly linked in... no checking dynamic linker characteristics... GNU/Linux ld.so checking how to hardcode library paths into programs... immediate checking whether stripping libraries is possible... yes checking if libtool supports shared libraries... yes checking whether to build shared libraries... yes checking whether to build static libraries... yes checking how to run the C preprocessor... gcc -E checking for libdbi framework... checking for MySQL support... yes checking for MySQL includes... -I/apps/cactiprod/mariadb/include/mysql checking for MySQL libraries... checking for PostgreSQL support... no checking for SQLite support... no checking for SQLite3 support... no checking for Msql support... no checking for Oracle support... no checking for Firebird/Interbase support... no checking for Freetds support... no checking for Ingres support... no checking for IBM DB2 support... no checking for strtoll... yes checking for atoll... yes checking for vasprintf... yes checking for asprintf... yes checking for libdbi library... yes: libs in /apps/cactiprod/syslog-ng/libdbi/lib checking for string.h... (cached) yes checking for strings.h... (cached) yes checking that generated files are newer than configure... done configure: creating ./config.status config.status: creating libdbi-drivers.spec config.status: creating Makefile config.status: creating doc/Makefile config.status: creating doc/include/Makefile config.status: creating drivers/Makefile config.status: creating drivers/mysql/Makefile config.status: creating drivers/pgsql/Makefile config.status: creating drivers/sqlite/Makefile config.status: creating drivers/sqlite3/Makefile config.status: creating drivers/msql/Makefile config.status: creating drivers/oracle/Makefile config.status: creating drivers/firebird/Makefile config.status: creating drivers/freetds/Makefile config.status: creating drivers/ingres/Makefile config.status: creating drivers/db2/Makefile config.status: creating tests/Makefile config.status: creating tests/cgreen/Makefile config.status: creating tests/test_dbi.cfg config.status: creating tests/plugin_settings.sh config.status: creating config.h config.status: executing depfiles commands config.status: executing libtool commands ----- output of "make" make all-recursive make[1]: Entering directory `/apps/cactiprod/syslog-ng/libdbi-drivers-0.9.0' Making all in drivers make[2]: Entering directory `/apps/cactiprod/syslog-ng/libdbi-drivers-0.9.0/drivers' Making all in mysql make[3]: Entering directory `/apps/cactiprod/syslog-ng/libdbi-drivers-0.9.0/drivers/mysql' /bin/sh ../../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../include -I/apps/cactiprod/syslog-ng/libdbi/include/dbi -I/apps/cactiprod/mariadb/include/mysql -std=gnu99 -I/apps/cactiprod/mariadb/include/mysql -MT dbd_mysql.lo -MD -MP -MF .deps/dbd_mysql.Tpo -c -o dbd_mysql.lo dbd_mysql.c libtool: compile: gcc -DHAVE_CONFIG_H -I. -I../.. -I../.. -I../../include -I/apps/cactiprod/syslog-ng/libdbi/include/dbi -I/apps/cactiprod/mariadb/include/mysql -std=gnu99 -I/apps/cactiprod/mariadb/include/mysql -MT dbd_mysql.lo -MD -MP -MF .deps/dbd_mysql.Tpo -c dbd_mysql.c -fPIC -DPIC -o .libs/dbd_mysql.o dbd_mysql.c:50:21: error: dbi/dbi.h: No such file or directory dbd_mysql.c:51:25: error: dbi/dbi-dev.h: No such file or directory dbd_mysql.c:52:21: error: dbi/dbd.h: No such file or directory dbd_mysql.c:57: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'driver_info' dbd_mysql.c:112: error: expected ')' before '*' token dbd_mysql.c:113: error: expected ')' before '*' token dbd_mysql.c:117: warning: type defaults to 'int' in declaration of 'dbi_info_t' dbd_mysql.c:117: error: expected ';', ',' or ')' before '*' token dbd_mysql.c:124: error: expected ')' before '*' token dbd_mysql.c:145: error: expected ')' before '*' token dbd_mysql.c:158: error: expected ')' before '*' token dbd_mysql.c:248: error: expected ')' before '*' token dbd_mysql.c:253: error: expected ')' before '*' token dbd_mysql.c:268: error: expected ')' before '*' token dbd_mysql.c:273: error: expected ')' before '*' token dbd_mysql.c:284: error: expected ')' before '*' token dbd_mysql.c:289: error: expected ')' before '*' token dbd_mysql.c:437: error: expected ')' before '*' token dbd_mysql.c:458: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token dbd_mysql.c:473: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token dbd_mysql.c:495: error: expected ')' before '*' token dbd_mysql.c:506: error: expected ')' before '*' token dbd_mysql.c:518: error: expected ')' before '*' token dbd_mysql.c:537: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token dbd_mysql.c:575: error: expected '=', ',', ';', 'asm' or '__attribute__' before '*' token dbd_mysql.c:597: error: expected ')' before '*' token dbd_mysql.c:606: error: expected ')' before '*' token dbd_mysql.c:615: error: expected ')' before '*' token dbd_mysql.c:624: error: expected ')' before '*' token dbd_mysql.c:643: error: expected ')' before '*' token dbd_mysql.c:662: error: expected ')' before '*' token dbd_mysql.c:681: error: expected ')' before '*' token dbd_mysql.c:694: error: expected ')' before '*' token dbd_mysql.c:707: error: expected ')' before '*' token dbd_mysql.c:711: error: expected ')' before '*' token dbd_mysql.c:715: error: expected ')' before '*' token dbd_mysql.c: In function '_translate_mysql_type': dbd_mysql.c:734: error: 'DBI_TYPE_INTEGER' undeclared (first use in this function) dbd_mysql.c:734: error: (Each undeclared identifier is reported only once dbd_mysql.c:734: error: for each function it appears in.) dbd_mysql.c:735: error: 'DBI_INTEGER_SIZE1' undeclared (first use in this function) dbd_mysql.c:738: error: 'DBI_INTEGER_UNSIGNED' undeclared (first use in this function) dbd_mysql.c:741: error: 'DBI_INTEGER_SIZE2' undeclared (first use in this function) dbd_mysql.c:745: error: 'DBI_INTEGER_SIZE3' undeclared (first use in this function) dbd_mysql.c:749: error: 'DBI_INTEGER_SIZE4' undeclared (first use in this function) dbd_mysql.c:757: error: 'DBI_INTEGER_SIZE8' undeclared (first use in this function) dbd_mysql.c:761: error: 'DBI_TYPE_DECIMAL' undeclared (first use in this function) dbd_mysql.c:762: error: 'DBI_DECIMAL_SIZE4' undeclared (first use in this function) dbd_mysql.c:766: error: 'DBI_DECIMAL_SIZE8' undeclared (first use in this function) dbd_mysql.c:770: error: 'DBI_TYPE_DATETIME' undeclared (first use in this function) dbd_mysql.c:771: error: 'DBI_DATETIME_DATE' undeclared (first use in this function) dbd_mysql.c:775: error: 'DBI_DATETIME_TIME' undeclared (first use in this function) dbd_mysql.c:791: error: 'DBI_TYPE_BINARY' undeclared (first use in this function) dbd_mysql.c:802: error: 'DBI_TYPE_STRING' undeclared (first use in this function) dbd_mysql.c: At top level: dbd_mysql.c:810: error: expected ')' before '*' token dbd_mysql.c:827: error: expected ')' before '*' token make[3]: *** [dbd_mysql.lo] Error 1 make[3]: Leaving directory `/apps/cactiprod/syslog-ng/libdbi-drivers-0.9.0/drivers/mysql' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/apps/cactiprod/syslog-ng/libdbi-drivers-0.9.0/drivers' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/apps/cactiprod/syslog-ng/libdbi-drivers-0.9.0' make: *** [all] Error 2 ------------------------------- I am aware that it complains about following: dbd_mysql.c:50:21: error: dbi/dbi.h: No such file or directory dbd_mysql.c:51:25: error: dbi/dbi-dev.h: No such file or directory dbd_mysql.c:52:21: error: dbi/dbd.h: No such file or directory - but thoose headers are there along with libraries specified during ./compile ... ls /apps/cactiprod/syslog-ng/libdbi/include/dbi dbd.h dbi-dev.h dbi.h ls /apps/cactiprod/syslog-ng/libdbi/lib libdbi.a libdbi.la libdbi.so libdbi.so.1 libdbi.so.1.1.0 pkgconfig I have tryied also export PKG_CONFIG_PATH=/apps/cactiprod/syslog-ng/libdbi/lib/pkgconfig and export LIBDBI_CFLAGS=-I/apps/cactiprod/syslog-ng/libdbi/include/dbi/ export LIBDBI_LIBS="-L/apps/cactiprod/syslog-ng/libdbi/lib" but without sucess. Please advice why it cannot find headers. Regards Michal |
From: <mar...@mh...> - 2013-03-14 01:08:25
|
Hi, unless you've already noticed I'd like to draw your attention to the fact that after years of heavy development :-) libdbi and libdbi-drivers are available at version 0.9.0. Although development definitely took way too long due to my enormous workload in my dayjob during the past couple of years (plus some extra burdens in my private life), the releases are finally out in the wild. I hope that all who have contributed code, ideas, and bug reports can be proud of the result. I'd like to specifically point out the new test kit, the concept of libdbi instances, transaction support, and the enormous speedup of reading MySQL result sets sequentially, all of which were either coded or requested by avid users. This holds true even if most of the cvs checkins carry my name - I've checked in lots of things originally provided by others. I'll update the web pages asap (see above). regards, Markus -- Markus Hoenicka http://www.mhoenicka.de AQ score 38 |
From: Christoph K. <chr...@gm...> - 2013-02-25 08:27:48
|
Am 24.02.2013 01:43, schrieb mar...@mh...: > In any case I concluded that firebird is above my head. I've spent an > entire week trying to get a simple test case running, to no avail. I'm > going to release libdbi-drivers without official firebird support > unless someone steps up and takes a look at the firebird driver and > the tests. That's fair. Let's release and I will do my best in future findings Thanks so far! Christoph |
From: <mar...@mh...> - 2013-02-24 00:41:44
|
mar...@mh... writes: > Christoph Kottke writes: > > Am 19.02.2013 00:16, schrieb mar...@mh...: > > > Did you ever succeed in running the new test > > > kit? Or the old one shipped with 0.8.3 fwiw? > > > > hi, > > > > i can't remeber on old kit passes and the new one has never pass. > > > ... even more findings After perusing the available documentation I concluded that it is not possible to drop tables from within a C program. Apparently you have to resort to isql/isql-fb in order to get rid of them. I modified our test program to do just that. Things work ok until just after dropping a trigger and a generator (both of which are created when creating the test table. I don't know what these are good for, someone else coded that). The next step would be to actually drop the table using isql. However, at this point the firebird client library segfaults, although I can't see why. It is not being called at this point. The test table is still present after the crash. In any case I concluded that firebird is above my head. I've spent an entire week trying to get a simple test case running, to no avail. I'm going to release libdbi-drivers without official firebird support unless someone steps up and takes a look at the firebird driver and the tests. best regards, Markus -- Markus Hoenicka http://www.mhoenicka.de AQ score 38 |
From: <mar...@mh...> - 2013-02-22 23:27:54
|
Christoph Kottke writes: > Am 19.02.2013 00:16, schrieb mar...@mh...: > > Did you ever succeed in running the new test > > kit? Or the old one shipped with 0.8.3 fwiw? > > hi, > > i can't remeber on old kit passes and the new one has never pass. > Hi, maybe you can shed some light on my latest findings: - isql-fb can connect from a FreeBSD box to a firebird server running on Debian - the libdbi-drivers test_dbi program (cvs revision) connects to the server, successfully creates a database, but then immediately hangs forever - the *old* test program as of approx. 0.8.3 runs most tests ok when run locally on Debian. However, trouble starts when the program tries to get rid of the table that was used during the tests - the "DROP TABLE" command causes an error saying "unsuccessful metadata update" - I took from several web resources that it may be necessary to explicitly commit a transaction before dropping a previously used table. However, this causes a "Dynamic SQL Error" - this, in turn, seems to be fixed by enclosing the table name in double quotes. However, this now causes a "invalid transaction handle (expecting explicit transaction start)" kind of error - if I try to fix this by issuing a "SET TRANSACTION" command, we're back to "Dynamic SQL error", full circle Can you confirm, from your experience, that firebird is kind of picky about dropping tables which were previously used? This is kind of weird, as any serious database should support dropping tables. How do you deal with this in your own programs? regards, Markus -- Markus Hoenicka http://www.mhoenicka.de AQ score 38 |
From: Markus H. <mar...@mh...> - 2013-02-22 07:30:42
|
Christoph Kottke <chr...@gm...> was heard to say: > Am 19.02.2013 00:16, schrieb mar...@mh...: >> Did you ever succeed in running the new test >> kit? Or the old one shipped with 0.8.3 fwiw? > > hi, > > i can't remeber on old kit passes and the new one has never pass. > Hi, I've tried a few things with the new testkit in the past couple of days. However, it seems we're asking too much of firebird if we intend to create and drop tables with each test - this results in lock file errors which I was not yet able to resolve. gdb isn't cooperative at least on Linux, so I can't even tell exactly which SQL command kills the server. My tried and true "printf debugger" wasn't helpful either. I built the firebird client on FreeBSD yesterday. I'll try and see if gdb is more up to the task on that platform. In any case, going back to your original problem report: could you please provide two simple but complete test cases, one which is supposed to succeed (i.e. which retrieves a single row of data) and one which fails (which retrieves three or more rows, according to what you mentioned). Both test cases should be complete in that they create the database, create the table, insert the data, and clean up after themselves when the test succeeds. It would be a major step forward towards debugging if I was able to run these test cases on my box. regards, Markus -- Markus Hoenicka http://www.mhoenicka.de AQ score 38 |
From: Christoph K. <chr...@gm...> - 2013-02-19 10:33:11
|
Am 19.02.2013 00:16, schrieb mar...@mh...: > Did you ever succeed in running the new test > kit? Or the old one shipped with 0.8.3 fwiw? hi, i can't remeber on old kit passes and the new one has never pass. christoph |
From: <mar...@mh...> - 2013-02-18 23:26:59
|
Christoph Kottke writes: > some more hits, > > if you use xinet.d you must enabled by hand in > /etc/xinet.d/firebird.conf and restart xinetd. > and new created db can only access by SYSDBA before the are activated... > Hi, one reboot later things have improved considerably. I tried to start the superserver process manually yesterday. There were no error messages, but the commands apparently did not succeed. After I booted the box tonight, the server was started correctly, and I was at least able to connect to the test database. I started to fiddle with tests/test_dbi in order to get some tests running. The test database is created ok using isql-fb, and I can connect to that (empty) database manually. I also found out the hard way that you have to run ./test_dbi as root to avoid error messages like: Can't access lock files' directory /tmp/firebird However, running the test as root results in error messages like (printed using printf using a modified debug firebird driver): Fatal lock manager error: invalid lock id (19892), errno: 11 --Resource temporarily unavailable I'll have to investigate which commands exactly cause this error messages, but at this time the test program does not run to completion using this driver. Did you ever succeed in running the new test kit? Or the old one shipped with 0.8.3 fwiw? regards, Markus -- Markus Hoenicka http://www.mhoenicka.de AQ score 38 |
From: Christoph K. <chr...@gm...> - 2013-02-18 14:29:36
|
Am 18.02.2013 10:43, schrieb Christoph Kottke: > Am 18.02.2013 10:27, schrieb Markus Hoenicka: >>> Classic does not require this step, but it doesn't work either. I'm >>> sure that I miss some critical step in the procedure. What about >>> accounts: do you run your queries from a regular user account? root? >>> firebird? Also, where do you create databases? What are the >>> permissions of that directory, and who owns it? Do you use localhost >>> in the database specifier, do you use any other host information, or >>> none at all? > Hi again, > > the server is full funktional, i connect via network with normal user > accound. the used > table is public ownership. the directory of the database file must own > by firebird:firebird > and have rw pemissions. > > btw. i can setup an testserver for you! > > christoph some more hits, if you use xinet.d you must enabled by hand in /etc/xinet.d/firebird.conf and restart xinetd. and new created db can only access by SYSDBA before the are activated... christoph |
From: Christoph K. <chr...@gm...> - 2013-02-18 09:43:19
|
Am 18.02.2013 10:27, schrieb Markus Hoenicka: >> Classic does not require this step, but it doesn't work either. I'm >> sure that I miss some critical step in the procedure. What about >> accounts: do you run your queries from a regular user account? root? >> firebird? Also, where do you create databases? What are the >> permissions of that directory, and who owns it? Do you use localhost >> in the database specifier, do you use any other host information, or >> none at all? Hi again, the server is full funktional, i connect via network with normal user accound. the used table is public ownership. the directory of the database file must own by firebird:firebird and have rw pemissions. btw. i can setup an testserver for you! christoph |
From: Markus H. <mar...@mh...> - 2013-02-18 09:27:56
|
Christoph Kottke <chr...@gm...> was heard to say: > Hi, > > thanks for your investigating :) > > i've run an debian 6.0.6 on i386 and install the lastest firebird-1.5 > from http://firebirdsql.org/ > because libdbi-driver depends on old include files (gds.h, etc). but you > can use the tarball only > to compile and use the server from debian repository. > > i 've never had problems to install an firebird server on debian, it > works always out of the box. > > the server is: firebird2.5-classic > Hi, I've tried both classic and super. In order to get the latter up and running, you're supposed to configure the package like this (as root): dpkg-reconfigure firebird2.5-super Even that command fails, saying it cannot connect. As this is still part of the installation, I have to consider this package broken. Classic does not require this step, but it doesn't work either. I'm sure that I miss some critical step in the procedure. What about accounts: do you run your queries from a regular user account? root? firebird? Also, where do you create databases? What are the permissions of that directory, and who owns it? Do you use localhost in the database specifier, do you use any other host information, or none at all? I'll give it another try tonight, but of course there is no point in delaying libdbi-drivers 0.9 any further if I don't have a chance to fix the firebird driver anyway. We'd have to move that driver to the "code present but unsupported" vault. BTW I'm running Debian Wheezy i386 on the test box. I've installed it from scratch on Saturday, so it shouldn't be screwed up in any way that affects firebird. If I include Debian's weird non-standard library directories, I don't have any problems building the firebird driver from the headers and libraries provided by the Debian packages. regards, Markus -- Markus Hoenicka http://www.mhoenicka.de AQ score 38 |
From: Christoph K. <chr...@gm...> - 2013-02-18 08:51:24
|
Am 18.02.2013 00:51, schrieb mar...@mh...: > Christoph Kottke writes: > > hi, > > > > i've installed the latest cvs revisions for libdbi and libdbi-driver and > > when ever i try to fetch more than > > 3 row from an firebird table it's end in an segfault. > > > > but when i revert the "bull patch" in dbi_result.c it works like a charm. > > > > Hi, > > I'd be happy to look at this issue. However, I haven't been able to > set up firebird on Debian either. I've followed the excellent Ubuntu > instructions which should work for Debian as well: > > https://help.ubuntu.com/community/Firebird2.5 > > However, no luck. isql-fb never manages to make a connection. I cannot > create database, and I can't access the example database either. This > database drives me nuts, I haven't seen it work on any platform here > in the past couple of years. > > In order to have a chance to debug the driver, would you please share > some information how you succeeded in running firebird at > all. Again, I'm not talking about libdbi or libdbi-drivers problems. I > just can't get the engine itself to work. > > regards, > Markus Hi, thanks for your investigating :) i've run an debian 6.0.6 on i386 and install the lastest firebird-1.5 from http://firebirdsql.org/ because libdbi-driver depends on old include files (gds.h, etc). but you can use the tarball only to compile and use the server from debian repository. i 've never had problems to install an firebird server on debian, it works always out of the box. the server is: firebird2.5-classic christoph |
From: <mar...@mh...> - 2013-02-17 23:49:48
|
Christoph Kottke writes: > hi, > > i've installed the latest cvs revisions for libdbi and libdbi-driver and > when ever i try to fetch more than > 3 row from an firebird table it's end in an segfault. > > but when i revert the "bull patch" in dbi_result.c it works like a charm. > Hi, I'd be happy to look at this issue. However, I haven't been able to set up firebird on Debian either. I've followed the excellent Ubuntu instructions which should work for Debian as well: https://help.ubuntu.com/community/Firebird2.5 However, no luck. isql-fb never manages to make a connection. I cannot create database, and I can't access the example database either. This database drives me nuts, I haven't seen it work on any platform here in the past couple of years. In order to have a chance to debug the driver, would you please share some information how you succeeded in running firebird at all. Again, I'm not talking about libdbi or libdbi-drivers problems. I just can't get the engine itself to work. regards, Markus -- Markus Hoenicka http://www.mhoenicka.de AQ score 38 |