From 4532eebc4a916a392bdce386c9adde3cfa855ab9 Mon Sep 17 00:00:00 2001 From: Marc Boeren Date: Wed, 11 Apr 2001 08:14:57 +0000 Subject: Added a database member to the dbx_link object. Since e.g. mysql reuses connections, two or more dbx_link objects may share the connection identifier. The database name is used in the dbx_query, where it calls mysql_db_query instead of mysql_query. This means the database name has to be passed around to all dbx_xxx_query functions, hence the update on all the files. (Mc) # Thanks to Christian Rabe for all the input on this issue! --- ext/dbx/dbx_mysql.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'ext/dbx/dbx_mysql.c') diff --git a/ext/dbx/dbx_mysql.c b/ext/dbx/dbx_mysql.c index 0d2d300424..3366be3c2d 100644 --- a/ext/dbx/dbx_mysql.c +++ b/ext/dbx/dbx_mysql.c @@ -94,15 +94,16 @@ int dbx_mysql_close(zval ** rv, zval ** dbx_handle, INTERNAL_FUNCTION_PARAMETERS return 1; } -int dbx_mysql_query(zval ** rv, zval ** dbx_handle, zval ** sql_statement, INTERNAL_FUNCTION_PARAMETERS) { +int dbx_mysql_query(zval ** rv, zval ** dbx_handle, zval ** db_name, zval ** sql_statement, INTERNAL_FUNCTION_PARAMETERS) { /*/ returns 1 as long or a result identifier as resource on success or 0 as long on failure /*/ - int number_of_arguments=2; - zval ** arguments[2]; + int number_of_arguments=3; + zval ** arguments[3]; zval * returned_zval=NULL; - arguments[0]=sql_statement; - arguments[1]=dbx_handle; - dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_query", &returned_zval, number_of_arguments, arguments); + arguments[0]=db_name; + arguments[1]=sql_statement; + arguments[2]=dbx_handle; + dbx_call_any_function(INTERNAL_FUNCTION_PARAM_PASSTHRU, "mysql_db_query", &returned_zval, number_of_arguments, arguments); /*/ mysql_query returns a bool for success or failure, or a result_identifier for select statements /*/ if (!returned_zval || (returned_zval->type!=IS_BOOL && returned_zval->type!=IS_RESOURCE)) { if (returned_zval) zval_ptr_dtor(&returned_zval); -- cgit v1.2.1