diff options
author | unknown <venu@myvenu.com> | 2003-06-08 09:11:14 -0700 |
---|---|---|
committer | unknown <venu@myvenu.com> | 2003-06-08 09:11:14 -0700 |
commit | 0bb5b9eadddfc911bfaa7c6ee69db92fc7785c94 (patch) | |
tree | 417b2e1492cc310b34ff873d3459039b3bce215e /libmysql | |
parent | 7fac151beaf476189878204bbee60f762174a760 (diff) | |
download | mariadb-git-0bb5b9eadddfc911bfaa7c6ee69db92fc7785c94.tar.gz |
Fix for mysql_list_fields & reset stmt buffers from stmt_free_result
Windows build fix
VC++Files/sql/mysqld.dsp:
Added sql_state.c to wrk space
include/mysql_com.h:
Windows build fix (mismatch declaration of my_bool and bool from defination)
include/thr_alarm.h:
Windows build fix
libmysql/libmysql.c:
Fix for mysql_list_fields & reset stmt buffers from stmt_free_result
tests/client_test.c:
Updated test for DEFAULT value for mysql_list_fields()
New tests for mysql_stmt_free_result()
Diffstat (limited to 'libmysql')
-rw-r--r-- | libmysql/libmysql.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 064a6c292eb..7e379ab63ba 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -990,7 +990,7 @@ mysql_list_fields(MYSQL *mysql, const char *table, const char *wild) end=strmake(strmake(buff, table,128)+1,wild ? wild : "",128); if (simple_command(mysql,COM_FIELD_LIST,buff,(ulong) (end-buff),1) || !(query = read_rows(mysql,(MYSQL_FIELD*) 0, - protocol_41(mysql) ? 7 : 6))) + protocol_41(mysql) ? 8 : 6))) DBUG_RETURN(NULL); free_old_query(mysql); @@ -1027,7 +1027,7 @@ mysql_list_processes(MYSQL *mysql) pos=(uchar*) mysql->net.read_pos; field_count=(uint) net_field_length(&pos); if (!(fields = read_rows(mysql,(MYSQL_FIELD*) 0, - protocol_41(mysql) ? 6 : 5))) + protocol_41(mysql) ? 7 : 5))) DBUG_RETURN(NULL); if (!(mysql->fields=unpack_fields(fields,&mysql->field_alloc,field_count,0, mysql->server_capabilities))) @@ -3055,7 +3055,8 @@ int STDCALL mysql_fetch_column(MYSQL_STMT *stmt, MYSQL_BIND *bind, #ifdef CHECK_EXTRA_ARGUMENTS if (!bind || icol >= stmt->field_count) { - DBUG_PRINT("error",("Invalid column position")); + set_stmt_errmsg(stmt, "Invalid column descriptor or offset",1, + unknown_sqlstate); DBUG_RETURN(1); } #endif @@ -3377,6 +3378,9 @@ my_bool STDCALL mysql_stmt_free_result(MYSQL_STMT *stmt) mysql->status= MYSQL_STATUS_READY; } mysql_free_result(stmt->result); + stmt->result= 0; + stmt->result_buffered= 0; + stmt->current_row= 0; DBUG_RETURN(0); } |