diff options
author | unknown <monty@mysql.com> | 2006-01-06 00:47:49 +0200 |
---|---|---|
committer | unknown <monty@mysql.com> | 2006-01-06 00:47:49 +0200 |
commit | 43886f1d92a76f3d45c6afd7df34d182a7c21cb7 (patch) | |
tree | cd157631ca39d533f8aa37ebb570f304e91c81e2 /mysql-test | |
parent | d965dea4b974af86a1c8695626d19547a4fba71e (diff) | |
download | mariadb-git-43886f1d92a76f3d45c6afd7df34d182a7c21cb7.tar.gz |
Review fixes of new pushed code
- Fixed tests
- Optimized new code
- Fixed some unlikely core dumps
- Better bug fixes for:
- #14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
- #14850 (ERROR 1062 when a quering a view using a Group By on a column that can be null
mysql-test/r/create.result:
Update results after removing wrong warnings for CREATE ... SELECT
New tests
mysql-test/r/handler.result:
Drop used tables
mysql-test/r/kill.result:
Make test portable
mysql-test/r/mysqlshow.result:
Drop tables used by previous test
mysql-test/r/trigger.result:
Reuse old procedure name
mysql-test/r/view.result:
Extra tests
mysql-test/t/create.test:
New tests to test fix of removing wrong warnings for CREATE ... SELECT
mysql-test/t/disabled.def:
Enable 'kill' test (should now be portable)
mysql-test/t/handler.test:
Drop used tables
mysql-test/t/kill.test:
Make test portable even if kill doesn't work at once
mysql-test/t/mysqlshow.test:
Drop tables used by previous test
mysql-test/t/trigger.test:
Reuse old procedure name
mysql-test/t/view.test:
Extra tests
sql/field.cc:
Removed compiler warning
sql/ha_federated.cc:
my_snprintf -> strmake()
(Simple optimization)
sql/ha_ndbcluster.cc:
Indentation cleanups and trival optimization
sql/item.cc:
Moved save_org_in_field() to item.cc to make it easier to test
Remove setting of null_value as this is not needed
sql/item.h:
Moved save_org_in_field() to item.cc to make it easier to test
sql/log_event.cc:
Remove inline of slave_load_file_stem()
Added 'extension' parameter to slave_load_file_stem() to get smaller code
Removed not critical (or needed) DBUG_ASSERT()'s
Cleaned up usage of slave_load_file_stem() to not depend on constant string lengths
Indentation fixes
sql/opt_range.cc:
Moved code from declaration to function body
(To make it more readable)
sql/parse_file.cc:
Fixed DBUG_PRINT
sql/sp.cc:
Simple cleanups
- Removed not needed {} level
- Ensure saved variables starts with old_
sql/sp_head.cc:
Indentation fixes
Remove core dump when using --debug when m_next_cached_sp == 0
Fixed compiler warnings
Trivial optimizations
sql/sp_head.h:
Changed argument to set_definer() to const
Added THD argument to recursion_level_error() to avoid call to current_thd
sql/sql_acl.cc:
Removed not needed test (first_not_own_table is the guard)
sql/sql_base.cc:
Removed extra empty line
sql/sql_handler.cc:
Don't test table version in mysql_ha_read() as this is already tested in lock_tables()
Moved call to insert_fields to be after lock_table() to guard aganst reopen of tables
(Better fix for Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash)
sql/sql_insert.cc:
Mark fields that are set in CREATE ... SELECT as used
(Removed wrong warnings about field not having a default value)
sql/sql_parse.cc:
Removed not needed test of 'tables' (first_not_own_table is the guard)
Simplify code
sql/sql_select.cc:
Use group->field to check if value is null instead of item called by 'save_org_in_field'
This is a better bug fix for #14850 (ERROR 1062 when a quering a view using a Group By on a column that can be null)
sql/sql_trigger.cc:
Move sql_modes_parameters outside of function
Indentation fixes
Fixed compiler warning
Ensure that thd->lex->query_tables_own_last is set properly before calling check_table_access()
(This allows us to remove the extra test in check_grant() and check_table_access())
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/r/create.result | 41 | ||||
-rw-r--r-- | mysql-test/r/handler.result | 2 | ||||
-rw-r--r-- | mysql-test/r/kill.result | 2 | ||||
-rw-r--r-- | mysql-test/r/mysqlshow.result | 2 | ||||
-rw-r--r-- | mysql-test/r/trigger.result | 7 | ||||
-rw-r--r-- | mysql-test/r/view.result | 3 | ||||
-rw-r--r-- | mysql-test/t/create.test | 16 | ||||
-rw-r--r-- | mysql-test/t/disabled.def | 1 | ||||
-rw-r--r-- | mysql-test/t/handler.test | 2 | ||||
-rw-r--r-- | mysql-test/t/kill.test | 13 | ||||
-rw-r--r-- | mysql-test/t/mysqlshow.test | 2 | ||||
-rw-r--r-- | mysql-test/t/trigger.test | 9 | ||||
-rw-r--r-- | mysql-test/t/view.test | 1 |
13 files changed, 67 insertions, 34 deletions
diff --git a/mysql-test/r/create.result b/mysql-test/r/create.result index a201af78518..199fdd1eb5d 100644 --- a/mysql-test/r/create.result +++ b/mysql-test/r/create.result @@ -287,7 +287,6 @@ a b create table if not exists t1 select 3 as 'a',4 as 'b'; Warnings: Note 1050 Table 't1' already exists -Warning 1364 Field 'a' doesn't have a default value create table if not exists t1 select 3 as 'a',3 as 'b'; ERROR 23000: Duplicate entry '3' for key 1 select * from t1; @@ -645,8 +644,6 @@ create table t1 ( a varchar(112) charset utf8 collate utf8_bin not null, primary key (a) ) select 'test' as a ; -Warnings: -Warning 1364 Field 'a' doesn't have a default value show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -662,14 +659,39 @@ create table t1 ( a varchar(12) charset utf8 collate utf8_bin not null, b int not null, primary key (a) ) select a, 1 as b from t2 ; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `a` varchar(12) character set utf8 collate utf8_bin NOT NULL, + `b` int(11) NOT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 ( +a varchar(12) charset utf8 collate utf8_bin not null, +b int not null, primary key (a) +) select a, 1 as c from t2 ; Warnings: -Warning 1364 Field 'a' doesn't have a default value Warning 1364 Field 'b' doesn't have a default value show create table t1; Table Create Table t1 CREATE TABLE `t1` ( - `a` varchar(12) character set utf8 collate utf8_bin NOT NULL, `b` int(11) NOT NULL, + `a` varchar(12) character set utf8 collate utf8_bin NOT NULL, + `c` bigint(1) NOT NULL default '0', + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 +drop table t1; +create table t1 ( +a varchar(12) charset utf8 collate utf8_bin not null, +b int null, primary key (a) +) select a, 1 as c from t2 ; +show create table t1; +Table Create Table +t1 CREATE TABLE `t1` ( + `b` int(11) default NULL, + `a` varchar(12) character set utf8 collate utf8_bin NOT NULL, + `c` bigint(1) NOT NULL default '0', PRIMARY KEY (`a`) ) ENGINE=MyISAM DEFAULT CHARSET=latin1 drop table t1; @@ -677,9 +699,6 @@ create table t1 ( a varchar(12) charset utf8 collate utf8_bin not null, b int not null, primary key (a) ) select 'a' as a , 1 as b from t2 ; -Warnings: -Warning 1364 Field 'a' doesn't have a default value -Warning 1364 Field 'b' doesn't have a default value show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -692,8 +711,6 @@ create table t1 ( a varchar(12) charset utf8 collate utf8_bin, b int not null, primary key (a) ) select 'a' as a , 1 as b from t2 ; -Warnings: -Warning 1364 Field 'b' doesn't have a default value show create table t1; Table Create Table t1 CREATE TABLE `t1` ( @@ -712,8 +729,6 @@ a1 varchar(12) charset utf8 collate utf8_bin not null, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, primary key (a1) ) select a1,a2,a3,a4,a5,a6,a7,a8,a9 from t1 ; -Warnings: -Warning 1364 Field 'a1' doesn't have a default value drop table t2; create table t2 ( a1 varchar(12) charset utf8 collate utf8_bin, @@ -729,8 +744,6 @@ a1 varchar(12) charset utf8 collate utf8_bin not null, a2 int, a3 int, a4 int, a5 int, a6 int, a7 int, a8 int, a9 int, primary key (a1) ) select a1,a2,a3,a4,a5,a6,a7,a8,a9 from t1 ; -Warnings: -Warning 1364 Field 'a1' doesn't have a default value drop table t2; create table t2 ( a int default 3, b int default 3) select a1,a2 from t1; diff --git a/mysql-test/r/handler.result b/mysql-test/r/handler.result index 133683fb273..104025e83eb 100644 --- a/mysql-test/r/handler.result +++ b/mysql-test/r/handler.result @@ -1,4 +1,4 @@ -drop table if exists t1; +drop table if exists t1,t3,t4,t5; create table t1 (a int, b char(10), key a(a), key b(a,b)); insert into t1 values (17,"ddd"),(18,"eee"),(19,"fff"),(19,"yyy"), diff --git a/mysql-test/r/kill.result b/mysql-test/r/kill.result index 754568093ff..2413834be4f 100644 --- a/mysql-test/r/kill.result +++ b/mysql-test/r/kill.result @@ -5,8 +5,6 @@ select ((@id := kill_id) - kill_id) from t1; ((@id := kill_id) - kill_id) 0 kill @id; -select 1; -Got one of the listed errors select ((@id := kill_id) - kill_id) from t1; ((@id := kill_id) - kill_id) 0 diff --git a/mysql-test/r/mysqlshow.result b/mysql-test/r/mysqlshow.result index 355c20fdad3..942cde83f21 100644 --- a/mysql-test/r/mysqlshow.result +++ b/mysql-test/r/mysqlshow.result @@ -1,4 +1,4 @@ -DROP TABLE IF EXISTS t1,t2; +DROP TABLE IF EXISTS t1,t2,test1,test2; CREATE TABLE t1 (a int); INSERT INTO t1 VALUES (1),(2),(3); CREATE TABLE t2 (a int, b int); diff --git a/mysql-test/r/trigger.result b/mysql-test/r/trigger.result index ff92fc543d4..0ad5c485b28 100644 --- a/mysql-test/r/trigger.result +++ b/mysql-test/r/trigger.result @@ -767,8 +767,7 @@ deallocate prepare stmt1; drop procedure p1; drop table t1, t2, t3; create table t1 (a int); -drop procedure if exists p2; -CREATE PROCEDURE `p2`() +CREATE PROCEDURE `p1`() begin insert into t1 values (1); end// @@ -777,6 +776,6 @@ begin declare done int default 0; set done= not done; end// -CALL p2(); -drop procedure p2; +CALL p1(); +drop procedure p1; drop table t1; diff --git a/mysql-test/r/view.result b/mysql-test/r/view.result index ebb2c190eb1..c26671ac937 100644 --- a/mysql-test/r/view.result +++ b/mysql-test/r/view.result @@ -2418,6 +2418,9 @@ drop view v1; drop table t1; create table t1(f1 int, f2 int); insert into t1 values (null, 10), (null,2); +select f1, sum(f2) from t1 group by f1; +f1 sum(f2) +NULL 12 create view v1 as select * from t1; select f1, sum(f2) from v1 group by f1; f1 sum(f2) diff --git a/mysql-test/t/create.test b/mysql-test/t/create.test index 470a7bcbb59..fcbdff7ec5b 100644 --- a/mysql-test/t/create.test +++ b/mysql-test/t/create.test @@ -573,6 +573,22 @@ drop table t1; --warning 1364 create table t1 ( + a varchar(12) charset utf8 collate utf8_bin not null, + b int not null, primary key (a) +) select a, 1 as c from t2 ; +show create table t1; +drop table t1; + +--warning 1364 +create table t1 ( + a varchar(12) charset utf8 collate utf8_bin not null, + b int null, primary key (a) +) select a, 1 as c from t2 ; +show create table t1; +drop table t1; + +--warning 1364 +create table t1 ( a varchar(12) charset utf8 collate utf8_bin not null, b int not null, primary key (a) ) select 'a' as a , 1 as b from t2 ; diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index fe95a543fb5..b96aa7befd9 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -14,4 +14,3 @@ sp-goto : GOTO is currently is disabled - will be fixed in the future rpl_relayrotate : Unstable test case, bug#12429 rpl_until : Unstable test case, bug#12429 rpl_deadlock : Unstable test case, bug#12429 -kill : Unstable test case, bug#9712 diff --git a/mysql-test/t/handler.test b/mysql-test/t/handler.test index f3e14c3cd2b..3fb09df5f2f 100644 --- a/mysql-test/t/handler.test +++ b/mysql-test/t/handler.test @@ -3,7 +3,7 @@ # --disable_warnings -drop table if exists t1; +drop table if exists t1,t3,t4,t5; --enable_warnings create table t1 (a int, b char(10), key a(a), key b(a,b)); diff --git a/mysql-test/t/kill.test b/mysql-test/t/kill.test index 7f3a9932d31..c50c35825fc 100644 --- a/mysql-test/t/kill.test +++ b/mysql-test/t/kill.test @@ -25,11 +25,18 @@ select ((@id := kill_id) - kill_id) from t1; kill @id; connection con1; ---sleep 1 +--sleep 2 -# this statement should fail ---error 2006,2013 +--disable_query_log +--disable_result_log +# One of the following statements should fail +--error 0,2006,2013 select 1; +--error 0,2006,2013 +select 1; +--enable_query_log +--enable_result_log + --enable_reconnect # this should work, and we should have a new connection_id() select ((@id := kill_id) - kill_id) from t1; diff --git a/mysql-test/t/mysqlshow.test b/mysql-test/t/mysqlshow.test index 1e2e97a4e07..78c4ae2b531 100644 --- a/mysql-test/t/mysqlshow.test +++ b/mysql-test/t/mysqlshow.test @@ -2,7 +2,7 @@ -- source include/not_embedded.inc --disable_warnings -DROP TABLE IF EXISTS t1,t2; +DROP TABLE IF EXISTS t1,t2,test1,test2; --enable_warnings # diff --git a/mysql-test/t/trigger.test b/mysql-test/t/trigger.test index d4fa5268762..acd3297e12a 100644 --- a/mysql-test/t/trigger.test +++ b/mysql-test/t/trigger.test @@ -928,11 +928,8 @@ drop table t1, t2, t3; # operator. # create table t1 (a int); ---disable_warnings -drop procedure if exists p2; ---enable_warnings DELIMITER //; -CREATE PROCEDURE `p2`() +CREATE PROCEDURE `p1`() begin insert into t1 values (1); end// @@ -942,7 +939,7 @@ begin set done= not done; end// DELIMITER ;// -CALL p2(); -drop procedure p2; +CALL p1(); +drop procedure p1; drop table t1; diff --git a/mysql-test/t/view.test b/mysql-test/t/view.test index ac103278f08..bc54287afb2 100644 --- a/mysql-test/t/view.test +++ b/mysql-test/t/view.test @@ -2276,6 +2276,7 @@ drop table t1; # create table t1(f1 int, f2 int); insert into t1 values (null, 10), (null,2); +select f1, sum(f2) from t1 group by f1; create view v1 as select * from t1; select f1, sum(f2) from v1 group by f1; drop view v1; |