diff options
-rw-r--r-- | VC++Files/libmysqld/libmysqld.dsp | 12 | ||||
-rw-r--r-- | VC++Files/mysqlbinlog/mysqlbinlog.dsp | 4 | ||||
-rw-r--r-- | VC++Files/mysqldemb/mysqldemb.dsp | 8 | ||||
-rw-r--r-- | include/mysql.h | 1 | ||||
-rw-r--r-- | libmysql/libmysql.c | 51 | ||||
-rw-r--r-- | libmysql/libmysql.def | 1 |
6 files changed, 47 insertions, 30 deletions
diff --git a/VC++Files/libmysqld/libmysqld.dsp b/VC++Files/libmysqld/libmysqld.dsp index 069039ee2f2..4db155e6ee6 100644 --- a/VC++Files/libmysqld/libmysqld.dsp +++ b/VC++Files/libmysqld/libmysqld.dsp @@ -87,6 +87,10 @@ LINK32=link.exe # Name "libmysqld - Win32 Debug"
# Begin Source File
+SOURCE=.\client.c +# End Source File +# Begin Source File + SOURCE=..\sql\derror.cpp
# End Source File
# Begin Source File
@@ -176,6 +180,10 @@ SOURCE=..\sql\item_func.cpp # End Source File
# Begin Source File
+SOURCE=.\item_geofunc.cpp +# End Source File +# Begin Source File + SOURCE=.\item_row.cpp # End Source File # Begin Source File @@ -248,6 +256,10 @@ SOURCE=..\sql\opt_sum.cpp # End Source File
# Begin Source File
+SOURCE=..\libmysql\pack.c +# End Source File +# Begin Source File + SOURCE=..\libmysql\password.c
# End Source File
# Begin Source File
diff --git a/VC++Files/mysqlbinlog/mysqlbinlog.dsp b/VC++Files/mysqlbinlog/mysqlbinlog.dsp index a4e85becd49..5aea3a396e8 100644 --- a/VC++Files/mysqlbinlog/mysqlbinlog.dsp +++ b/VC++Files/mysqlbinlog/mysqlbinlog.dsp @@ -88,6 +88,10 @@ LINK32=link.exe # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" # Begin Source File +SOURCE=..\mysys\mf_tempdir.c +# End Source File +# Begin Source File + SOURCE=..\client\mysqlbinlog.cpp # End Source File # End Group diff --git a/VC++Files/mysqldemb/mysqldemb.dsp b/VC++Files/mysqldemb/mysqldemb.dsp index 0b6c2bb285d..f28815c0f15 100644 --- a/VC++Files/mysqldemb/mysqldemb.dsp +++ b/VC++Files/mysqldemb/mysqldemb.dsp @@ -84,10 +84,6 @@ LIB32=xilink6.exe -lib # Name "mysqldemb - Win32 Debug"
# Begin Source File
-SOURCE=..\sql\convert.cpp
-# End Source File
-# Begin Source File
-
SOURCE=..\sql\derror.cpp
# End Source File
# Begin Source File
@@ -220,10 +216,6 @@ SOURCE=..\sql\mf_iocache.cpp # End Source File
# Begin Source File
-SOURCE=..\sql\mini_client.cpp
-# End Source File
-# Begin Source File
-
SOURCE=..\sql\net_serv.cpp
# End Source File
# Begin Source File
diff --git a/include/mysql.h b/include/mysql.h index 91e4c6444ee..f57382cb6a1 100644 --- a/include/mysql.h +++ b/include/mysql.h @@ -566,6 +566,7 @@ unsigned long STDCALL mysql_param_count(MYSQL_STMT * stmt); my_bool STDCALL mysql_bind_param(MYSQL_STMT * stmt, MYSQL_BIND * bnd); my_bool STDCALL mysql_bind_result(MYSQL_STMT * stmt, MYSQL_BIND * bnd); my_bool STDCALL mysql_stmt_close(MYSQL_STMT * stmt); +my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt); unsigned int STDCALL mysql_stmt_errno(MYSQL_STMT * stmt); const char *STDCALL mysql_stmt_error(MYSQL_STMT * stmt); const char *STDCALL mysql_stmt_sqlstate(MYSQL_STMT * stmt); diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index e61906cdbf8..f8aece76d28 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1581,7 +1581,7 @@ static my_bool read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) mysql->server_status|= SERVER_STATUS_IN_TRANS; mysql->extra_info= net_field_length_ll(&pos); - if (!(fields_data= read_rows(mysql, (MYSQL_FIELD*) 0, 9))) + if (!(fields_data= read_rows(mysql, (MYSQL_FIELD*) 0, 7))) DBUG_RETURN(1); if (!(stmt->fields= unpack_fields(fields_data,&stmt->mem_root, field_count,0, @@ -1921,7 +1921,7 @@ static void store_param_datetime(NET *net, MYSQL_BIND *param) static void store_param_str(NET *net, MYSQL_BIND *param) { - ulong length= min(*param->length, param->buffer_length); + ulong length= param->length ? *param->length : param->buffer_length; char *to= (char *) net_store_length((char *) net->write_pos, length); memcpy(to, param->buffer, length); net->write_pos= (uchar*) to+length; @@ -2442,7 +2442,7 @@ static void send_data_long(MYSQL_BIND *param, longlong value) } default: { - char tmp[NAME_LEN]; + char tmp[12]; uint length= (uint)(longlong10_to_str(value,(char *)tmp,10)-tmp); ulong copy_length= min((ulong)length-param->offset, param->buffer_length); memcpy(buffer, (char *)tmp+param->offset, copy_length); @@ -2489,7 +2489,7 @@ static void send_data_double(MYSQL_BIND *param, double value) } default: { - char tmp[NAME_LEN]; + char tmp[12]; uint length= my_sprintf(tmp,(tmp,"%g",value)); ulong copy_length= min((ulong)length-param->offset, param->buffer_length); memcpy(buffer, (char *)tmp+param->offset, copy_length); @@ -2996,12 +2996,11 @@ int STDCALL mysql_fetch(MYSQL_STMT *stmt) if (!res->data_cursor) { - res->current_row= 0; + stmt->current_row= 0; goto no_data; } row= (uchar *)res->data_cursor->data; res->data_cursor= res->data_cursor->next; - res->current_row= (MYSQL_ROW)row; } else /* un-buffered */ { @@ -3018,8 +3017,8 @@ int STDCALL mysql_fetch(MYSQL_STMT *stmt) goto no_data; } row= mysql->net.read_pos+1; - stmt->current_row= row; - } + } + stmt->current_row= row; DBUG_RETURN(stmt_fetch_row(stmt, row)); no_data: @@ -3040,12 +3039,7 @@ int STDCALL mysql_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind, DBUG_ENTER("mysql_fetch_column"); - if (stmt->result_buffered) - { - if (!stmt->result || !(row= (uchar *)stmt->result->current_row)) - goto no_data; - } - else if (!(row= stmt->current_row)) + if (!(row= stmt->current_row)) goto no_data; #ifdef CHECK_EXTRA_ARGUMENTS @@ -3343,18 +3337,15 @@ my_ulonglong STDCALL mysql_stmt_num_rows(MYSQL_STMT *stmt) 0 ok 1 error */ -my_bool stmt_close(MYSQL_STMT *stmt, my_bool skip_list) -{ + +my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt) +{ MYSQL *mysql; DBUG_ENTER("mysql_stmt_close"); DBUG_ASSERT(stmt != 0); - if (!(mysql= stmt->mysql)) - { - my_free((gptr) stmt, MYF(MY_WME)); - DBUG_RETURN(0); - } + mysql= stmt->mysql; if (mysql->status != MYSQL_STATUS_READY) { /* Clear the current execution status */ @@ -3369,6 +3360,23 @@ my_bool stmt_close(MYSQL_STMT *stmt, my_bool skip_list) } mysql->status= MYSQL_STATUS_READY; } + mysql_free_result(stmt->result); + DBUG_RETURN(0); +} + +my_bool stmt_close(MYSQL_STMT *stmt, my_bool skip_list) +{ + MYSQL *mysql; + DBUG_ENTER("mysql_stmt_close"); + + DBUG_ASSERT(stmt != 0); + + if (!(mysql= stmt->mysql)) + { + my_free((gptr) stmt, MYF(MY_WME)); + DBUG_RETURN(0); + } + mysql_stmt_free_result(stmt); if (stmt->state == MY_ST_PREPARE || stmt->state == MY_ST_EXECUTE) { char buff[4]; @@ -3381,7 +3389,6 @@ my_bool stmt_close(MYSQL_STMT *stmt, my_bool skip_list) DBUG_RETURN(1); } } - mysql_free_result(stmt->result); stmt->field_count= 0; free_root(&stmt->mem_root, MYF(0)); if (!skip_list) diff --git a/libmysql/libmysql.def b/libmysql/libmysql.def index bc12e01e420..8c97ef45aa3 100644 --- a/libmysql/libmysql.def +++ b/libmysql/libmysql.def @@ -115,6 +115,7 @@ EXPORTS mysql_param_result mysql_prepare_result mysql_stmt_close + mysql_stmt_free_result mysql_stmt_error mysql_stmt_errno mysql_fetch |