Hello,

I start my tests with dbi_driver_specific_function(). For now, my
tests fail but I need investigate why and report more details here.

In test cases test_dbi.c:

if ((custom_function =
dbi_driver_specific_function(dbi_conn_get_driver(conn),
"mysql_get_proto_info")) != NULL) {
      protocol = custom_function(myconn->connection);
      printf("\tmysql_get_proto_info returned: %d\n", protocol);
      return 0;

Some questions;
- If  custom_function(myconn->connection) need more parameters (ex:.
for the function
dbi_driver_specific_function(dbi_conn_get_driver(conn),
"mysql_get_row")) like custom_function(myconn->connection,
command_sql) is possible too, ok?

>  First of all, using driver-specific functions is a bad thing :-/

Ok

>  unless you provide workarounds for other drivers in your code. That
>  said, libdbi now supports calling the database engine client library
>  functions of the abovementioned drivers as far as possible.

In my code, I have a workarounds for this.

>A few  limitations exist:
>
>  (1) MySQL apparently implements some of the (usually deprecated)
>     functions as macros which have no symbol in the library. You can't
>     call these "functions", but usually a newer replacement exists.
>
>  (2) Using driver-specific functions requires an additional header
>     file, <dbi/dbi-dev.h> in addition to <dbi/dbi.h>
>

OK

>  (3) Calling the functions often requires knowledge of the inner
>     workings of the driver. This holds true e.g. for firebird, as the
>     connection handle cannot simply be cast to a structure pointer
>     which provides a database handle.
>

>  I've added appropriate tests to the test program which you can
>  conveniently run by "make check". Please have a look at
>  test_custom_function() to see how to call driver-specific functions.
>
>

I have other questions (not explicitly for this post):

- In my code I have the follow structure
struct B_DB {
   BQUEUE bq;                         /* queue control */
   brwlock_t lock;                    /* transaction lock */
   dbi_conn *db;
   dbi_result *result;
   dbi_inst instance;
}

- How I can cast the follow:

dbi_conn_t *myconn = mdb->db;

Because in line 560 of test_dbi.c we have:

int test_custom_function(struct CONNINFO* ptr_cinfo, dbi_conn conn) {
  dbi_conn_t *myconn = conn;


I not know how do this in my code like test_dbi.c do.


Thanks Markus

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
libdbi-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/libdbi-users

Reply via email to