diff options
33 files changed, 548 insertions, 136 deletions
diff --git a/client/mysqltest.c b/client/mysqltest.c index 70dcc874b0f..f30af82dabd 100644 --- a/client/mysqltest.c +++ b/client/mysqltest.c @@ -128,6 +128,8 @@ static CHARSET_INFO *charset_info= &my_charset_latin1; static int embedded_server_arg_count=0; static char *embedded_server_args[MAX_SERVER_ARGS]; +static my_bool display_result_vertically= FALSE; + static const char *embedded_server_groups[] = { "server", "embedded", @@ -213,6 +215,8 @@ Q_REQUIRE_VERSION, Q_ENABLE_WARNINGS, Q_DISABLE_WARNINGS, Q_ENABLE_INFO, Q_DISABLE_INFO, Q_EXEC, Q_DELIMITER, +Q_DISPLAY_VERTICAL_RESULTS, Q_DISPLAY_HORIZONTAL_RESULTS, +Q_QUERY_VERTICAL, Q_QUERY_HORIZONTAL, Q_UNKNOWN, /* Unknown command. */ Q_COMMENT, /* Comments, ignored. */ @@ -286,6 +290,10 @@ const char *command_names[]= "disable_info", "exec", "delimiter", + "vertical_results", + "horizontal_results", + "query_vertical", + "query_horizontal", 0 }; @@ -2110,6 +2118,7 @@ static void append_result(DYNAMIC_STRING *ds, MYSQL_RES *res) { MYSQL_ROW row; uint num_fields= mysql_num_fields(res); + MYSQL_FIELD *fields= !display_result_vertically ? 0 : mysql_fetch_fields(res); unsigned long *lengths; while ((row = mysql_fetch_row(res))) { @@ -2130,11 +2139,22 @@ static void append_result(DYNAMIC_STRING *ds, MYSQL_RES *res) val= "NULL"; len= 4; } - if (i) + if (!display_result_vertically) + { + if (i) + dynstr_append_mem(ds, "\t", 1); + replace_dynstr_append_mem(ds, val, len); + } + else + { + dynstr_append(ds, fields[i].name); dynstr_append_mem(ds, "\t", 1); - replace_dynstr_append_mem(ds, val, len); + replace_dynstr_append_mem(ds, val, len); + dynstr_append_mem(ds, "\n", 1); + } } - dynstr_append_mem(ds, "\n", 1); + if (!display_result_vertically) + dynstr_append_mem(ds, "\n", 1); } free_replace_column(); } @@ -2276,16 +2296,19 @@ int run_query(MYSQL* mysql, struct st_query* q, int flags) { if (res) { - int num_fields= mysql_num_fields(res); - MYSQL_FIELD *fields= mysql_fetch_fields(res); - for (i = 0; i < num_fields; i++) + if (!display_result_vertically) { - if (i) - dynstr_append_mem(ds, "\t", 1); - dynstr_append(ds, fields[i].name); + int num_fields= mysql_num_fields(res); + MYSQL_FIELD *fields= mysql_fetch_fields(res); + for (i = 0; i < num_fields; i++) + { + if (i) + dynstr_append_mem(ds, "\t", 1); + dynstr_append(ds, fields[i].name); + } + dynstr_append_mem(ds, "\n", 1); } - dynstr_append_mem(ds, "\n", 1); append_result(ds, res); } @@ -2557,12 +2580,37 @@ int main(int argc, char **argv) strmake(delimiter, q->first_argument, sizeof(delimiter) - 1); delimiter_length= strlen(delimiter); break; + case Q_DISPLAY_VERTICAL_RESULTS: display_result_vertically= TRUE; break; + case Q_DISPLAY_HORIZONTAL_RESULTS: + display_result_vertically= FALSE; break; case Q_LET: do_let(q); break; case Q_EVAL_RESULT: eval_result = 1; break; case Q_EVAL: if (q->query == q->query_buf) q->query= q->first_argument; /* fall through */ + case Q_QUERY_VERTICAL: + case Q_QUERY_HORIZONTAL: + { + my_bool old_display_result_vertically= display_result_vertically; + if (!q->query[q->first_word_len]) + { + /* This happens when we use 'query_..' on it's own line */ + q_send_flag=1; + break; + } + /* fix up query pointer if this is * first iteration for this line */ + if (q->query == q->query_buf) + q->query += q->first_word_len + 1; + switch(q->type) + { + case Q_QUERY_VERTICAL: display_result_vertically= TRUE; break; + case Q_QUERY_HORIZONTAL: display_result_vertically= FALSE; break; + } + error |= run_query(&cur_con->mysql, q, QUERY_REAP|QUERY_SEND); + display_result_vertically= old_display_result_vertically; + break; + } case Q_QUERY: case Q_REAP: { diff --git a/include/my_global.h b/include/my_global.h index a8078f579ee..2a82173979d 100644 --- a/include/my_global.h +++ b/include/my_global.h @@ -692,7 +692,7 @@ typedef long long my_ptrdiff_t; #define ALIGN_SIZE(A) MY_ALIGN((A),sizeof(double)) /* Size to make adressable obj. */ #define ALIGN_PTR(A, t) ((t*) MY_ALIGN((A),sizeof(t))) - /* Offset of filed f in structure t */ + /* Offset of field f in structure t */ #define OFFSET(t, f) ((size_t)(char *)&((t *)0)->f) #define ADD_TO_PTR(ptr,size,type) (type) ((byte*) (ptr)+size) #define PTR_BYTE_DIFF(A,B) (my_ptrdiff_t) ((byte*) (A) - (byte*) (B)) diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result index 38e08d7fbc5..6602704ccec 100644 --- a/mysql-test/r/insert.result +++ b/mysql-test/r/insert.result @@ -86,3 +86,259 @@ use mysqltest; create table t1 (c int); insert into mysqltest.t1 set mysqltest.t1.c = '1'; drop database mysqltest; +use test; +create table t1( +`number ` int auto_increment primary key, +`original_value ` varchar(50), +`f_double ` double, +`f_float ` float, +`f_double_7_2 ` double(7,2), +`f_float_4_3 ` float (4,3), +`f_double_u ` double unsigned, +`f_float_u ` float unsigned, +`f_double_15_1_u ` double(15,1) unsigned, +`f_float_3_1_u ` float (3,1) unsigned +); +set @value= "aa"; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +Warnings: +Warning 1265 Data truncated for column 'f_double ' at row 1 +Warning 1265 Data truncated for column 'f_float ' at row 1 +Warning 1265 Data truncated for column 'f_double_7_2 ' at row 1 +Warning 1265 Data truncated for column 'f_float_4_3 ' at row 1 +Warning 1265 Data truncated for column 'f_double_u ' at row 1 +Warning 1265 Data truncated for column 'f_float_u ' at row 1 +Warning 1265 Data truncated for column 'f_double_15_1_u ' at row 1 +Warning 1265 Data truncated for column 'f_float_3_1_u ' at row 1 +select * from t1 where `number `=last_insert_id(); +number 1 +original_value aa +f_double 0 +f_float 0 +f_double_7_2 0.00 +f_float_4_3 0.000 +f_double_u 0 +f_float_u 0 +f_double_15_1_u 0.0 +f_float_3_1_u 0.0 +set @value= "1aa"; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +Warnings: +Warning 1265 Data truncated for column 'f_double ' at row 1 +Warning 1265 Data truncated for column 'f_float ' at row 1 +Warning 1265 Data truncated for column 'f_double_7_2 ' at row 1 +Warning 1265 Data truncated for column 'f_float_4_3 ' at row 1 +Warning 1265 Data truncated for column 'f_double_u ' at row 1 +Warning 1265 Data truncated for column 'f_float_u ' at row 1 +Warning 1265 Data truncated for column 'f_double_15_1_u ' at row 1 +Warning 1265 Data truncated for column 'f_float_3_1_u ' at row 1 +select * from t1 where `number `=last_insert_id(); +number 2 +original_value 1aa +f_double 1 +f_float 1 +f_double_7_2 1.00 +f_float_4_3 1.000 +f_double_u 1 +f_float_u 1 +f_double_15_1_u 1.0 +f_float_3_1_u 1.0 +set @value= "aa1"; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +Warnings: +Warning 1265 Data truncated for column 'f_double ' at row 1 +Warning 1265 Data truncated for column 'f_float ' at row 1 +Warning 1265 Data truncated for column 'f_double_7_2 ' at row 1 +Warning 1265 Data truncated for column 'f_float_4_3 ' at row 1 +Warning 1265 Data truncated for column 'f_double_u ' at row 1 +Warning 1265 Data truncated for column 'f_float_u ' at row 1 +Warning 1265 Data truncated for column 'f_double_15_1_u ' at row 1 +Warning 1265 Data truncated for column 'f_float_3_1_u ' at row 1 +select * from t1 where `number `=last_insert_id(); +number 3 +original_value aa1 +f_double 0 +f_float 0 +f_double_7_2 0.00 +f_float_4_3 0.000 +f_double_u 0 +f_float_u 0 +f_double_15_1_u 0.0 +f_float_3_1_u 0.0 +set @value= "1e+1111111111a"; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +Warnings: +Warning 1265 Data truncated for column 'f_double ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_double ' at row 1 +Warning 1265 Data truncated for column 'f_float ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float ' at row 1 +Warning 1265 Data truncated for column 'f_double_7_2 ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_double_7_2 ' at row 1 +Warning 1265 Data truncated for column 'f_float_4_3 ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float_4_3 ' at row 1 +Warning 1265 Data truncated for column 'f_double_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_double_u ' at row 1 +Warning 1265 Data truncated for column 'f_float_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float_u ' at row 1 +Warning 1265 Data truncated for column 'f_double_15_1_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_double_15_1_u ' at row 1 +Warning 1265 Data truncated for column 'f_float_3_1_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float_3_1_u ' at row 1 +select * from t1 where `number `=last_insert_id(); +number 4 +original_value 1e+1111111111a +f_double 1.79769313486232e+308 +f_float 3.40282e+38 +f_double_7_2 99999.99 +f_float_4_3 9.999 +f_double_u 1.79769313486232e+308 +f_float_u 3.40282e+38 +f_double_15_1_u 99999999999999.9 +f_float_3_1_u 99.9 +set @value= "-1e+1111111111a"; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +Warnings: +Warning 1265 Data truncated for column 'f_double ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_double ' at row 1 +Warning 1265 Data truncated for column 'f_float ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float ' at row 1 +Warning 1265 Data truncated for column 'f_double_7_2 ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_double_7_2 ' at row 1 +Warning 1265 Data truncated for column 'f_float_4_3 ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float_4_3 ' at row 1 +Warning 1265 Data truncated for column 'f_double_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_double_u ' at row 1 +Warning 1265 Data truncated for column 'f_float_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float_u ' at row 1 +Warning 1265 Data truncated for column 'f_double_15_1_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_double_15_1_u ' at row 1 +Warning 1265 Data truncated for column 'f_float_3_1_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float_3_1_u ' at row 1 +select * from t1 where `number `=last_insert_id(); +number 5 +original_value -1e+1111111111a +f_double -1.79769313486232e+308 +f_float -3.40282e+38 +f_double_7_2 -99999.99 +f_float_4_3 -9.999 +f_double_u 0 +f_float_u 0 +f_double_15_1_u 0.0 +f_float_3_1_u 0.0 +set @value= 1e+1111111111; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +Warnings: +Warning 1264 Data truncated, out of range for column 'f_double ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_double_7_2 ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float_4_3 ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_double_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_double_15_1_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float_3_1_u ' at row 1 +select * from t1 where `number `=last_insert_id(); +number 6 +original_value inf +f_double 1.79769313486232e+308 +f_float 3.40282e+38 +f_double_7_2 99999.99 +f_float_4_3 9.999 +f_double_u 1.79769313486232e+308 +f_float_u 3.40282e+38 +f_double_15_1_u 99999999999999.9 +f_float_3_1_u 99.9 +set @value= -1e+1111111111; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +Warnings: +Warning 1264 Data truncated, out of range for column 'f_double ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_double_7_2 ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float_4_3 ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_double_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_double_15_1_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float_3_1_u ' at row 1 +select * from t1 where `number `=last_insert_id(); +number 7 +original_value -inf +f_double -1.79769313486232e+308 +f_float -3.40282e+38 +f_double_7_2 -99999.99 +f_float_4_3 -9.999 +f_double_u 0 +f_float_u 0 +f_double_15_1_u 0.0 +f_float_3_1_u 0.0 +set @value= 1e+111; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +Warnings: +Warning 1264 Data truncated, out of range for column 'f_float ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_double_7_2 ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float_4_3 ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_double_15_1_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float_3_1_u ' at row 1 +select * from t1 where `number `=last_insert_id(); +number 8 +original_value 1e+111 +f_double 1e+111 +f_float 3.40282e+38 +f_double_7_2 99999.99 +f_float_4_3 9.999 +f_double_u 1e+111 +f_float_u 3.40282e+38 +f_double_15_1_u 99999999999999.9 +f_float_3_1_u 99.9 +set @value= -1e+111; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +Warnings: +Warning 1264 Data truncated, out of range for column 'f_float ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_double_7_2 ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float_4_3 ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_double_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_double_15_1_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float_3_1_u ' at row 1 +select * from t1 where `number `=last_insert_id(); +number 9 +original_value -1e+111 +f_double -1e+111 +f_float -3.40282e+38 +f_double_7_2 -99999.99 +f_float_4_3 -9.999 +f_double_u 0 +f_float_u 0 +f_double_15_1_u 0.0 +f_float_3_1_u 0.0 +set @value= 1; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +select * from t1 where `number `=last_insert_id(); +number 10 +original_value 1 +f_double 1 +f_float 1 +f_double_7_2 1.00 +f_float_4_3 1.000 +f_double_u 1 +f_float_u 1 +f_double_15_1_u 1.0 +f_float_3_1_u 1.0 +set @value= -1; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +Warnings: +Warning 1264 Data truncated, out of range for column 'f_double_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_double_15_1_u ' at row 1 +Warning 1264 Data truncated, out of range for column 'f_float_3_1_u ' at row 1 +select * from t1 where `number `=last_insert_id(); +number 11 +original_value -1 +f_double -1 +f_float -1 +f_double_7_2 -1.00 +f_float_4_3 -1.000 +f_double_u 0 +f_float_u 0 +f_double_15_1_u 0.0 +f_float_3_1_u 0.0 +drop table t1; diff --git a/mysql-test/r/mysqldump.result b/mysql-test/r/mysqldump.result index fe1b83a1089..c8fbb504d25 100644 --- a/mysql-test/r/mysqldump.result +++ b/mysql-test/r/mysqldump.result @@ -46,6 +46,8 @@ UNLOCK TABLES; DROP TABLE t1; CREATE TABLE t1 (a double); INSERT INTO t1 VALUES (-9e999999); +Warnings: +Warning 1264 Data truncated, out of range for column 'a' at row 1 /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT, CHARACTER_SET_CLIENT=utf8 */; /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result index 828964d7543..36b8b98f41c 100644 --- a/mysql-test/r/show_check.result +++ b/mysql-test/r/show_check.result @@ -265,39 +265,13 @@ c decimal(4,3) YES NULL d double(4,3) YES NULL f float(4,3) YES NULL drop table t1; -SET sql_mode=''; -SET sql_quote_show_create=OFF; -CREATE TABLE ```ab``cd``` (i INT); -SHOW CREATE TABLE ```ab``cd```; -Table Create Table -`ab`cd` CREATE TABLE ```ab``cd``` ( - i int(11) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -DROP TABLE ```ab``cd```; -CREATE TABLE ```ab````cd``` (i INT); -SHOW CREATE TABLE ```ab````cd```; -Table Create Table -`ab``cd` CREATE TABLE ```ab````cd``` ( - i int(11) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -DROP TABLE ```ab````cd```; -CREATE TABLE ```a` (i INT); -SHOW CREATE TABLE ```a`; -Table Create Table -`a CREATE TABLE ```a` ( - i int(11) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -DROP TABLE ```a`; -SET sql_mode='ANSI_QUOTES'; -CREATE TABLE """a" (i INT); -SHOW CREATE TABLE """a"; -Table Create Table -"a CREATE TABLE """a" ( - i int(11) default NULL -) ENGINE=MyISAM DEFAULT CHARSET=latin1 -DROP TABLE """a"; -SET sql_mode=''; -SET sql_quote_show_create=OFF; +SET @old_sql_mode= @@sql_mode, sql_mode= ''; +SET @old_sql_quote_show_create= @@sql_quote_show_create, sql_quote_show_create= OFF; +CREATE TABLE `a/b` (i INT); +ERROR 42000: Incorrect table name 'a/b' +SET sql_mode= 'ANSI_QUOTES'; +SET sql_mode= ''; +SET sql_quote_show_create= OFF; CREATE TABLE t1 (i INT); SHOW CREATE TABLE t1; Table Create Table @@ -312,7 +286,8 @@ table CREATE TABLE `table` ( i int(11) default NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 DROP TABLE `table`; -SET sql_quote_show_create=ON; +SET sql_quote_show_create= @old_sql_quote_show_create; +SET sql_mode= @old_sql_mode; select @@max_heap_table_size; @@max_heap_table_size 1047552 diff --git a/mysql-test/r/variables.result b/mysql-test/r/variables.result index 5355e7ffadc..71e26c42b70 100644 --- a/mysql-test/r/variables.result +++ b/mysql-test/r/variables.result @@ -234,17 +234,17 @@ ERROR 42000: Unknown character set: 'UNKNOWN_CHARACTER_SET' set collation_connection=UNKNOWN_COLLATION; ERROR HY000: Unknown collation: 'UNKNOWN_COLLATION' set global autocommit=1; -ERROR HY000: Variable 'autocommit' is a LOCAL variable and can't be used with SET GLOBAL +ERROR HY000: Variable 'autocommit' is a SESSION variable and can't be used with SET GLOBAL select @@global.timestamp; -ERROR HY000: Variable 'timestamp' is a LOCAL variable +ERROR HY000: Variable 'timestamp' is a SESSION variable set @@version=''; ERROR HY000: Unknown system variable 'version' set @@concurrent_insert=1; ERROR HY000: Variable 'concurrent_insert' is a GLOBAL variable and should be set with SET GLOBAL set @@global.sql_auto_is_null=1; -ERROR HY000: Variable 'sql_auto_is_null' is a LOCAL variable and can't be used with SET GLOBAL +ERROR HY000: Variable 'sql_auto_is_null' is a SESSION variable and can't be used with SET GLOBAL select @@global.sql_auto_is_null; -ERROR HY000: Variable 'sql_auto_is_null' is a LOCAL variable +ERROR HY000: Variable 'sql_auto_is_null' is a SESSION variable set myisam_max_sort_file_size=100; ERROR HY000: Variable 'myisam_max_sort_file_size' is a GLOBAL variable and should be set with SET GLOBAL set myisam_max_extra_sort_file_size=100; diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test index 73b5f453bb4..b3d996c1475 100644 --- a/mysql-test/t/insert.test +++ b/mysql-test/t/insert.test @@ -87,3 +87,67 @@ use mysqltest; create table t1 (c int); insert into mysqltest.t1 set mysqltest.t1.c = '1'; drop database mysqltest; + +# +# Test of wrong values for float data (bug #2082) +# + +use test; +create table t1( + `number ` int auto_increment primary key, + `original_value ` varchar(50), + `f_double ` double, + `f_float ` float, + `f_double_7_2 ` double(7,2), + `f_float_4_3 ` float (4,3), + `f_double_u ` double unsigned, + `f_float_u ` float unsigned, + `f_double_15_1_u ` double(15,1) unsigned, + `f_float_3_1_u ` float (3,1) unsigned +); + +set @value= "aa"; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--query_vertical select * from t1 where `number `=last_insert_id() + +set @value= "1aa"; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--query_vertical select * from t1 where `number `=last_insert_id() + +set @value= "aa1"; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--query_vertical select * from t1 where `number `=last_insert_id() + +set @value= "1e+1111111111a"; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--query_vertical select * from t1 where `number `=last_insert_id() + +set @value= "-1e+1111111111a"; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--query_vertical select * from t1 where `number `=last_insert_id() + +set @value= 1e+1111111111; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--query_vertical select * from t1 where `number `=last_insert_id() + +set @value= -1e+1111111111; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--query_vertical select * from t1 where `number `=last_insert_id() + +set @value= 1e+111; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--query_vertical select * from t1 where `number `=last_insert_id() + +set @value= -1e+111; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--query_vertical select * from t1 where `number `=last_insert_id() + +set @value= 1; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--query_vertical select * from t1 where `number `=last_insert_id() + +set @value= -1; +insert into t1 values(null,@value,@value,@value,@value,@value,@value,@value,@value,@value); +--query_vertical select * from t1 where `number `=last_insert_id() + +drop table t1; diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test index 81cd024e4b3..35149edaa7d 100644 --- a/mysql-test/t/show_check.test +++ b/mysql-test/t/show_check.test @@ -147,31 +147,43 @@ drop table t1; # Test for Bug #2593 "SHOW CREATE TABLE doesn't properly double quotes" # -SET sql_mode=''; -SET sql_quote_show_create=OFF; - -CREATE TABLE ```ab``cd``` (i INT); -SHOW CREATE TABLE ```ab``cd```; -DROP TABLE ```ab``cd```; - -CREATE TABLE ```ab````cd``` (i INT); -SHOW CREATE TABLE ```ab````cd```; -DROP TABLE ```ab````cd```; - -CREATE TABLE ```a` (i INT); -SHOW CREATE TABLE ```a`; -DROP TABLE ```a`; - -SET sql_mode='ANSI_QUOTES'; - -CREATE TABLE """a" (i INT); -SHOW CREATE TABLE """a"; -DROP TABLE """a"; +SET @old_sql_mode= @@sql_mode, sql_mode= ''; +SET @old_sql_quote_show_create= @@sql_quote_show_create, sql_quote_show_create= OFF; + +######### hook for WL#1324 # +--error 1103 +CREATE TABLE `a/b` (i INT); +# the above test should WORK when WL#1324 is done, +# it should be removed and +# the following part should be uncommented then +######################################################### +# begin of part that must be uncommented when WL#1324 is done +######################################################### +#CREATE TABLE ```ab``cd``` (i INT); +#SHOW CREATE TABLE ```ab``cd```; +#DROP TABLE ```ab``cd```; + +#CREATE TABLE ```ab````cd``` (i INT); +#SHOW CREATE TABLE ```ab````cd```; +#DROP TABLE ```ab````cd```; + +#CREATE TABLE ```a` (i INT); +#SHOW CREATE TABLE ```a`; +#DROP TABLE ```a`; + +SET sql_mode= 'ANSI_QUOTES'; + +#CREATE TABLE """a" (i INT); +#SHOW CREATE TABLE """a"; +#DROP TABLE """a"; +######################################################### +# end of part that must be uncommented when WL#1324 is done +######################################################### # to test quotes around keywords.. : -SET sql_mode=''; -SET sql_quote_show_create=OFF; +SET sql_mode= ''; +SET sql_quote_show_create= OFF; CREATE TABLE t1 (i INT); SHOW CREATE TABLE t1; @@ -181,7 +193,8 @@ CREATE TABLE `table` (i INT); SHOW CREATE TABLE `table`; DROP TABLE `table`; -SET sql_quote_show_create=ON; +SET sql_quote_show_create= @old_sql_quote_show_create; +SET sql_mode= @old_sql_mode; # # Test for bug #2719 "Heap tables status shows wrong or missing data." diff --git a/sql/field.cc b/sql/field.cc index 48e7dbb32ca..93827a8cd1f 100644 --- a/sql/field.cc +++ b/sql/field.cc @@ -2271,13 +2271,18 @@ void Field_longlong::sql_type(String &res) const int Field_float::store(const char *from,uint len,CHARSET_INFO *cs) { int err; - Field_float::store(my_strntod(cs,(char*) from,len,(char**)NULL,&err)); - if (err || current_thd->count_cuted_fields && !test_if_real(from,len,cs)) + char *end; + double nr= my_strntod(cs,(char*) from,len,&end,&err); + if (!err && (!current_thd->count_cuted_fields || end-from==len)) + { + return Field_float::store(nr); + } + else { set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + Field_float::store(nr); return 1; } - return (err) ? 1 : 0; } @@ -2285,28 +2290,48 @@ int Field_float::store(double nr) { float j; int error= 0; - if (dec < NOT_FIXED_DEC) - nr=floor(nr*log_10[dec]+0.5)/log_10[dec]; // To fixed point - if (unsigned_flag && nr < 0) + + if (isnan(nr)) { + j= 0; + set_null(); set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); - nr=0; error= 1; } - if (nr < -FLT_MAX) + else if (unsigned_flag && nr < 0) { - j= -FLT_MAX; + j= 0; set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); error= 1; } - else if (nr > FLT_MAX) + else { - j=FLT_MAX; - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); - error= 1; + double max_value; + if (dec >= NOT_FIXED_DEC) + { + max_value= FLT_MAX; + } + else + { + max_value= (log_10[field_length]-1)/log_10[dec]; + nr= floor(nr*log_10[dec]+0.5)/log_10[dec]; + } + if (nr < -max_value) + { + j= (float)-max_value; + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + error= 1; + } + else if (nr > max_value) + { + j= (float)max_value; + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + error= 1; + } + else + j= (float) nr; } - else - j= (float) nr; + #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) { @@ -2544,41 +2569,64 @@ void Field_float::sql_type(String &res) const int Field_double::store(const char *from,uint len,CHARSET_INFO *cs) { int err; - double j= my_strntod(cs,(char*) from,len,(char**)0,&err); - if (err || current_thd->count_cuted_fields && !test_if_real(from,len,cs)) - { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); - err= 1; - } - if (unsigned_flag && j < 0) + char *end; + double nr= my_strntod(cs,(char*) from,len,&end,&err); + if (!err && (!current_thd->count_cuted_fields || end-from==len)) { - set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); - j=0; - err= 1; + return Field_double::store(nr); } -#ifdef WORDS_BIGENDIAN - if (table->db_low_byte_first) + else { - float8store(ptr,j); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED); + Field_double::store(nr); + return 1; } - else -#endif - doublestore(ptr,j); - return err; } int Field_double::store(double nr) { int error= 0; - if (dec < NOT_FIXED_DEC) - nr=floor(nr*log_10[dec]+0.5)/log_10[dec]; // To fixed point - if (unsigned_flag && nr < 0) + + if (isnan(nr)) { + nr= 0; + set_null(); + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + error= 1; + } + else if (unsigned_flag && nr < 0) + { + nr= 0; set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); - nr=0; error= 1; } + else + { + double max_value; + if (dec >= NOT_FIXED_DEC) + { + max_value= DBL_MAX; + } + else + { + max_value= (log_10[field_length]-1)/log_10[dec]; + nr= floor(nr*log_10[dec]+0.5)/log_10[dec]; + } + if (nr < -max_value) + { + nr= -max_value; + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + error= 1; + } + else if (nr > max_value) + { + nr= max_value; + set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_OUT_OF_RANGE); + error= 1; + } + } + #ifdef WORDS_BIGENDIAN if (table->db_low_byte_first) { diff --git a/sql/set_var.cc b/sql/set_var.cc index 12be0225421..6dfaf310e4b 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1401,7 +1401,7 @@ Item *sys_var::item(THD *thd, enum_var_type var_type, LEX_STRING *base) if (var_type != OPT_DEFAULT) { net_printf(thd, ER_INCORRECT_GLOBAL_LOCAL_VAR, - name, var_type == OPT_GLOBAL ? "LOCAL" : "GLOBAL"); + name, var_type == OPT_GLOBAL ? "SESSION" : "GLOBAL"); return 0; } /* As there was no local variable, return the global value */ diff --git a/sql/share/czech/errmsg.txt b/sql/share/czech/errmsg.txt index e05e21e22a5..eeee1fd819b 100644 --- a/sql/share/czech/errmsg.txt +++ b/sql/share/czech/errmsg.txt @@ -240,7 +240,7 @@ character-set=latin2 "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", "Access denied. You need the %-.128s privilege for this operation", -"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL", +"Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", diff --git a/sql/share/danish/errmsg.txt b/sql/share/danish/errmsg.txt index 45de00cfc39..a0ee760793e 100644 --- a/sql/share/danish/errmsg.txt +++ b/sql/share/danish/errmsg.txt @@ -234,7 +234,7 @@ character-set=latin1 "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", "Access denied. You need the %-.128s privilege for this operation", -"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL", +"Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", diff --git a/sql/share/dutch/errmsg.txt b/sql/share/dutch/errmsg.txt index 73386f49ab2..e62a8bf2a91 100644 --- a/sql/share/dutch/errmsg.txt +++ b/sql/share/dutch/errmsg.txt @@ -242,7 +242,7 @@ character-set=latin1 "Optie '%s' tweemaal gebruikt in opdracht", "Gebruiker '%-.64s' heeft het maximale gebruik van de '%s' faciliteit overschreden (huidige waarde: %ld)", "Toegang geweigerd. U moet het %-.128s privilege hebben voor deze operatie", -"Variabele '%-.64s' is LOCAL en kan niet worden gebruikt met SET GLOBAL", +"Variabele '%-.64s' is SESSION en kan niet worden gebruikt met SET GLOBAL", "Variabele '%-.64s' is GLOBAL en dient te worden gewijzigd met SET GLOBAL", "Variabele '%-.64s' heeft geen standaard waarde", "Variabele '%-.64s' kan niet worden gewijzigd naar de waarde '%-.64s'", diff --git a/sql/share/english/errmsg.txt b/sql/share/english/errmsg.txt index 196b55495ed..7b73ced6e0d 100644 --- a/sql/share/english/errmsg.txt +++ b/sql/share/english/errmsg.txt @@ -231,7 +231,7 @@ character-set=latin1 "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", "Access denied. You need the %-.128s privilege for this operation", -"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL", +"Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", diff --git a/sql/share/estonian/errmsg.txt b/sql/share/estonian/errmsg.txt index 8b6d0b4cea4..cbc963200c3 100644 --- a/sql/share/estonian/errmsg.txt +++ b/sql/share/estonian/errmsg.txt @@ -236,7 +236,7 @@ character-set=latin7 "Määrangut '%s' on lauses kasutatud topelt", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", "Access denied. You need the %-.128s privilege for this operation", -"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL", +"Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", diff --git a/sql/share/french/errmsg.txt b/sql/share/french/errmsg.txt index 307bf841eab..16bfa468c1b 100644 --- a/sql/share/french/errmsg.txt +++ b/sql/share/french/errmsg.txt @@ -231,7 +231,7 @@ character-set=latin1 "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", "Access denied. You need the %-.128s privilege for this operation", -"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL", +"Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", diff --git a/sql/share/greek/errmsg.txt b/sql/share/greek/errmsg.txt index 0aa6796751b..d54ef2eece0 100644 --- a/sql/share/greek/errmsg.txt +++ b/sql/share/greek/errmsg.txt @@ -231,7 +231,7 @@ character-set=greek "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", "Access denied. You need the %-.128s privilege for this operation", -"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL", +"Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", diff --git a/sql/share/hungarian/errmsg.txt b/sql/share/hungarian/errmsg.txt index 31514de6455..6b0e42f8b5c 100644 --- a/sql/share/hungarian/errmsg.txt +++ b/sql/share/hungarian/errmsg.txt @@ -233,7 +233,7 @@ character-set=latin2 "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", "Access denied. You need the %-.128s privilege for this operation", -"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL", +"Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", diff --git a/sql/share/italian/errmsg.txt b/sql/share/italian/errmsg.txt index 61f62a9e7e7..50da818b1fc 100644 --- a/sql/share/italian/errmsg.txt +++ b/sql/share/italian/errmsg.txt @@ -231,7 +231,7 @@ character-set=latin1 "L'opzione '%s' e' stata usata due volte nel comando", "L'utente '%-.64s' ha ecceduto la risorsa '%s' (valore corrente: %ld)", "Accesso non consentito. Serve il privilegio %-.128s per questa operazione", -"La variabile '%-.64s' e' una variabile locale ( LOCAL ) e non puo' essere cambiata usando SET GLOBAL", +"La variabile '%-.64s' e' una variabile locale ( SESSION ) e non puo' essere cambiata usando SET GLOBAL", "La variabile '%-.64s' e' una variabile globale ( GLOBAL ) e deve essere cambiata usando SET GLOBAL", "La variabile '%-.64s' non ha un valore di default", "Alla variabile '%-.64s' non puo' essere assegato il valore '%-.64s'", diff --git a/sql/share/japanese/errmsg.txt b/sql/share/japanese/errmsg.txt index 89d98d994e5..55dd49db5f7 100644 --- a/sql/share/japanese/errmsg.txt +++ b/sql/share/japanese/errmsg.txt @@ -233,7 +233,7 @@ character-set=ujis "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", "Access denied. You need the %-.128s privilege for this operation", -"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL", +"Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", diff --git a/sql/share/korean/errmsg.txt b/sql/share/korean/errmsg.txt index 1ad548ae878..5b0103a8336 100644 --- a/sql/share/korean/errmsg.txt +++ b/sql/share/korean/errmsg.txt @@ -231,7 +231,7 @@ character-set=euckr "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", "Access denied. You need the %-.128s privilege for this operation", -"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL", +"Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", diff --git a/sql/share/norwegian-ny/errmsg.txt b/sql/share/norwegian-ny/errmsg.txt index b82648ce210..5b944e0c0d5 100644 --- a/sql/share/norwegian-ny/errmsg.txt +++ b/sql/share/norwegian-ny/errmsg.txt @@ -233,7 +233,7 @@ character-set=latin1 "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", "Access denied. You need the %-.128s privilege for this operation", -"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL", +"Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", diff --git a/sql/share/norwegian/errmsg.txt b/sql/share/norwegian/errmsg.txt index 2198113876f..446c148e075 100644 --- a/sql/share/norwegian/errmsg.txt +++ b/sql/share/norwegian/errmsg.txt @@ -233,7 +233,7 @@ character-set=latin1 "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", "Access denied. You need the %-.128s privilege for this operation", -"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL", +"Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", diff --git a/sql/share/polish/errmsg.txt b/sql/share/polish/errmsg.txt index 5dfe6e251ad..3a34fac4600 100644 --- a/sql/share/polish/errmsg.txt +++ b/sql/share/polish/errmsg.txt @@ -235,7 +235,7 @@ character-set=latin2 "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", "Access denied. You need the %-.128s privilege for this operation", -"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL", +"Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", diff --git a/sql/share/portuguese/errmsg.txt b/sql/share/portuguese/errmsg.txt index 508a7880749..7ea5fbd649e 100644 --- a/sql/share/portuguese/errmsg.txt +++ b/sql/share/portuguese/errmsg.txt @@ -232,7 +232,7 @@ character-set=latin1 "Opção '%s' usada duas vezes no comando", "Usuário '%-.64s' tem excedido o '%s' recurso (atual valor: %ld)", "Acesso negado. Você precisa o privilégio %-.128s para essa operação", -"Variável '%-.64s' é uma LOCAL variável e não pode ser usada com SET GLOBAL", +"Variável '%-.64s' é uma SESSION variável e não pode ser usada com SET GLOBAL", "Variável '%-.64s' é uma GLOBAL variável e deve ser configurada com SET GLOBAL", "Variável '%-.64s' não tem um valor padrão", "Variável '%-.64s' não pode ser configurada para o valor de '%-.64s'", diff --git a/sql/share/romanian/errmsg.txt b/sql/share/romanian/errmsg.txt index 42027b3915b..58348c41830 100644 --- a/sql/share/romanian/errmsg.txt +++ b/sql/share/romanian/errmsg.txt @@ -235,7 +235,7 @@ character-set=latin2 "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", "Access denied. You need the %-.128s privilege for this operation", -"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL", +"Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", diff --git a/sql/share/russian/errmsg.txt b/sql/share/russian/errmsg.txt index 50ee6416070..8c7e35ae41c 100644 --- a/sql/share/russian/errmsg.txt +++ b/sql/share/russian/errmsg.txt @@ -233,7 +233,7 @@ character-set=koi8r "ïÐÃÉÑ '%s' Ä×ÁÖÄÙ ÉÓÐÏÌØÚÏ×ÁÎÁ × ×ÙÒÁÖÅÎÉÉ", "ðÏÌØÚÏ×ÁÔÅÌØ '%-.64s' ÐÒÅ×ÙÓÉÌ ÉÓÐÏÌØÚÏ×ÁÎÉÅ ÒÅÓÕÒÓÁ '%s' (ÔÅËÕÝÅÅ ÚÎÁÞÅÎÉÅ: %ld)", "÷ ÄÏÓÔÕÐÅ ÏÔËÁÚÁÎÏ. ÷ÁÍ ÎÕÖÎÙ ÐÒÉ×ÉÌÅÇÉÉ %-.128s ÄÌÑ ÜÔÏÊ ÏÐÅÒÁÃÉÉ", -"ðÅÒÅÍÅÎÎÁÑ '%-.64s' Ñ×ÌÑÅÔÓÑ ÐÏÔÏËÏ×ÏÊ (LOCAL) ÐÅÒÅÍÅÎÎÏÊ É ÎÅ ÍÏÖÅÔ ÂÙÔØ ÉÚÍÅÎÅÎÁ Ó ÐÏÍÏÝØÀ SET GLOBAL", +"ðÅÒÅÍÅÎÎÁÑ '%-.64s' Ñ×ÌÑÅÔÓÑ ÐÏÔÏËÏ×ÏÊ (SESSION) ÐÅÒÅÍÅÎÎÏÊ É ÎÅ ÍÏÖÅÔ ÂÙÔØ ÉÚÍÅÎÅÎÁ Ó ÐÏÍÏÝØÀ SET GLOBAL", "ðÅÒÅÍÅÎÎÁÑ '%-.64s' Ñ×ÌÑÅÔÓÑ ÇÌÏÂÁÌØÎÏÊ (GLOBAL) ÐÅÒÅÍÅÎÎÏÊ, É ÅÅ ÓÌÅÄÕÅÔ ÉÚÍÅÎÑÔØ Ó ÐÏÍÏÝØÀ SET GLOBAL", "ðÅÒÅÍÅÎÎÁÑ '%-.64s' ÎÅ ÉÍÅÅÔ ÚÎÁÞÅÎÉÑ ÐÏ ÕÍÏÌÞÁÎÉÀ", "ðÅÒÅÍÅÎÎÁÑ '%-.64s' ÎÅ ÍÏÖÅÔ ÂÙÔØ ÕÓÔÁÎÏ×ÌÅÎÁ × ÚÎÁÞÅÎÉÅ '%-.64s'", diff --git a/sql/share/slovak/errmsg.txt b/sql/share/slovak/errmsg.txt index 6f6b743862c..59ea40fffc6 100644 --- a/sql/share/slovak/errmsg.txt +++ b/sql/share/slovak/errmsg.txt @@ -239,7 +239,7 @@ character-set=latin2 "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", "Access denied. You need the %-.128s privilege for this operation", -"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL", +"Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", diff --git a/sql/share/spanish/errmsg.txt b/sql/share/spanish/errmsg.txt index da0633edb74..f26755c53be 100644 --- a/sql/share/spanish/errmsg.txt +++ b/sql/share/spanish/errmsg.txt @@ -233,7 +233,7 @@ character-set=latin1 "Opción '%s' usada dos veces en el comando", "Usuario '%-.64s' ha excedido el recurso '%s' (actual valor: %ld)", "Acceso negado. Usted necesita el privilegio %-.128s para esta operación", -"Variable '%-.64s' es una LOCAL variable y no puede ser usada con SET GLOBAL", +"Variable '%-.64s' es una SESSION variable y no puede ser usada con SET GLOBAL", "Variable '%-.64s' es una GLOBAL variable y no puede ser configurada con SET GLOBAL", "Variable '%-.64s' no tiene un valor patrón", "Variable '%-.64s' no puede ser configurada para el valor de '%-.64s'", diff --git a/sql/share/swedish/errmsg.txt b/sql/share/swedish/errmsg.txt index dac3c2d8d10..9fd7783b454 100644 --- a/sql/share/swedish/errmsg.txt +++ b/sql/share/swedish/errmsg.txt @@ -231,7 +231,7 @@ character-set=latin1 "Option '%s' användes två gånger", "Användare '%-.64s' har överskridit '%s' (nuvarande värde: %ld)", "Du har inte privlegiet '%-.128s' som behövs för denna operation", -"Variabel '%-.64s' är en LOCAL variabel och kan inte ändrad med SET GLOBAL", +"Variabel '%-.64s' är en SESSION variabel och kan inte ändrad med SET GLOBAL", "Variabel '%-.64s' är en GLOBAL variabel och bör sättas med SET GLOBAL", "Variabel '%-.64s' har inte ett DEFAULT-värde", "Variabel '%-.64s' kan inte sättas till '%-.64s'", diff --git a/sql/share/ukrainian/errmsg.txt b/sql/share/ukrainian/errmsg.txt index cb949e2d026..96b3b007cc0 100644 --- a/sql/share/ukrainian/errmsg.txt +++ b/sql/share/ukrainian/errmsg.txt @@ -236,7 +236,7 @@ character-set=koi8u "Option '%s' used twice in statement", "User '%-.64s' has exceeded the '%s' resource (current value: %ld)", "Access denied. You need the %-.128s privilege for this operation", -"Variable '%-.64s' is a LOCAL variable and can't be used with SET GLOBAL", +"Variable '%-.64s' is a SESSION variable and can't be used with SET GLOBAL", "Variable '%-.64s' is a GLOBAL variable and should be set with SET GLOBAL", "Variable '%-.64s' doesn't have a default value", "Variable '%-.64s' can't be set to the value of '%-.64s'", diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 99a8a248d24..97bae472757 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -1180,9 +1180,18 @@ err: } - /* Execute one command from socket (query or simple command) */ - #ifndef EMBEDDED_LIBRARY + +/* + Read one command from socket and execute it (query or simple command). + This function is called in loop from thread function. + SYNOPSIS + do_command() + RETURN VALUE + 0 success + 1 request of thread shutdown (see dispatch_command() description) +*/ + bool do_command(THD *thd) { char *packet; diff --git a/strings/strtod.c b/strings/strtod.c index 027abe56269..a06b74248cb 100644 --- a/strings/strtod.c +++ b/strings/strtod.c @@ -93,7 +93,7 @@ double my_strtod(const char *str, char **end) if (neg) result= 0.0; else - result= DBL_MAX; + result= DBL_MAX*10; goto done; } while (exp >= 100) @@ -113,9 +113,6 @@ done: if (end) *end = (char *)str; - if (isinf(result)) - result=DBL_MAX; - return negative ? -result : result; } |