summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/my_tree.h4
-rw-r--r--mysql-test/r/create.result6
-rw-r--r--mysql-test/r/insert.result421
-rw-r--r--mysql-test/r/multi_update.result9
-rw-r--r--mysql-test/r/query_cache.result35
-rw-r--r--mysql-test/r/rpl_error_ignored_table.result22
-rw-r--r--mysql-test/r/rpl_optimize.result4
-rw-r--r--mysql-test/r/show_check.result16
-rw-r--r--mysql-test/t/insert.test35
-rw-r--r--mysql-test/t/multi_update.test4
-rw-r--r--mysql-test/t/show_check.test4
-rw-r--r--sql/field.cc36
-rw-r--r--sql/sql_base.cc2
-rw-r--r--sql/sql_parse.cc6
14 files changed, 289 insertions, 315 deletions
diff --git a/include/my_tree.h b/include/my_tree.h
index 0159dc891e5..14d8593b6dc 100644
--- a/include/my_tree.h
+++ b/include/my_tree.h
@@ -22,8 +22,8 @@ extern "C" {
#include "my_base.h" /* get 'enum ha_rkey_function' */
-/* Worst case tree is half full. This gives use 2^(MAX_TREE_HIGHT/2) leafs */
-#define MAX_TREE_HIGHT 64
+/* Worst case tree is half full. This gives use 2^(MAX_TREE_HEIGHT/2) leafs */
+#define MAX_TREE_HEIGHT 64
#define ELEMENT_KEY(tree,element)\
(tree->offset_to_key ? (void*)((byte*) element+tree->offset_to_key) :\
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result
index 73596b71623..343ab89e6b5 100644
--- a/mysql-test/r/create.result
+++ b/mysql-test/r/create.result
@@ -263,11 +263,11 @@ a b
3 4
drop table t1;
create table `t1 `(a int);
-Incorrect table name 't1 '
+ERROR 42000: Incorrect table name 't1 '
create database `db1 `;
-Incorrect database name 'db1 '
+ERROR 42000: Incorrect database name 'db1 '
create table t1(`a ` int);
-Incorrect column name 'a '
+ERROR 42000: Incorrect column name 'a '
create table t1 (a int, key(a));
create table t2 (b int, foreign key(b) references t1(a), key(b));
drop table if exists t1,t2;
diff --git a/mysql-test/r/insert.result b/mysql-test/r/insert.result
index 9c066d67af1..782a71e83d1 100644
--- a/mysql-test/r/insert.result
+++ b/mysql-test/r/insert.result
@@ -87,252 +87,241 @@ 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
-);
+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
+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
+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
+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 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 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
+Warning 1265 Data truncated 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 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 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
+Warning 1265 Data truncated 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_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 6
-original_value 1.7976931348623e+308
-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
+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 6
+original_value 1.7976931348623e+308
+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_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 -1.7976931348623e+308
-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
+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 -1.7976931348623e+308
+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
+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
+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
+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
+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/multi_update.result b/mysql-test/r/multi_update.result
index d5f5d369fb3..fc5ef88f045 100644
--- a/mysql-test/r/multi_update.result
+++ b/mysql-test/r/multi_update.result
@@ -400,27 +400,26 @@ CREATE TABLE t1 ( a int );
CREATE TABLE t2 ( a int );
DELETE t1 FROM t1, t2 AS t3;
DELETE t4 FROM t1, t1 AS t4;
-Not unique table/alias: 't4'
DELETE t3 FROM t1 AS t3, t1 AS t4;
-Not unique table/alias: 't3'
DELETE t1 FROM t1 AS t3, t2 AS t4;
+ERROR 42000: Not unique table/alias: 't1'
INSERT INTO t1 values (1),(2);
INSERT INTO t2 values (1),(2);
DELETE t1 FROM t1 AS t2, t2 AS t1 where t1.a=t2.a and t1.a=1;
SELECT * from t1;
a
+1
2
SELECT * from t2;
a
-1
2
DELETE t2 FROM t1 AS t2, t2 AS t1 where t1.a=t2.a and t1.a=2;
SELECT * from t1;
a
-2
+1
SELECT * from t2;
a
-1
+2
DROP TABLE t1,t2;
create table `t1` (`p_id` int(10) unsigned NOT NULL auto_increment, `p_code` varchar(20) NOT NULL default '', `p_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`p_id`) );
create table `t2` (`c2_id` int(10) unsigned NULL auto_increment, `c2_p_id` int(10) unsigned NOT NULL default '0', `c2_note` text NOT NULL, `c2_active` tinyint(1) unsigned NOT NULL default '1', PRIMARY KEY (`c2_id`), KEY `c2_p_id` (`c2_p_id`) );
diff --git a/mysql-test/r/query_cache.result b/mysql-test/r/query_cache.result
index 453b5f66bdc..85bc50ef708 100644
--- a/mysql-test/r/query_cache.result
+++ b/mysql-test/r/query_cache.result
@@ -774,6 +774,23 @@ select * from t3;
delete from t4 where a=1;
flush query cache;
drop table t1,t2,t3,t4;
+set query_cache_wlock_invalidate=1;
+create table t1 (a int not null);
+create table t2 (a int not null);
+select * from t1;
+a
+select * from t2;
+a
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 2
+lock table t1 write, t2 read;
+show status like "Qcache_queries_in_cache";
+Variable_name Value
+Qcache_queries_in_cache 1
+unlock table;
+drop table t1,t2;
+set query_cache_wlock_invalidate=default;
SET NAMES koi8r;
CREATE TABLE t1 (a char(1) character set koi8r);
INSERT INTO t1 VALUES (_koi8r'á'),(_koi8r'Á');
@@ -830,21 +847,3 @@ a
USE test;
DROP TABLE t1;
SET GLOBAL query_cache_size=0;
-set query_cache_wlock_invalidate=1;
-create table t1 (a int not null);
-create table t2 (a int not null);
-select * from t1;
-a
-select * from t2;
-a
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 2
-lock table t1 write, t2 read;
-show status like "Qcache_queries_in_cache";
-Variable_name Value
-Qcache_queries_in_cache 1
-unlock table;
-drop table t1,t2;
-set query_cache_wlock_invalidate=default;
-set GLOBAL query_cache_size=0;
diff --git a/mysql-test/r/rpl_error_ignored_table.result b/mysql-test/r/rpl_error_ignored_table.result
index 46280e60ea1..247b88e42c1 100644
--- a/mysql-test/r/rpl_error_ignored_table.result
+++ b/mysql-test/r/rpl_error_ignored_table.result
@@ -9,7 +9,7 @@ insert into t1 values (1),(1);
ERROR 23000: Duplicate entry '1' for key 1
show slave status;
Slave_IO_State Master_Host Master_User Master_Port Connect_Retry Master_Log_File Read_Master_Log_Pos Relay_Log_File Relay_Log_Pos Relay_Master_Log_File Slave_IO_Running Slave_SQL_Running Replicate_Do_DB Replicate_Ignore_DB Replicate_Do_Table Replicate_Ignore_Table Replicate_Wild_Do_Table Replicate_Wild_Ignore_Table Last_Errno Last_Error Skip_Counter Exec_Master_Log_Pos Relay_Log_Space Until_Condition Until_Log_File Until_Log_Pos Master_SSL_Allowed Master_SSL_CA_File Master_SSL_CA_Path Master_SSL_Cert Master_SSL_Cipher Master_SSL_Key Seconds_Behind_Master
-# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 213 slave-relay-bin.000002 257 master-bin.000001 Yes Yes test.t1 0 0 213 257 None 0 No #
+# 127.0.0.1 root MASTER_PORT 1 master-bin.000001 213 slave-relay-bin.000002 257 master-bin.000001 Yes Yes test.t3,test.t1,test.t2 0 0 213 257 None 0 No #
show tables like 't1';
Tables_in_test (t1)
drop table t1;
@@ -26,15 +26,15 @@ select (@id := id) - id from t3;
0
kill @id;
drop table t2,t3;
-Server shutdown in progress
+ERROR 08S01: Server shutdown in progress
show binlog events from 79;
Log_name Pos Event_type Server_id Orig_log_pos Info
-master-bin.001 79 Query 1 79 use `test`; create table t1 (a int primary key)
-master-bin.001 149 Query 1 149 use `test`; insert into t1 values (1),(1)
-master-bin.001 213 Query 1 213 use `test`; drop table t1
-master-bin.001 261 Query 1 261 use `test`; create table t2 (a int primary key)
-master-bin.001 331 Query 1 331 use `test`; insert into t2 values(1)
-master-bin.001 390 Query 1 390 use `test`; create table t3 (id int)
-master-bin.001 449 Query 1 449 use `test`; insert into t3 values(connection_id())
-master-bin.001 522 Query 1 522 use `test`; update t2 set a = a + 1 + get_lock('crash_lock%20C', 10)
-master-bin.001 613 Query 1 613 use `test`; drop table t2,t3
+master-bin.000001 79 Query 1 79 use `test`; create table t1 (a int primary key)
+master-bin.000001 149 Query 1 149 use `test`; insert into t1 values (1),(1)
+master-bin.000001 213 Query 1 213 use `test`; drop table t1
+master-bin.000001 261 Query 1 261 use `test`; create table t2 (a int primary key)
+master-bin.000001 331 Query 1 331 use `test`; insert into t2 values(1)
+master-bin.000001 390 Query 1 390 use `test`; create table t3 (id int)
+master-bin.000001 449 Query 1 449 use `test`; insert into t3 values(connection_id())
+master-bin.000001 522 Query 1 522 use `test`; update t2 set a = a + 1 + get_lock('crash_lock%20C', 10)
+master-bin.000001 613 Query 1 613 use `test`; drop table t2,t3
diff --git a/mysql-test/r/rpl_optimize.result b/mysql-test/r/rpl_optimize.result
index 5ed541516dc..79891169fbc 100644
--- a/mysql-test/r/rpl_optimize.result
+++ b/mysql-test/r/rpl_optimize.result
@@ -1,9 +1,9 @@
-slave stop;
+stop slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
reset master;
reset slave;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
-slave start;
+start slave;
create table t1 (a int not null auto_increment primary key, b int, key(b));
INSERT INTO t1 (a) VALUES (1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
INSERT INTO t1 (a) SELECT null FROM t1;
diff --git a/mysql-test/r/show_check.result b/mysql-test/r/show_check.result
index 36b8b98f41c..3693d92693f 100644
--- a/mysql-test/r/show_check.result
+++ b/mysql-test/r/show_check.result
@@ -89,8 +89,8 @@ create table t1 (
test_set set( 'val1', 'val2', 'val3' ) not null default '',
name char(20) default 'O''Brien' comment 'O''Brien as default',
c int not null comment 'int column',
-`c-b` int comment 'name with a space',
-`space ` int comment 'name with a space',
+`c-b` int comment 'name with a minus',
+`space 2` int comment 'name with a space',
) comment = 'it\'s a table' ;
show create table t1;
Table Create Table
@@ -98,8 +98,8 @@ t1 CREATE TABLE `t1` (
`test_set` set('val1','val2','val3') NOT NULL default '',
`name` char(20) default 'O''Brien' COMMENT 'O''Brien as default',
`c` int(11) NOT NULL default '0' COMMENT 'int column',
- `c-b` int(11) default NULL COMMENT 'name with a space',
- `space ` int(11) default NULL COMMENT 'name with a space'
+ `c-b` int(11) default NULL COMMENT 'name with a minus',
+ `space 2` int(11) default NULL COMMENT 'name with a space'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='it''s a table'
set sql_quote_show_create=0;
show create table t1;
@@ -108,8 +108,8 @@ t1 CREATE TABLE t1 (
test_set set('val1','val2','val3') NOT NULL default '',
name char(20) default 'O''Brien' COMMENT 'O''Brien as default',
c int(11) NOT NULL default '0' COMMENT 'int column',
- `c-b` int(11) default NULL COMMENT 'name with a space',
- `space ` int(11) default NULL COMMENT 'name with a space'
+ `c-b` int(11) default NULL COMMENT 'name with a minus',
+ `space 2` int(11) default NULL COMMENT 'name with a space'
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='it''s a table'
set sql_quote_show_create=1;
show full columns from t1;
@@ -117,8 +117,8 @@ Field Type Collation Null Key Default Extra Privileges Comment
test_set set('val1','val2','val3') latin1_swedish_ci select,insert,update,references
name char(20) latin1_swedish_ci YES O'Brien select,insert,update,references O'Brien as default
c int(11) NULL 0 select,insert,update,references int column
-c-b int(11) NULL YES NULL select,insert,update,references name with a space
-space int(11) NULL YES NULL select,insert,update,references name with a space
+c-b int(11) NULL YES NULL select,insert,update,references name with a minus
+space 2 int(11) NULL YES NULL select,insert,update,references name with a space
drop table t1;
create table t1 (a int not null, unique aa (a));
show create table t1;
diff --git a/mysql-test/t/insert.test b/mysql-test/t/insert.test
index b3d996c1475..fd728c453aa 100644
--- a/mysql-test/t/insert.test
+++ b/mysql-test/t/insert.test
@@ -93,61 +93,50 @@ 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
-);
+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()
+--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()
+--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()
+--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()
+--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()
+--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()
+--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()
+--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()
+--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()
+--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()
+--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()
+--query_vertical select * from t1 where number =last_insert_id()
drop table t1;
diff --git a/mysql-test/t/multi_update.test b/mysql-test/t/multi_update.test
index 6cb4a107bdb..27fd80e781b 100644
--- a/mysql-test/t/multi_update.test
+++ b/mysql-test/t/multi_update.test
@@ -352,11 +352,9 @@ drop table t1,t2;
CREATE TABLE t1 ( a int );
CREATE TABLE t2 ( a int );
DELETE t1 FROM t1, t2 AS t3;
---error 1066
DELETE t4 FROM t1, t1 AS t4;
---error 1066
DELETE t3 FROM t1 AS t3, t1 AS t4;
-#--error 1066
+--error 1066
DELETE t1 FROM t1 AS t3, t2 AS t4;
INSERT INTO t1 values (1),(2);
INSERT INTO t2 values (1),(2);
diff --git a/mysql-test/t/show_check.test b/mysql-test/t/show_check.test
index 35149edaa7d..638626a7456 100644
--- a/mysql-test/t/show_check.test
+++ b/mysql-test/t/show_check.test
@@ -54,8 +54,8 @@ create table t1 (
test_set set( 'val1', 'val2', 'val3' ) not null default '',
name char(20) default 'O''Brien' comment 'O''Brien as default',
c int not null comment 'int column',
- `c-b` int comment 'name with a space',
- `space ` int comment 'name with a space',
+ `c-b` int comment 'name with a minus',
+ `space 2` int comment 'name with a space',
) comment = 'it\'s a table' ;
show create table t1;
set sql_quote_show_create=0;
diff --git a/sql/field.cc b/sql/field.cc
index c4aef133e6d..3355c45519e 100644
--- a/sql/field.cc
+++ b/sql/field.cc
@@ -2264,25 +2264,23 @@ void Field_longlong::sql_type(String &res) const
add_zerofill_and_unsigned(res);
}
+
/****************************************************************************
-** single precision float
+ single precision float
****************************************************************************/
int Field_float::store(const char *from,uint len,CHARSET_INFO *cs)
{
- int err;
+ int error;
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
+ double nr= my_strntod(cs,(char*) from,len,&end,&error);
+ if (error || ((uint) (end-from) != len && current_thd->count_cuted_fields))
{
+ error= 1;
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED);
- Field_float::store(nr);
- return 1;
}
+ Field_float::store(nr);
+ return error;
}
@@ -2562,25 +2560,23 @@ void Field_float::sql_type(String &res) const
add_zerofill_and_unsigned(res);
}
+
/****************************************************************************
-** double precision floating point numbers
+ double precision floating point numbers
****************************************************************************/
int Field_double::store(const char *from,uint len,CHARSET_INFO *cs)
{
- int err;
+ int error;
char *end;
- double nr= my_strntod(cs,(char*) from,len,&end,&err);
- if (!err && (!current_thd->count_cuted_fields || end-from==len))
- {
- return Field_double::store(nr);
- }
- else
+ double nr= my_strntod(cs,(char*) from, len, &end, &error);
+ if (error || ((uint) (end-from) != len && current_thd->count_cuted_fields))
{
+ error= 1;
set_warning(MYSQL_ERROR::WARN_LEVEL_WARN, ER_WARN_DATA_TRUNCATED);
- Field_double::store(nr);
- return 1;
}
+ Field_double::store(nr);
+ return error;
}
diff --git a/sql/sql_base.cc b/sql/sql_base.cc
index 6eed4298460..0e2db1f5b17 100644
--- a/sql/sql_base.cc
+++ b/sql/sql_base.cc
@@ -1427,10 +1427,10 @@ int open_tables(THD *thd, TABLE_LIST *start, uint *counter)
bool refresh;
int result=0;
DBUG_ENTER("open_tables");
- *counter= 0;
thd->current_tablenr= 0;
restart:
+ *counter= 0;
thd->proc_info="Opening tables";
for (tables=start ; tables ; tables=tables->next)
{
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index 690b4133f61..51600f712e9 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -117,6 +117,7 @@ static bool end_active_trans(THD *thd)
}
+#ifdef HAVE_REPLICATION
inline bool all_tables_not_ok(THD *thd, TABLE_LIST *tables)
{
return (table_rules_on && tables && !tables_ok(thd,tables) &&
@@ -124,6 +125,7 @@ inline bool all_tables_not_ok(THD *thd, TABLE_LIST *tables)
!tables_ok(thd,
(TABLE_LIST *)thd->lex->auxilliary_table_list.first)));
}
+#endif
static HASH hash_user_connections;
@@ -3961,6 +3963,8 @@ void mysql_parse(THD *thd, char *inBuf, uint length)
DBUG_VOID_RETURN;
}
+
+#ifdef HAVE_REPLICATION
/*
Usable by the replication SQL thread only: just parse a query to know if it
can be ignored because of replicate-*-table rules.
@@ -3985,7 +3989,7 @@ bool mysql_test_parse_for_slave(THD *thd, char *inBuf, uint length)
return error;
}
-
+#endif
/*****************************************************************************
** Store field definition for create