From dc250a6efc8bc451b301c74b494200dfb3dd3f8b Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 12 Sep 2003 19:35:34 +0500 Subject: SCRUM: #977 Prepared statements in embedded library include/mysql.h: read_prepare_result function moved to 'virtual' libmysql/client_settings.h: declare proper function for libmysql libmysql/libmysql.c: some code moved from implementation of read_prepare_result to mysql_prepare_result to make creating separate (remote and embedded-server) versions easier libmysqld/libmysqld.c: emb_read_prepare_result prototype sql-common/client.c: cli_read_prepare_result added to the client_methods sql/client_settings.h: we don't need prepared statements in mini_client sql/sql_prepare.cc: embedded send_prep_stmt added --- libmysql/libmysql.c | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) (limited to 'libmysql/libmysql.c') diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 3058efb83cb..ecc34dd6add 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1556,13 +1556,13 @@ static my_bool my_realloc_str(NET *net, ulong length) 1 error */ -static my_bool read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) +my_bool STDCALL cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) { uchar *pos; uint field_count; ulong length, param_count; MYSQL_DATA *fields_data; - DBUG_ENTER("read_prepare_result"); + DBUG_ENTER("cli_read_prepare_result"); mysql= mysql->last_used_con; if ((length= net_safe_read(mysql)) == packet_error) @@ -1586,18 +1586,8 @@ static my_bool read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) mysql->server_capabilities))) DBUG_RETURN(1); } - if (!(stmt->params= (MYSQL_BIND *) alloc_root(&stmt->mem_root, - sizeof(MYSQL_BIND)* - (param_count + - field_count)))) - { - set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate); - DBUG_RETURN(0); - } - stmt->bind= (stmt->params + param_count); stmt->field_count= (uint) field_count; stmt->param_count= (ulong) param_count; - mysql->status= MYSQL_STATUS_READY; DBUG_RETURN(0); } @@ -1641,14 +1631,22 @@ mysql_prepare(MYSQL *mysql, const char *query, ulong length) } init_alloc_root(&stmt->mem_root,8192,0); - if (read_prepare_result(mysql, stmt)) + if ((*mysql->read_prepare_result)(mysql, stmt)) { stmt_close(stmt, 1); DBUG_RETURN(0); } + if (!(stmt->params= (MYSQL_BIND *) alloc_root(&stmt->mem_root, + sizeof(MYSQL_BIND)* + (param_count + + field_count)))) + set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate); + stmt->bind= stmt->params + param_count; + stmt->state= MY_ST_PREPARE; stmt->mysql= mysql; mysql->stmts= list_add(mysql->stmts, &stmt->list); + mysql->status= MYSQL_STATUS_READY; stmt->list.data= stmt; DBUG_PRINT("info", ("Parameter count: %ld", stmt->param_count)); DBUG_RETURN(stmt); -- cgit v1.2.1 From d05807153b640bee039746cc449273e0672e43c4 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 16 Sep 2003 16:06:25 +0500 Subject: SCRUM Prepared statements in embedded server Several changes in library code with two goals: to make mysql_prepare_stmt working in embedded server to get rid of #define mysql_interface_func mysql->methods->interface_func in user's interface include/mysql.h: modifications of interface two goals: to implement prepared statements and to get rid of #define mysql_proc (mysql->smth) in interface include/sql_common.h: read_rows function got 'virtual' libmysql/client_settings.h: interface of some functions declared in client.c moved here libmysql/libmysql.c: several functions changed with declared goals libmysqld/embedded_priv.h: libmysqld.c <--> lib_sql.cc interface moved here libmysqld/lib_sql.cc: all embedded 'virtual' functions moved here so they can be static libmysqld/libmysqld.c: embedded 'virtual' function was moved out of here sql-common/client.c: several changes with the declared goal sql/sql_class.h: place to store statement data added to THD sql/sql_prepare.cc: storing of prepare_statement result for embedded server added --- libmysql/libmysql.c | 52 +++++++++++++++++++++++++++++----------------------- 1 file changed, 29 insertions(+), 23 deletions(-) (limited to 'libmysql/libmysql.c') diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 4652f3e8986..56b8a1a14e8 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -973,6 +973,19 @@ mysql_list_tables(MYSQL *mysql, const char *wild) DBUG_RETURN (mysql_store_result(mysql)); } +MYSQL_FIELD * STDCALL cli_list_fields(MYSQL *mysql) +{ + MYSQL_DATA *query; + if (!(query= cli_read_rows(mysql,(MYSQL_FIELD*) 0, + protocol_41(mysql) ? 8 : 6))) + return NULL; + + mysql->field_count= query->rows; + return unpack_fields(query,&mysql->field_alloc, + query->rows, 1, mysql->server_capabilities); +} + + /************************************************************************** List all fields in a table If wild is given then only the fields matching wild is returned @@ -981,36 +994,29 @@ mysql_list_tables(MYSQL *mysql, const char *wild) **************************************************************************/ MYSQL_RES * STDCALL -cli_list_fields(MYSQL *mysql, const char *table, const char *wild) +mysql_list_fields(MYSQL *mysql, const char *table, const char *wild) { - MYSQL_RES *result; - MYSQL_DATA *query; + MYSQL_RES *result; + MYSQL_FIELD *fields; char buff[257],*end; DBUG_ENTER("mysql_list_fields"); DBUG_PRINT("enter",("table: '%s' wild: '%s'",table,wild ? wild : "")); - LINT_INIT(query); - end=strmake(strmake(buff, table,128)+1,wild ? wild : "",128); + free_old_query(mysql); if (simple_command(mysql,COM_FIELD_LIST,buff,(ulong) (end-buff),1) || - !(query = read_rows(mysql,(MYSQL_FIELD*) 0, - protocol_41(mysql) ? 8 : 6))) + !(fields= (*mysql->methods->list_fields)(mysql))) DBUG_RETURN(NULL); - free_old_query(mysql); if (!(result = (MYSQL_RES *) my_malloc(sizeof(MYSQL_RES), MYF(MY_WME | MY_ZEROFILL)))) - { - free_rows(query); DBUG_RETURN(NULL); - } + result->methods= mysql->methods; result->field_alloc=mysql->field_alloc; mysql->fields=0; - result->field_count = (uint) query->rows; - result->fields= unpack_fields(query,&result->field_alloc, - result->field_count, 1, - mysql->server_capabilities); + result->field_count = mysql->field_count; + result->fields= fields; result->eof=1; DBUG_RETURN(result); } @@ -1031,8 +1037,8 @@ mysql_list_processes(MYSQL *mysql) free_old_query(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) ? 7 : 5))) + if (!(fields = (*mysql->methods->read_rows)(mysql,(MYSQL_FIELD*) 0, + protocol_41(mysql) ? 7 : 5))) DBUG_RETURN(NULL); if (!(mysql->fields=unpack_fields(fields,&mysql->field_alloc,field_count,0, mysql->server_capabilities))) @@ -1569,7 +1575,7 @@ my_bool STDCALL cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) uint field_count; ulong length, param_count; MYSQL_DATA *fields_data; - DBUG_ENTER("cli_read_prepare_result"); + DBUG_ENTER("read_prepare_result"); mysql= mysql->last_used_con; if ((length= net_safe_read(mysql)) == packet_error) @@ -1586,7 +1592,7 @@ my_bool STDCALL cli_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, 7))) + if (!(fields_data= (*mysql->methods->read_rows)(mysql,(MYSQL_FIELD*)0,7))) DBUG_RETURN(1); if (!(stmt->fields= unpack_fields(fields_data,&stmt->mem_root, field_count,0, @@ -1638,17 +1644,17 @@ mysql_prepare(MYSQL *mysql, const char *query, ulong length) } init_alloc_root(&stmt->mem_root,8192,0); - if ((*mysql->read_prepare_result)(mysql, stmt)) + if ((*mysql->methods->read_prepare_result)(mysql, stmt)) { stmt_close(stmt, 1); DBUG_RETURN(0); } if (!(stmt->params= (MYSQL_BIND *) alloc_root(&stmt->mem_root, sizeof(MYSQL_BIND)* - (param_count + - field_count)))) + (stmt->param_count + + stmt->field_count)))) set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate); - stmt->bind= stmt->params + param_count; + stmt->bind= stmt->params + stmt->param_count; stmt->state= MY_ST_PREPARE; stmt->mysql= mysql; -- cgit v1.2.1 From 6b05f916b8bd29af6205a946c4954bc3a2cb62df Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 17 Sep 2003 15:18:18 +0500 Subject: SCRUM prepared statements in embedded library include/mysql.h: stmt_execute 'virtual' method added include/sql_common.h: two functions became global libmysql/client_settings.h: declaration for cli_stmt_execute libmysql/libmysql.c: some functions changed to be usable from embedded library libmysqld/lib_sql.cc: code for embedded stmt_execute added sql-common/client.c: cli_stmt_execute added to the methods table sql/client_settings.h: no need for prepared statements in miniclient --- libmysql/libmysql.c | 69 +++++++++++++++++++++++++++++++---------------------- 1 file changed, 41 insertions(+), 28 deletions(-) (limited to 'libmysql/libmysql.c') diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 56b8a1a14e8..bfa7e4e9357 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1494,8 +1494,8 @@ static void set_stmt_error(MYSQL_STMT * stmt, int errcode, Copy error message to statement handler */ -static void set_stmt_errmsg(MYSQL_STMT * stmt, const char *err, int errcode, - const char *sqlstate) +void set_stmt_errmsg(MYSQL_STMT * stmt, const char *err, int errcode, + const char *sqlstate) { DBUG_ENTER("set_stmt_error_msg"); DBUG_PRINT("enter", ("error: %d/%s '%s'", errcode, sqlstate, err)); @@ -1601,6 +1601,16 @@ my_bool STDCALL cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) } stmt->field_count= (uint) field_count; stmt->param_count= (ulong) param_count; + if (!(stmt->params= (MYSQL_BIND *) alloc_root(&stmt->mem_root, + sizeof(MYSQL_BIND)* + (stmt->param_count + + stmt->field_count)))) + { + set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate); + DBUG_RETURN(1); + } + stmt->bind= stmt->params + stmt->param_count; + DBUG_RETURN(0); } @@ -1649,12 +1659,6 @@ mysql_prepare(MYSQL *mysql, const char *query, ulong length) stmt_close(stmt, 1); DBUG_RETURN(0); } - if (!(stmt->params= (MYSQL_BIND *) alloc_root(&stmt->mem_root, - sizeof(MYSQL_BIND)* - (stmt->param_count + - stmt->field_count)))) - set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate); - stmt->bind= stmt->params + stmt->param_count; stmt->state= MY_ST_PREPARE; stmt->mysql= mysql; @@ -1975,36 +1979,21 @@ static my_bool execute(MYSQL_STMT * stmt, char *packet, ulong length) mysql->last_used_con= mysql; int4store(buff, stmt->stmt_id); /* Send stmt id to server */ - if ((*mysql->methods->advanced_command)(mysql, COM_EXECUTE, buff, - MYSQL_STMT_HEADER, packet, - length, 1) || + if (cli_advanced_command(mysql, COM_EXECUTE, buff, + MYSQL_STMT_HEADER, packet, + length, 1) || mysql_read_query_result(mysql)) { set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate); DBUG_RETURN(1); } - stmt->state= MY_ST_EXECUTE; - mysql_free_result(stmt->result); - stmt->result= (MYSQL_RES *)0; - stmt->result_buffered= 0; - stmt->current_row= 0; DBUG_RETURN(0); } - -/* - Execute the prepare query -*/ - -int STDCALL mysql_execute(MYSQL_STMT *stmt) +int STDCALL cli_stmt_execute(MYSQL_STMT *stmt) { - DBUG_ENTER("mysql_execute"); + DBUG_ENTER("cli_stmt_execute"); - if (stmt->state == MY_ST_UNKNOWN) - { - set_stmt_error(stmt, CR_NO_PREPARE_STMT, unknown_sqlstate); - DBUG_RETURN(1); - } if (stmt->param_count) { NET *net= &stmt->mysql->net; @@ -2065,6 +2054,30 @@ int STDCALL mysql_execute(MYSQL_STMT *stmt) DBUG_RETURN((int) execute(stmt,0,0)); } +/* + Execute the prepare query +*/ + +int STDCALL mysql_execute(MYSQL_STMT *stmt) +{ + DBUG_ENTER("mysql_execute"); + + if (stmt->state == MY_ST_UNKNOWN) + { + set_stmt_error(stmt, CR_NO_PREPARE_STMT, unknown_sqlstate); + DBUG_RETURN(1); + } + if ((*stmt->mysql->methods->stmt_execute)(stmt)) + DBUG_RETURN(1); + + stmt->state= MY_ST_EXECUTE; + mysql_free_result(stmt->result); + stmt->result= (MYSQL_RES *)0; + stmt->result_buffered= 0; + stmt->current_row= 0; + DBUG_RETURN(0); +} + /* Return total parameters count in the statement -- cgit v1.2.1 From 194f6725d42a111e31fbdff2707095abd7cd1b05 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 17 Sep 2003 20:48:53 +0500 Subject: SCRUM: prepared statements in embedded library include/mysql.h: Another 'virtual' method libmysql/client_settings.h: client implementation declared libmysql/libmysql.c: mysql_execute edited to work with embedded implementation libmysqld/lib_sql.cc: one error fixed (we do need parameter's buffer in embedded library) embedded recordset transfer methods implementations added sql-common/client.c: method added to the table sql/client_settings.h: no prepared statements in mimiclient sql/mysql_priv.h: these functions became global sql/protocol.cc: the stub added sql/protocol.h: had to change Protocol's interface for embedded library sql/sql_class.h: i changed this only for embedded case, but i think it's better to do the same for remote server also sql/sql_prepare.cc: parts of code #ifndef-ed --- libmysql/libmysql.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'libmysql/libmysql.c') diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index bfa7e4e9357..954eae89a2b 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -1601,15 +1601,6 @@ my_bool STDCALL cli_read_prepare_result(MYSQL *mysql, MYSQL_STMT *stmt) } stmt->field_count= (uint) field_count; stmt->param_count= (ulong) param_count; - if (!(stmt->params= (MYSQL_BIND *) alloc_root(&stmt->mem_root, - sizeof(MYSQL_BIND)* - (stmt->param_count + - stmt->field_count)))) - { - set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate); - DBUG_RETURN(1); - } - stmt->bind= stmt->params + stmt->param_count; DBUG_RETURN(0); } @@ -1660,6 +1651,15 @@ mysql_prepare(MYSQL *mysql, const char *query, ulong length) DBUG_RETURN(0); } + if (!(stmt->params= (MYSQL_BIND *) alloc_root(&stmt->mem_root, + sizeof(MYSQL_BIND)* + (stmt->param_count + + stmt->field_count)))) + { + set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate); + DBUG_RETURN(0); + } + stmt->bind= stmt->params + stmt->param_count; stmt->state= MY_ST_PREPARE; stmt->mysql= mysql; mysql->stmts= list_add(mysql->stmts, &stmt->list); @@ -3080,7 +3080,7 @@ no_data: Read all rows of data from server (binary format) */ -static MYSQL_DATA *read_binary_rows(MYSQL_STMT *stmt) +MYSQL_DATA *cli_read_binary_rows(MYSQL_STMT *stmt) { ulong pkt_len; uchar *cp; @@ -3176,7 +3176,7 @@ int STDCALL mysql_stmt_store_result(MYSQL_STMT *stmt) } result->methods= mysql->methods; stmt->result_buffered= 1; - if (!(result->data= read_binary_rows(stmt))) + if (!(result->data= (*stmt->mysql->methods->read_binary_rows)(stmt))) { my_free((gptr) result,MYF(0)); DBUG_RETURN(0); -- cgit v1.2.1 From 88fcf2a9433f60eddda31504ba14dfe87b375d2c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 18 Sep 2003 18:28:42 +0500 Subject: SCRUM: embedded library I decided to get rid of #define mysql_some_function in mysql.h It puzzles users and makes problems with dynamic libraries Finally, there are only two functions left, that are covered with the #define-s and it won't hurt performance at all client/mysqltest.c: that'll be faster include/mysql.h: #defines changed to functions libmysql/libmysql.c: that'll be faster that calls of wrapper functions libmysqld/libmysqld.c: skip wrapper function sql-common/client.c: skip wrapper function --- libmysql/libmysql.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) (limited to 'libmysql/libmysql.c') diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index 954eae89a2b..c3592844024 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -279,7 +279,7 @@ my_bool STDCALL mysql_master_query(MYSQL *mysql, const char *q, DBUG_ENTER("mysql_master_query"); if (mysql_master_send_query(mysql, q, length)) DBUG_RETURN(1); - DBUG_RETURN(mysql_read_query_result(mysql)); + DBUG_RETURN((*mysql->methods->read_query_result)(mysql)); } my_bool STDCALL mysql_master_send_query(MYSQL *mysql, const char *q, @@ -301,7 +301,7 @@ my_bool STDCALL mysql_slave_query(MYSQL *mysql, const char *q, DBUG_ENTER("mysql_slave_query"); if (mysql_slave_send_query(mysql, q, length)) DBUG_RETURN(1); - DBUG_RETURN(mysql_read_query_result(mysql)); + DBUG_RETURN((*mysql->methods->read_query_result)(mysql)); } @@ -1982,7 +1982,7 @@ static my_bool execute(MYSQL_STMT * stmt, char *packet, ulong length) if (cli_advanced_command(mysql, COM_EXECUTE, buff, MYSQL_STMT_HEADER, packet, length, 1) || - mysql_read_query_result(mysql)) + (*mysql->methods->read_query_result)(mysql)) { set_stmt_errmsg(stmt, net->last_error, net->last_errno, net->sqlstate); DBUG_RETURN(1); @@ -3480,7 +3480,18 @@ my_bool STDCALL mysql_next_result(MYSQL *mysql) mysql->affected_rows= ~(my_ulonglong) 0; if (mysql->last_used_con->server_status & SERVER_MORE_RESULTS_EXISTS) - DBUG_RETURN(mysql_read_query_result(mysql)); + DBUG_RETURN((*mysql->methods->read_query_result)(mysql)); DBUG_RETURN(0); } + +MYSQL_RES * STDCALL mysql_use_result(MYSQL *mysql) +{ + return (*mysql->methods->use_result)(mysql); +} + +my_bool STDCALL mysql_read_query_result(MYSQL *mysql) +{ + return (*mysql->methods->read_query_result)(mysql); +} + -- cgit v1.2.1 From 83e8881a5ad2a0fdfcb1ad06adca3614b6c7e0e4 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 19 Sep 2003 14:05:28 +0500 Subject: SCRUM prepared statements in embedded library. some fixes after testing include/mysql.h: virtual method added libmysql/client_settings.h: declaration added libmysql/libmysql.c: implementation added mysql_fetch changed to work in both libraries libmysqld/lib_sql.cc: implementation added sql-common/client.c: added items in methods table sql/client_settings.h: decided to remove such defines - i placed single #ifdef in client.c --- libmysql/libmysql.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'libmysql/libmysql.c') diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index c3592844024..debe3e54679 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -2965,6 +2965,14 @@ static int stmt_fetch_row(MYSQL_STMT *stmt, uchar *row) return 0; } +int STDCALL cli_unbuffered_fetch(MYSQL *mysql, char **row) +{ + if (packet_error == net_safe_read(mysql)) + return 1; + + *row= (mysql->net.read_pos[0] == 254) ? NULL : (mysql->net.read_pos+1); + return 0; +} /* Fetch and return row data to bound buffers, if any @@ -2994,20 +3002,20 @@ int STDCALL mysql_fetch(MYSQL_STMT *stmt) } else /* un-buffered */ { - if (packet_error == net_safe_read(mysql)) + if((*mysql->methods->unbuffered_fetch)(mysql, ( char **)&row)) { set_stmt_errmsg(stmt, mysql->net.last_error, mysql->net.last_errno, mysql->net.sqlstate); DBUG_RETURN(1); } - if (mysql->net.read_pos[0] == 254) + if (!row) { mysql->status= MYSQL_STATUS_READY; stmt->current_row= 0; goto no_data; } - row= mysql->net.read_pos+1; - } + } + stmt->current_row= row; DBUG_RETURN(stmt_fetch_row(stmt, row)); -- cgit v1.2.1 From 07001f78eca148d143ebf7fea66f4296a19a6d51 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 24 Sep 2003 08:35:02 +0200 Subject: - Code cleanup: replaced C++-style comments with the proper syntax for .c files (the IBM Visual Age C compiler aborts with a syntax error on these) libmysql/dll.c: - replaced C++-style comment with the proper syntax for .c files (the IBM Visual Age C compiler aborts with a syntax error on these) libmysql/libmysql.c: - replaced C++-style comment with the proper syntax for .c files (the IBM Visual Age C compiler aborts with a syntax error on these) mysys/my_getopt.c: - replaced C++-style comment with the proper syntax for .c files (the IBM Visual Age C compiler aborts with a syntax error on these) sql/net_serv.cc: - replaced C++-style comment with the proper syntax for .c files (the IBM Visual Age C compiler aborts with a syntax error on these) strings/ctype-bin.c: - replaced C++-style comment with the proper syntax for .c files (the IBM Visual Age C compiler aborts with a syntax error on these) tests/client_test.c: - replaced C++-style comment with the proper syntax for .c files (the IBM Visual Age C compiler aborts with a syntax error on these) --- libmysql/libmysql.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libmysql/libmysql.c') diff --git a/libmysql/libmysql.c b/libmysql/libmysql.c index debe3e54679..3efce367cae 100644 --- a/libmysql/libmysql.c +++ b/libmysql/libmysql.c @@ -629,7 +629,7 @@ my_bool STDCALL mysql_change_user(MYSQL *mysql, const char *user, } } else - *end++= '\0'; // empty password + *end++= '\0'; /* empty password */ /* Add database if needed */ end= strmov(end, db ? db : "") + 1; -- cgit v1.2.1