Loading client/mysql.cc +6 −1 Original line number Diff line number Diff line Loading @@ -2947,7 +2947,12 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate) (void) fflush(file); fprintf(file,"ERROR"); if (error) { if (sqlstate) (void) fprintf(file," %d (%s)",error, sqlstate); else (void) fprintf(file," %d",error); } if (status.query_start_line && line_numbers) { (void) fprintf(file," at line %lu",status.query_start_line); Loading libmysql/errmsg.c +6 −6 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ const char *client_errors[]= "Error in server handshake", "Lost connection to MySQL server during query", "Commands out of sync; you can't run this command now", "Verbindung ueber Named Pipe; Host: %-.100s", "Verbindung ueber Named Pipe: %-.32s", "Kann nicht auf Named Pipe warten. Host: %-.64s pipe: %-.32s (%lu)", "Kann Named Pipe nicht oeffnen. Host: %-.64s pipe: %-.32s (%lu)", "Kann den Status der Named Pipe nicht setzen. Host: %-.64s pipe: %-.32s (%lu)", Loading @@ -64,7 +64,7 @@ const char *client_errors[]= "Invalid parameter number", "Can't send long data for non-string/non-binary data types (parameter: %d)", "Using unsupported buffer type: %d (parameter: %d)", "Shared memory (%lu)", "Shared memory: %-.100s", "Can't open shared memory; client could not create request event (%lu)", "Can't open shared memory; no answer event received from server (%lu)", "Can't open shared memory; server could not allocate file mapping (%lu)", Loading Loading @@ -101,7 +101,7 @@ const char *client_errors[]= "Erro na negociao de acesso ao servidor", "Conexo perdida com servidor MySQL durante 'query'", "Comandos fora de sincronismo; voc no pode executar este comando agora", "%-.100s via 'named pipe'", "Named pipe: %-.32s", "No pode esperar pelo 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)", "No pode abrir 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)", "No pode estabelecer o estado do 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)", Loading @@ -123,7 +123,7 @@ const char *client_errors[]= "Invalid parameter number", "Can't send long data for non-string/non-binary data types (parameter: %d)", "Using unsupported buffer type: %d (parameter: %d)", "Shared memory (%lu)", "Shared memory: %-.100s", "Can't open shared memory; client could not create request event (%lu)", "Can't open shared memory; no answer event received from server (%lu)", "Can't open shared memory; server could not allocate file mapping (%lu)", Loading Loading @@ -158,7 +158,7 @@ const char *client_errors[]= "Error in server handshake", "Lost connection to MySQL server during query", "Commands out of sync; you can't run this command now", "%-.100s via named pipe", "Named pipe: %-.32s", "Can't wait for named pipe to host: %-.64s pipe: %-.32s (%lu)", "Can't open named pipe to host: %-.64s pipe: %-.32s (%lu)", "Can't set state of named pipe to host: %-.64s pipe: %-.32s (%lu)", Loading @@ -180,7 +180,7 @@ const char *client_errors[]= "Invalid parameter number", "Can't send long data for non-string/non-binary data types (parameter: %d)", "Using unsupported buffer type: %d (parameter: %d)", "Shared memory (%lu)", "Shared memory: %-.100s", "Can't open shared memory; client could not create request event (%lu)", "Can't open shared memory; no answer event received from server (%lu)", "Can't open shared memory; server could not allocate file mapping (%lu)", Loading libmysql/libmysql.c +19 −7 Original line number Diff line number Diff line Loading @@ -1703,16 +1703,18 @@ static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data); /**************** Misc utility functions ****************************/ /* Reallocate the NET package to be at least of 'length' bytes Reallocate the NET package to have at least length bytes available. SYNPOSIS my_realloc_str() net The NET structure to modify length Ensure that net->buff is at least this big net The NET structure to modify. length Ensure that net->buff has space for at least this number of bytes. RETURN VALUES 0 ok 1 Error 0 Success. 1 Error, i.e. out of memory or requested packet size is bigger than max_allowed_packet. The error code is stored in net->last_errno. */ static my_bool my_realloc_str(NET *net, ulong length) Loading Loading @@ -2365,7 +2367,7 @@ static my_bool store_param(MYSQL_STMT *stmt, MYSQL_BIND *param) */ if ((my_realloc_str(net, *param->length))) { set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate); set_stmt_error(stmt, net->last_errno, unknown_sqlstate); DBUG_RETURN(1); } (*param->store_param_func)(net, param); Loading Loading @@ -2427,6 +2429,11 @@ int cli_stmt_execute(MYSQL_STMT *stmt) net_clear(net); /* Sets net->write_pos */ /* Reserve place for null-marker bytes */ null_count= (stmt->param_count+7) /8; if (my_realloc_str(net, null_count + 1)) { set_stmt_error(stmt, net->last_errno, unknown_sqlstate); DBUG_RETURN(1); } bzero((char*) net->write_pos, null_count); net->write_pos+= null_count; param_end= stmt->params + stmt->param_count; Loading @@ -2435,6 +2442,11 @@ int cli_stmt_execute(MYSQL_STMT *stmt) *(net->write_pos)++= (uchar) stmt->send_types_to_server; if (stmt->send_types_to_server) { if (my_realloc_str(net, 2 * stmt->param_count)) { set_stmt_error(stmt, net->last_errno, unknown_sqlstate); DBUG_RETURN(1); } /* Store types of parameters in first in first package that is sent to the server. Loading mysql-test/r/group_by.result +9 −0 Original line number Diff line number Diff line Loading @@ -629,3 +629,12 @@ explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort DROP TABLE t1; create table t1 ( col1 int, col2 int ); insert into t1 values (1,1),(1,2),(1,3),(2,1),(2,2); select group_concat( distinct col1 ) as alias from t1 group by col2 having alias like '%'; alias 1,2 1,2 1 drop table t1; mysql-test/r/subselect_innodb.result +8 −0 Original line number Diff line number Diff line Loading @@ -106,3 +106,11 @@ a b 2 12 4 105 drop table t1, t2; CREATE TABLE `t1` ( `unit` varchar(50) NOT NULL default '', `ingredient` varchar(50) NOT NULL default '') ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `t2` ( `ingredient` varchar(50) NOT NULL default '', `unit` varchar(50) NOT NULL default '', PRIMARY KEY (ingredient, unit)) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO `t1` VALUES ('xx','yy'); INSERT INTO `t2` VALUES ('yy','xx'); SELECT R.unit, R.ingredient FROM t1 R WHERE R.ingredient IN (SELECT N.ingredient FROM t2 N WHERE N.unit = R.unit); unit ingredient xx yy drop table t1, t2; Loading
client/mysql.cc +6 −1 Original line number Diff line number Diff line Loading @@ -2947,7 +2947,12 @@ put_info(const char *str,INFO_TYPE info_type, uint error, const char *sqlstate) (void) fflush(file); fprintf(file,"ERROR"); if (error) { if (sqlstate) (void) fprintf(file," %d (%s)",error, sqlstate); else (void) fprintf(file," %d",error); } if (status.query_start_line && line_numbers) { (void) fprintf(file," at line %lu",status.query_start_line); Loading
libmysql/errmsg.c +6 −6 Original line number Diff line number Diff line Loading @@ -42,7 +42,7 @@ const char *client_errors[]= "Error in server handshake", "Lost connection to MySQL server during query", "Commands out of sync; you can't run this command now", "Verbindung ueber Named Pipe; Host: %-.100s", "Verbindung ueber Named Pipe: %-.32s", "Kann nicht auf Named Pipe warten. Host: %-.64s pipe: %-.32s (%lu)", "Kann Named Pipe nicht oeffnen. Host: %-.64s pipe: %-.32s (%lu)", "Kann den Status der Named Pipe nicht setzen. Host: %-.64s pipe: %-.32s (%lu)", Loading @@ -64,7 +64,7 @@ const char *client_errors[]= "Invalid parameter number", "Can't send long data for non-string/non-binary data types (parameter: %d)", "Using unsupported buffer type: %d (parameter: %d)", "Shared memory (%lu)", "Shared memory: %-.100s", "Can't open shared memory; client could not create request event (%lu)", "Can't open shared memory; no answer event received from server (%lu)", "Can't open shared memory; server could not allocate file mapping (%lu)", Loading Loading @@ -101,7 +101,7 @@ const char *client_errors[]= "Erro na negociao de acesso ao servidor", "Conexo perdida com servidor MySQL durante 'query'", "Comandos fora de sincronismo; voc no pode executar este comando agora", "%-.100s via 'named pipe'", "Named pipe: %-.32s", "No pode esperar pelo 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)", "No pode abrir 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)", "No pode estabelecer o estado do 'named pipe' para o 'host' %-.64s - 'pipe' %-.32s (%lu)", Loading @@ -123,7 +123,7 @@ const char *client_errors[]= "Invalid parameter number", "Can't send long data for non-string/non-binary data types (parameter: %d)", "Using unsupported buffer type: %d (parameter: %d)", "Shared memory (%lu)", "Shared memory: %-.100s", "Can't open shared memory; client could not create request event (%lu)", "Can't open shared memory; no answer event received from server (%lu)", "Can't open shared memory; server could not allocate file mapping (%lu)", Loading Loading @@ -158,7 +158,7 @@ const char *client_errors[]= "Error in server handshake", "Lost connection to MySQL server during query", "Commands out of sync; you can't run this command now", "%-.100s via named pipe", "Named pipe: %-.32s", "Can't wait for named pipe to host: %-.64s pipe: %-.32s (%lu)", "Can't open named pipe to host: %-.64s pipe: %-.32s (%lu)", "Can't set state of named pipe to host: %-.64s pipe: %-.32s (%lu)", Loading @@ -180,7 +180,7 @@ const char *client_errors[]= "Invalid parameter number", "Can't send long data for non-string/non-binary data types (parameter: %d)", "Using unsupported buffer type: %d (parameter: %d)", "Shared memory (%lu)", "Shared memory: %-.100s", "Can't open shared memory; client could not create request event (%lu)", "Can't open shared memory; no answer event received from server (%lu)", "Can't open shared memory; server could not allocate file mapping (%lu)", Loading
libmysql/libmysql.c +19 −7 Original line number Diff line number Diff line Loading @@ -1703,16 +1703,18 @@ static void stmt_update_metadata(MYSQL_STMT *stmt, MYSQL_ROWS *data); /**************** Misc utility functions ****************************/ /* Reallocate the NET package to be at least of 'length' bytes Reallocate the NET package to have at least length bytes available. SYNPOSIS my_realloc_str() net The NET structure to modify length Ensure that net->buff is at least this big net The NET structure to modify. length Ensure that net->buff has space for at least this number of bytes. RETURN VALUES 0 ok 1 Error 0 Success. 1 Error, i.e. out of memory or requested packet size is bigger than max_allowed_packet. The error code is stored in net->last_errno. */ static my_bool my_realloc_str(NET *net, ulong length) Loading Loading @@ -2365,7 +2367,7 @@ static my_bool store_param(MYSQL_STMT *stmt, MYSQL_BIND *param) */ if ((my_realloc_str(net, *param->length))) { set_stmt_error(stmt, CR_OUT_OF_MEMORY, unknown_sqlstate); set_stmt_error(stmt, net->last_errno, unknown_sqlstate); DBUG_RETURN(1); } (*param->store_param_func)(net, param); Loading Loading @@ -2427,6 +2429,11 @@ int cli_stmt_execute(MYSQL_STMT *stmt) net_clear(net); /* Sets net->write_pos */ /* Reserve place for null-marker bytes */ null_count= (stmt->param_count+7) /8; if (my_realloc_str(net, null_count + 1)) { set_stmt_error(stmt, net->last_errno, unknown_sqlstate); DBUG_RETURN(1); } bzero((char*) net->write_pos, null_count); net->write_pos+= null_count; param_end= stmt->params + stmt->param_count; Loading @@ -2435,6 +2442,11 @@ int cli_stmt_execute(MYSQL_STMT *stmt) *(net->write_pos)++= (uchar) stmt->send_types_to_server; if (stmt->send_types_to_server) { if (my_realloc_str(net, 2 * stmt->param_count)) { set_stmt_error(stmt, net->last_errno, unknown_sqlstate); DBUG_RETURN(1); } /* Store types of parameters in first in first package that is sent to the server. Loading
mysql-test/r/group_by.result +9 −0 Original line number Diff line number Diff line Loading @@ -629,3 +629,12 @@ explain SELECT i, COUNT(DISTINCT(i)) FROM t1 GROUP BY j ORDER BY NULL; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using filesort DROP TABLE t1; create table t1 ( col1 int, col2 int ); insert into t1 values (1,1),(1,2),(1,3),(2,1),(2,2); select group_concat( distinct col1 ) as alias from t1 group by col2 having alias like '%'; alias 1,2 1,2 1 drop table t1;
mysql-test/r/subselect_innodb.result +8 −0 Original line number Diff line number Diff line Loading @@ -106,3 +106,11 @@ a b 2 12 4 105 drop table t1, t2; CREATE TABLE `t1` ( `unit` varchar(50) NOT NULL default '', `ingredient` varchar(50) NOT NULL default '') ENGINE=InnoDB DEFAULT CHARSET=latin1; CREATE TABLE `t2` ( `ingredient` varchar(50) NOT NULL default '', `unit` varchar(50) NOT NULL default '', PRIMARY KEY (ingredient, unit)) ENGINE=InnoDB DEFAULT CHARSET=latin1; INSERT INTO `t1` VALUES ('xx','yy'); INSERT INTO `t2` VALUES ('yy','xx'); SELECT R.unit, R.ingredient FROM t1 R WHERE R.ingredient IN (SELECT N.ingredient FROM t2 N WHERE N.unit = R.unit); unit ingredient xx yy drop table t1, t2;