Loading BUILD/SETUP.sh +3 −4 Original line number Diff line number Diff line Loading @@ -48,10 +48,9 @@ global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wch c_warnings="$global_warnings -Wunused" cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor" base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-raid --with-openssl --with-raid --with-big-tables" max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-raid --with-openssl --with-raid --with-embedded-server --with-big-tables" max_no_es_configs="$max_leave_isam_configs --without-isam" max_configs="$max_no_es_configs --with-embedded-server" base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-openssl --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine" max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-openssl --with-embedded-server --with-big-tables" max_configs="$base_max_configs --with-embedded-server" path=`dirname $0` . "$path/check-cpu" Loading BUILD/compile-pentium-debug-max-no-embedded +1 −1 Original line number Diff line number Diff line Loading @@ -6,6 +6,6 @@ path=`dirname $0` extra_flags="$pentium_cflags $debug_cflags $max_cflags" c_warnings="$c_warnings $debug_extra_warnings" cxx_warnings="$cxx_warnings $debug_extra_warnings" extra_configs="$pentium_configs $debug_configs $max_no_es_configs" extra_configs="$pentium_configs $debug_configs $base_max_configs" . "$path/FINISH.sh" include/mysql.h +1 −1 Original line number Diff line number Diff line Loading @@ -396,7 +396,7 @@ unsigned int STDCALL mysql_warning_count(MYSQL *mysql); const char * STDCALL mysql_info(MYSQL *mysql); unsigned long STDCALL mysql_thread_id(MYSQL *mysql); const char * STDCALL mysql_character_set_name(MYSQL *mysql); int STDCALL mysql_set_character_set(MYSQL *mysql, char *csname); int STDCALL mysql_set_character_set(MYSQL *mysql, const char *csname); MYSQL * STDCALL mysql_init(MYSQL *mysql); my_bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key, Loading libmysql/libmysql.c +25 −39 Original line number Diff line number Diff line Loading @@ -1511,39 +1511,6 @@ void STDCALL mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *csinfo) csinfo->dir = charsets_dir; } int STDCALL mysql_set_character_set(MYSQL *mysql, char *cs_name) { struct charset_info_st *cs; const char *save_csdir= charsets_dir; if (mysql->options.charset_dir) charsets_dir= mysql->options.charset_dir; if ((cs= get_charset_by_csname(cs_name, MY_CS_PRIMARY, MYF(0)))) { char buff[MY_CS_NAME_SIZE + 10]; charsets_dir= save_csdir; sprintf(buff, "SET NAMES %s", cs_name); if (!mysql_query(mysql, buff)) { mysql->charset= cs; } } else { char cs_dir_name[FN_REFLEN]; get_charsets_dir(cs_dir_name); mysql->net.last_errno= CR_CANT_READ_CHARSET; strmov(mysql->net.sqlstate, unknown_sqlstate); my_snprintf(mysql->net.last_error, sizeof(mysql->net.last_error) - 1, ER(mysql->net.last_errno), cs_name, cs_dir_name); } charsets_dir= save_csdir; return mysql->net.last_errno; } uint STDCALL mysql_thread_safe(void) { #ifdef THREAD Loading Loading @@ -1774,6 +1741,7 @@ static int stmt_read_row_unbuffered(MYSQL_STMT *stmt, unsigned char **row); static int stmt_read_row_buffered(MYSQL_STMT *stmt, unsigned char **row); static int stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row); static int stmt_read_row_no_data(MYSQL_STMT *stmt, unsigned char **row); static int stmt_read_row_no_result_set(MYSQL_STMT *stmt, unsigned char **row); /* This function is used in mysql_stmt_store_result if Loading Loading @@ -1869,6 +1837,16 @@ static void net_clear_error(NET *net) } } static void stmt_clear_error(MYSQL_STMT *stmt) { if (stmt->last_errno) { stmt->last_errno= 0; stmt->last_error[0]= '\0'; strmov(stmt->sqlstate, not_error_sqlstate); } } /* Set statement error code, sqlstate, and error message from given errcode and sqlstate. Loading Loading @@ -2026,7 +2004,7 @@ mysql_stmt_init(MYSQL *mysql) stmt->list.data= stmt; stmt->state= MYSQL_STMT_INIT_DONE; stmt->mysql= mysql; stmt->read_row_func= stmt_read_row_no_data; stmt->read_row_func= stmt_read_row_no_result_set; stmt->prefetch_rows= DEFAULT_PREFETCH_ROWS; /* The rest of statement members was bzeroed inside malloc */ Loading Loading @@ -2768,6 +2746,13 @@ stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row) static int stmt_read_row_no_data(MYSQL_STMT *stmt __attribute__((unused)), unsigned char **row __attribute__((unused))) { return MYSQL_NO_DATA; } static int stmt_read_row_no_result_set(MYSQL_STMT *stmt __attribute__((unused)), unsigned char **row __attribute__((unused))) { set_stmt_error(stmt, CR_NO_RESULT_SET, unknown_sqlstate); return 1; Loading Loading @@ -4590,7 +4575,8 @@ int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt) ((rc= stmt_fetch_row(stmt, row)) && rc != MYSQL_DATA_TRUNCATED)) { stmt->state= MYSQL_STMT_PREPARE_DONE; /* XXX: this is buggy */ stmt->read_row_func= stmt_read_row_no_data; stmt->read_row_func= (rc == MYSQL_NO_DATA) ? stmt_read_row_no_data : stmt_read_row_no_result_set; } else { Loading Loading @@ -4907,13 +4893,12 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags) { MYSQL *mysql= stmt->mysql; MYSQL_DATA *result= &stmt->result; my_bool has_cursor= stmt->read_row_func == stmt_read_row_from_cursor; /* Reset stored result set if so was requested or it's a part of cursor fetch. */ if (result->data && (has_cursor || (flags & RESET_STORE_RESULT))) if (result->data && (flags & RESET_STORE_RESULT)) { /* Result buffered */ free_root(&result->alloc, MYF(MY_KEEP_PREALLOC)); Loading @@ -4928,7 +4913,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags) for (; param < param_end; param++) param->long_data_used= 0; } stmt->read_row_func= stmt_read_row_no_data; stmt->read_row_func= stmt_read_row_no_result_set; if (mysql) { if ((int) stmt->state > (int) MYSQL_STMT_PREPARE_DONE) Loading @@ -4944,7 +4929,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags) mysql->status= MYSQL_STATUS_READY; } } if (has_cursor || (flags & RESET_SERVER_SIDE)) if (flags & RESET_SERVER_SIDE) { /* Reset the server side statement and close the server side Loading @@ -4960,6 +4945,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags) stmt->state= MYSQL_STMT_INIT_DONE; return 1; } stmt_clear_error(stmt); } } stmt->state= MYSQL_STMT_PREPARE_DONE; Loading mysql-test/r/ctype_ucs.result +19 −0 Original line number Diff line number Diff line Loading @@ -657,3 +657,22 @@ a b 1.1 1.100 2.1 2.100 DROP TABLE t1; create table t1 (utext varchar(20) character set ucs2); insert into t1 values ("lily"); insert into t1 values ("river"); prepare stmt from 'select utext from t1 where utext like ?'; set @param1='%%'; execute stmt using @param1; utext lily river execute stmt using @param1; utext lily river select utext from t1 where utext like '%%'; utext lily river drop table t1; deallocate prepare stmt; Loading
BUILD/SETUP.sh +3 −4 Original line number Diff line number Diff line Loading @@ -48,10 +48,9 @@ global_warnings="-Wimplicit -Wreturn-type -Wswitch -Wtrigraphs -Wcomment -W -Wch c_warnings="$global_warnings -Wunused" cxx_warnings="$global_warnings -Woverloaded-virtual -Wsign-promo -Wreorder -Wctor-dtor-privacy -Wnon-virtual-dtor" base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-raid --with-openssl --with-raid --with-big-tables" max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-raid --with-openssl --with-raid --with-embedded-server --with-big-tables" max_no_es_configs="$max_leave_isam_configs --without-isam" max_configs="$max_no_es_configs --with-embedded-server" base_max_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-openssl --with-big-tables --with-blackhole-storage-engine --with-federated-storage-engine" max_leave_isam_configs="--with-innodb --with-berkeley-db --with-ndbcluster --with-archive-storage-engine --with-federated-storage-engine --with-blackhole-storage-engine --with-openssl --with-embedded-server --with-big-tables" max_configs="$base_max_configs --with-embedded-server" path=`dirname $0` . "$path/check-cpu" Loading
BUILD/compile-pentium-debug-max-no-embedded +1 −1 Original line number Diff line number Diff line Loading @@ -6,6 +6,6 @@ path=`dirname $0` extra_flags="$pentium_cflags $debug_cflags $max_cflags" c_warnings="$c_warnings $debug_extra_warnings" cxx_warnings="$cxx_warnings $debug_extra_warnings" extra_configs="$pentium_configs $debug_configs $max_no_es_configs" extra_configs="$pentium_configs $debug_configs $base_max_configs" . "$path/FINISH.sh"
include/mysql.h +1 −1 Original line number Diff line number Diff line Loading @@ -396,7 +396,7 @@ unsigned int STDCALL mysql_warning_count(MYSQL *mysql); const char * STDCALL mysql_info(MYSQL *mysql); unsigned long STDCALL mysql_thread_id(MYSQL *mysql); const char * STDCALL mysql_character_set_name(MYSQL *mysql); int STDCALL mysql_set_character_set(MYSQL *mysql, char *csname); int STDCALL mysql_set_character_set(MYSQL *mysql, const char *csname); MYSQL * STDCALL mysql_init(MYSQL *mysql); my_bool STDCALL mysql_ssl_set(MYSQL *mysql, const char *key, Loading
libmysql/libmysql.c +25 −39 Original line number Diff line number Diff line Loading @@ -1511,39 +1511,6 @@ void STDCALL mysql_get_character_set_info(MYSQL *mysql, MY_CHARSET_INFO *csinfo) csinfo->dir = charsets_dir; } int STDCALL mysql_set_character_set(MYSQL *mysql, char *cs_name) { struct charset_info_st *cs; const char *save_csdir= charsets_dir; if (mysql->options.charset_dir) charsets_dir= mysql->options.charset_dir; if ((cs= get_charset_by_csname(cs_name, MY_CS_PRIMARY, MYF(0)))) { char buff[MY_CS_NAME_SIZE + 10]; charsets_dir= save_csdir; sprintf(buff, "SET NAMES %s", cs_name); if (!mysql_query(mysql, buff)) { mysql->charset= cs; } } else { char cs_dir_name[FN_REFLEN]; get_charsets_dir(cs_dir_name); mysql->net.last_errno= CR_CANT_READ_CHARSET; strmov(mysql->net.sqlstate, unknown_sqlstate); my_snprintf(mysql->net.last_error, sizeof(mysql->net.last_error) - 1, ER(mysql->net.last_errno), cs_name, cs_dir_name); } charsets_dir= save_csdir; return mysql->net.last_errno; } uint STDCALL mysql_thread_safe(void) { #ifdef THREAD Loading Loading @@ -1774,6 +1741,7 @@ static int stmt_read_row_unbuffered(MYSQL_STMT *stmt, unsigned char **row); static int stmt_read_row_buffered(MYSQL_STMT *stmt, unsigned char **row); static int stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row); static int stmt_read_row_no_data(MYSQL_STMT *stmt, unsigned char **row); static int stmt_read_row_no_result_set(MYSQL_STMT *stmt, unsigned char **row); /* This function is used in mysql_stmt_store_result if Loading Loading @@ -1869,6 +1837,16 @@ static void net_clear_error(NET *net) } } static void stmt_clear_error(MYSQL_STMT *stmt) { if (stmt->last_errno) { stmt->last_errno= 0; stmt->last_error[0]= '\0'; strmov(stmt->sqlstate, not_error_sqlstate); } } /* Set statement error code, sqlstate, and error message from given errcode and sqlstate. Loading Loading @@ -2026,7 +2004,7 @@ mysql_stmt_init(MYSQL *mysql) stmt->list.data= stmt; stmt->state= MYSQL_STMT_INIT_DONE; stmt->mysql= mysql; stmt->read_row_func= stmt_read_row_no_data; stmt->read_row_func= stmt_read_row_no_result_set; stmt->prefetch_rows= DEFAULT_PREFETCH_ROWS; /* The rest of statement members was bzeroed inside malloc */ Loading Loading @@ -2768,6 +2746,13 @@ stmt_read_row_from_cursor(MYSQL_STMT *stmt, unsigned char **row) static int stmt_read_row_no_data(MYSQL_STMT *stmt __attribute__((unused)), unsigned char **row __attribute__((unused))) { return MYSQL_NO_DATA; } static int stmt_read_row_no_result_set(MYSQL_STMT *stmt __attribute__((unused)), unsigned char **row __attribute__((unused))) { set_stmt_error(stmt, CR_NO_RESULT_SET, unknown_sqlstate); return 1; Loading Loading @@ -4590,7 +4575,8 @@ int STDCALL mysql_stmt_fetch(MYSQL_STMT *stmt) ((rc= stmt_fetch_row(stmt, row)) && rc != MYSQL_DATA_TRUNCATED)) { stmt->state= MYSQL_STMT_PREPARE_DONE; /* XXX: this is buggy */ stmt->read_row_func= stmt_read_row_no_data; stmt->read_row_func= (rc == MYSQL_NO_DATA) ? stmt_read_row_no_data : stmt_read_row_no_result_set; } else { Loading Loading @@ -4907,13 +4893,12 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags) { MYSQL *mysql= stmt->mysql; MYSQL_DATA *result= &stmt->result; my_bool has_cursor= stmt->read_row_func == stmt_read_row_from_cursor; /* Reset stored result set if so was requested or it's a part of cursor fetch. */ if (result->data && (has_cursor || (flags & RESET_STORE_RESULT))) if (result->data && (flags & RESET_STORE_RESULT)) { /* Result buffered */ free_root(&result->alloc, MYF(MY_KEEP_PREALLOC)); Loading @@ -4928,7 +4913,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags) for (; param < param_end; param++) param->long_data_used= 0; } stmt->read_row_func= stmt_read_row_no_data; stmt->read_row_func= stmt_read_row_no_result_set; if (mysql) { if ((int) stmt->state > (int) MYSQL_STMT_PREPARE_DONE) Loading @@ -4944,7 +4929,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags) mysql->status= MYSQL_STATUS_READY; } } if (has_cursor || (flags & RESET_SERVER_SIDE)) if (flags & RESET_SERVER_SIDE) { /* Reset the server side statement and close the server side Loading @@ -4960,6 +4945,7 @@ static my_bool reset_stmt_handle(MYSQL_STMT *stmt, uint flags) stmt->state= MYSQL_STMT_INIT_DONE; return 1; } stmt_clear_error(stmt); } } stmt->state= MYSQL_STMT_PREPARE_DONE; Loading
mysql-test/r/ctype_ucs.result +19 −0 Original line number Diff line number Diff line Loading @@ -657,3 +657,22 @@ a b 1.1 1.100 2.1 2.100 DROP TABLE t1; create table t1 (utext varchar(20) character set ucs2); insert into t1 values ("lily"); insert into t1 values ("river"); prepare stmt from 'select utext from t1 where utext like ?'; set @param1='%%'; execute stmt using @param1; utext lily river execute stmt using @param1; utext lily river select utext from t1 where utext like '%%'; utext lily river drop table t1; deallocate prepare stmt;