Commit b89367f2 authored by unknown's avatar unknown
Browse files

Fixes for tests after merge from 5.0


mysql-test/r/grant.result:
  Fixed a result. Editor added wrong characters.
mysql-test/r/mysqlbinlog2.result:
  Fixed
mysql-test/r/sp.result:
  Fixed a result, moved lines around.
mysql-test/r/sp_trans.result:
  Fixed a result, moved lines around.
mysql-test/t/mysqlbinlog2.test:
  Merged tests from 5.0
mysql-test/t/sp_trans.test:
  Merged test from 5.0 and fixed to be compatible with 5.1
sql/sql_class.cc:
  Merged from 5.0
sql/sql_error.cc:
  Fixed push_warning()
parent 67da87d8
Loading
Loading
Loading
Loading
+30 −30
Original line number Diff line number Diff line
@@ -260,29 +260,29 @@ GRANT USAGE ON *.* TO 'mysqltest_1'@'localhost' IDENTIFIED BY PASSWORD '*2470C0C
GRANT SELECT, INSERT, UPDATE ON `test`.* TO 'mysqltest_1'@'localhost'
drop user mysqltest_1@localhost;
SET NAMES koi8r;
CREATE DATABASE ツト;
USE ツト;
CREATE TABLE ヤチツ (ヒマフ int);
GRANT SELECT ON ツト.* TO タレナメ@localhost;
SHOW GRANTS FOR タレナメ@localhost;
Grants for タレナメ@localhost
GRANT USAGE ON *.* TO 'タレナメ'@'localhost'
GRANT SELECT ON `ツト`.* TO 'タレナメ'@'localhost'
REVOKE SELECT ON ツト.* FROM タレナメ@localhost;
GRANT SELECT ON ツト.ヤチツ TO タレナメ@localhost;
SHOW GRANTS FOR タレナメ@localhost;
Grants for タレナメ@localhost
GRANT USAGE ON *.* TO 'タレナメ'@'localhost'
GRANT SELECT ON `ツト`.`ヤチツ` TO 'タレナメ'@'localhost'
REVOKE SELECT ON ツト.ヤチツ FROM タレナメ@localhost;
GRANT SELECT (ヒマフ) ON ツト.ヤチツ TO タレナメ@localhost;
SHOW GRANTS FOR タレナメ@localhost;
Grants for タレナメ@localhost
GRANT USAGE ON *.* TO 'タレナメ'@'localhost'
GRANT SELECT (ヒマフ) ON `ツト`.`ヤチツ` TO 'タレナメ'@'localhost'
REVOKE SELECT (ヒマフ) ON ツト.ヤチツ FROM タレナメ@localhost;
DROP USER タレナメ@localhost;
DROP DATABASE ツト;
CREATE DATABASE ;
USE ;
CREATE TABLE  ( int);
GRANT SELECT ON .* TO @localhost;
SHOW GRANTS FOR @localhost;
Grants for @localhost
GRANT USAGE ON *.* TO ''@'localhost'
GRANT SELECT ON ``.* TO ''@'localhost'
REVOKE SELECT ON .* FROM @localhost;
GRANT SELECT ON . TO @localhost;
SHOW GRANTS FOR @localhost;
Grants for @localhost
GRANT USAGE ON *.* TO ''@'localhost'
GRANT SELECT ON ``.`` TO ''@'localhost'
REVOKE SELECT ON . FROM @localhost;
GRANT SELECT () ON . TO @localhost;
SHOW GRANTS FOR @localhost;
Grants for @localhost
GRANT USAGE ON *.* TO ''@'localhost'
GRANT SELECT () ON ``.`` TO ''@'localhost'
REVOKE SELECT () ON . FROM @localhost;
DROP USER @localhost;
DROP DATABASE ;
SET NAMES latin1;
USE test;
CREATE TABLE t1 (a int );
@@ -613,22 +613,22 @@ set @user123="non-existent";
select * from mysql.db where user=@user123;
Host	Db	User	Select_priv	Insert_priv	Update_priv	Delete_priv	Create_priv	Drop_priv	Grant_priv	References_priv	Index_priv	Alter_priv	Create_tmp_table_priv	Lock_tables_priv	Create_view_priv	Show_view_priv	Create_routine_priv	Alter_routine_priv	Execute_priv	Event_priv	Trigger_priv
set names koi8r;
create database ツト;
grant select on ツト.* to root@localhost;
select hex(Db) from mysql.db where Db='ツト';
create database ;
grant select on .* to root@localhost;
select hex(Db) from mysql.db where Db='';
hex(Db)
D0B1D0B4
show grants for root@localhost;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT SELECT ON `ツト`.* TO 'root'@'localhost'
GRANT SELECT ON ``.* TO 'root'@'localhost'
flush privileges;
show grants for root@localhost;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
GRANT SELECT ON `ツト`.* TO 'root'@'localhost'
drop database ツト;
revoke all privileges on ツト.* from root@localhost;
GRANT SELECT ON ``.* TO 'root'@'localhost'
drop database ;
revoke all privileges on .* from root@localhost;
show grants for root@localhost;
Grants for root@localhost
GRANT ALL PRIVILEGES ON *.* TO 'root'@'localhost' WITH GRANT OPTION
+0 −2
Original line number Diff line number Diff line
@@ -134,7 +134,6 @@ SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
insert into t1 values(null, "d")/*!*/;
SET INSERT_ID=5/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
@@ -512,7 +511,6 @@ SET @@session.sql_mode=0/*!*/;
/*!\C latin1 *//*!*/;
SET @@session.character_set_client=8,@@session.collation_connection=8,@@session.collation_server=8/*!*/;
insert into t1 values(null, "d")/*!*/;
SET INSERT_ID=5/*!*/;
DELIMITER ;
# End of log file
ROLLBACK /* added by mysqlbinlog */;
+85 −84
Original line number Diff line number Diff line
@@ -5643,90 +5643,6 @@ t3_id_1 t3_id_2 t4_id
DROP PROCEDURE p1|
DROP VIEW v1, v2|
DROP TABLE t3, t4|
drop function if exists bug20777|
drop table if exists examplebug20777|
create function bug20777(f1 bigint unsigned) returns bigint unsigned
begin
set f1 = (f1 - 10); set f1 = (f1 10);
return f1;
end|
select bug20777(9223372036854775803) as '9223372036854775803   2**63-5';
9223372036854775803   2**63-5
9223372036854775803
select bug20777(9223372036854775804) as '9223372036854775804   2**63-4';
9223372036854775804   2**63-4
9223372036854775804
select bug20777(9223372036854775805) as '9223372036854775805   2**63-3';
9223372036854775805   2**63-3
9223372036854775805
select bug20777(9223372036854775806) as '9223372036854775806   2**63-2';
9223372036854775806   2**63-2
9223372036854775806
select bug20777(9223372036854775807) as '9223372036854775807   2**63-1';
9223372036854775807   2**63-1
9223372036854775807
select bug20777(9223372036854775808) as '9223372036854775808   2**63+0';
9223372036854775808   2**63+0
9223372036854775808
select bug20777(9223372036854775809) as '9223372036854775809   2**63+1';
9223372036854775809   2**63+1
9223372036854775809
select bug20777(9223372036854775810) as '9223372036854775810   2**63+2';
9223372036854775810   2**63+2
9223372036854775810
select bug20777(-9223372036854775808) as 'lower bounds signed bigint';
lower bounds signed bigint
0
select bug20777(9223372036854775807) as 'upper bounds signed bigint';
upper bounds signed bigint
9223372036854775807
select bug20777(0) as 'lower bounds unsigned bigint';
lower bounds unsigned bigint
0
select bug20777(18446744073709551615) as 'upper bounds unsigned bigint';
upper bounds unsigned bigint
18446744073709551615
select bug20777(18446744073709551616) as 'upper bounds unsigned bigint 1';
upper bounds unsigned bigint 1
18446744073709551615
select bug20777(-1) as 'lower bounds unsigned bigint - 1';
lower bounds unsigned bigint - 1
0
create table examplebug20777 as select 
0 as 'i',
bug20777(9223372036854775806) as '2**63-2',
bug20777(9223372036854775807) as '2**63-1',
bug20777(9223372036854775808) as '2**63',
bug20777(9223372036854775809) as '2**63+1',
bug20777(18446744073709551614) as '2**64-2',
bug20777(18446744073709551615) as '2**64-1', 
bug20777(18446744073709551616) as '2**64',
bug20777(0) as '0',
bug20777(-1) as '-1';
insert into examplebug20777 values (1, 9223372036854775806, 9223372036854775807, 223372036854775808, 9223372036854775809, 18446744073709551614, 18446744073709551615, 8446744073709551616, 0, -1);
show create table examplebug20777;
Table	Create Table
examplebug20777	CREATE TABLE `examplebug20777` (
  `i` int(1) NOT NULL DEFAULT '0',
  `2**63-2` bigint(20) unsigned DEFAULT NULL,
  `2**63-1` bigint(20) unsigned DEFAULT NULL,
  `2**63` bigint(20) unsigned DEFAULT NULL,
  `2**63+1` bigint(20) unsigned DEFAULT NULL,
  `2**64-2` bigint(20) unsigned DEFAULT NULL,
  `2**64-1` bigint(20) unsigned DEFAULT NULL,
  `2**64` bigint(20) unsigned DEFAULT NULL,
  `0` bigint(20) unsigned DEFAULT NULL,
  `-1` bigint(20) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from examplebug20777 order by i;
i	2**63-2	2**63-1	2**63	2**63+1	2**64-2	2**64-1	2**64	0	-1
0	9223372036854775806	9223372036854775807	9223372036854775808	9223372036854775809	18446744073709551614	18446744073709551615	18446744073709551615	0	0
1	9223372036854775806	9223372036854775807	223372036854775808	9223372036854775809	18446744073709551614	18446744073709551615	8446744073709551616	0	0
drop table examplebug20777;
select bug20777(18446744073709551613)+1;
bug20777(18446744073709551613)+1
18446744073709551614
drop function bug20777;
End of 5.0 tests
Begin of 5.1 tests
drop function if exists pi;
@@ -6160,6 +6076,91 @@ DATABASE()
NULL
DROP DATABASE mysqltest1|
use test|
drop function if exists bug20777|
drop table if exists examplebug20777|
create function bug20777(f1 bigint unsigned) returns bigint unsigned
begin
set f1 = (f1 - 10); set f1 = (f1 + 10);
return f1;
end|
select bug20777(9223372036854775803) as '9223372036854775803   2**63-5';
9223372036854775803   2**63-5
9223372036854775803
select bug20777(9223372036854775804) as '9223372036854775804   2**63-4';
9223372036854775804   2**63-4
9223372036854775804
select bug20777(9223372036854775805) as '9223372036854775805   2**63-3';
9223372036854775805   2**63-3
9223372036854775805
select bug20777(9223372036854775806) as '9223372036854775806   2**63-2';
9223372036854775806   2**63-2
9223372036854775806
select bug20777(9223372036854775807) as '9223372036854775807   2**63-1';
9223372036854775807   2**63-1
9223372036854775807
select bug20777(9223372036854775808) as '9223372036854775808   2**63+0';
9223372036854775808   2**63+0
9223372036854775808
select bug20777(9223372036854775809) as '9223372036854775809   2**63+1';
9223372036854775809   2**63+1
9223372036854775809
select bug20777(9223372036854775810) as '9223372036854775810   2**63+2';
9223372036854775810   2**63+2
9223372036854775810
select bug20777(-9223372036854775808) as 'lower bounds signed bigint';
lower bounds signed bigint
0
select bug20777(9223372036854775807) as 'upper bounds signed bigint';
upper bounds signed bigint
9223372036854775807
select bug20777(0) as 'lower bounds unsigned bigint';
lower bounds unsigned bigint
0
select bug20777(18446744073709551615) as 'upper bounds unsigned bigint';
upper bounds unsigned bigint
18446744073709551615
select bug20777(18446744073709551616) as 'upper bounds unsigned bigint + 1';
upper bounds unsigned bigint + 1
18446744073709551615
select bug20777(-1) as 'lower bounds unsigned bigint - 1';
lower bounds unsigned bigint - 1
0
create table examplebug20777 as select 
0 as 'i',
bug20777(9223372036854775806) as '2**63-2',
bug20777(9223372036854775807) as '2**63-1',
bug20777(9223372036854775808) as '2**63',
bug20777(9223372036854775809) as '2**63+1',
bug20777(18446744073709551614) as '2**64-2',
bug20777(18446744073709551615) as '2**64-1', 
bug20777(18446744073709551616) as '2**64',
bug20777(0) as '0',
bug20777(-1) as '-1';
insert into examplebug20777 values (1, 9223372036854775806, 9223372036854775807, 223372036854775808, 9223372036854775809, 18446744073709551614, 18446744073709551615, 8446744073709551616, 0, -1);
show create table examplebug20777;
Table	Create Table
examplebug20777	CREATE TABLE `examplebug20777` (
  `i` int(1) NOT NULL DEFAULT '0',
  `2**63-2` bigint(20) unsigned DEFAULT NULL,
  `2**63-1` bigint(20) unsigned DEFAULT NULL,
  `2**63` bigint(20) unsigned DEFAULT NULL,
  `2**63+1` bigint(20) unsigned DEFAULT NULL,
  `2**64-2` bigint(20) unsigned DEFAULT NULL,
  `2**64-1` bigint(20) unsigned DEFAULT NULL,
  `2**64` bigint(20) unsigned DEFAULT NULL,
  `0` bigint(20) unsigned DEFAULT NULL,
  `-1` bigint(20) unsigned DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1
select * from examplebug20777 order by i;
i	2**63-2	2**63-1	2**63	2**63+1	2**64-2	2**64-1	2**64	0	-1
0	9223372036854775806	9223372036854775807	9223372036854775808	9223372036854775809	18446744073709551614	18446744073709551615	18446744073709551615	0	0
1	9223372036854775806	9223372036854775807	223372036854775808	9223372036854775809	18446744073709551614	18446744073709551615	8446744073709551616	0	0
drop table examplebug20777;
select bug20777(18446744073709551613)+1;
bug20777(18446744073709551613)+1
18446744073709551614
drop function bug20777;
End of 5.0 tests.
drop table t1,t2;
CREATE TABLE t1 (a int auto_increment primary key) engine=MyISAM;
CREATE TABLE t2 (a int auto_increment primary key, b int) engine=innodb;
+25 −21
Original line number Diff line number Diff line
@@ -530,27 +530,6 @@ count(*)
drop table t3, t4|
drop procedure bug14210|
set @@session.max_heap_table_size=default|
drop function if exists bug23333|
drop table if exists t1,t2|
CREATE TABLE t1 (a int  NOT NULL auto_increment primary key) ENGINE=MyISAM|
CREATE TABLE t2 (a int  NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB|
insert into t2 values (1,1)|
create function bug23333() 
RETURNS int(11)
DETERMINISTIC
begin
insert into t1 values (null);
select count(*) from t1 into @a;
return @a;
end|
reset master|
insert into t2 values (bug23333(),1)|
ERROR 23000: Duplicate entry '1' for key 1
show binlog events from 98 /* with fixes for #23333 will show there is the query */|
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
select count(*),@a from t1 /* must be 1,1 */|
count(*)	@a
1	1
CREATE DATABASE db_bug7787|
use db_bug7787|
CREATE PROCEDURE p1()
@@ -577,3 +556,28 @@ f1 bug13575(f1)
3	ccc
drop function bug13575|
drop table t3|
drop function if exists bug23333|
drop table if exists t1,t2|
CREATE TABLE t1 (a int  NOT NULL auto_increment primary key) ENGINE=MyISAM|
CREATE TABLE t2 (a int  NOT NULL auto_increment, b int, PRIMARY KEY (a)) ENGINE=InnoDB|
insert into t2 values (1,1)|
create function bug23333() 
RETURNS int(11)
DETERMINISTIC
begin
insert into t1 values (null);
select count(*) from t1 into @a;
return @a;
end|
reset master|
insert into t2 values (bug23333(),1)|
ERROR 23000: Duplicate entry '1' for key 'PRIMARY'
show binlog events from 106 /* with fixes for #23333 will show there is the query */|
Log_name	Pos	Event_type	Server_id	End_log_pos	Info
master-bin.000001	#	Table_map	1	#	#
master-bin.000001	#	Table_map	1	#	#
master-bin.000001	#	Write_rows	1	#	#
master-bin.000001	#	Query	1	#	#
select count(*),@a from t1 /* must be 1,1 */|
count(*)	@a
1	1
+5 −5
Original line number Diff line number Diff line
@@ -60,7 +60,7 @@ select "--- stop-position --" as "";
--disable_query_log
select "--- start and stop positions ---" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=600 --stop-position 725 $MYSQLTEST_VARDIR/log/master-bin.000001 
--exec $MYSQL_BINLOG --short-form --start-position=608 --stop-position 725 $MYSQLTEST_VARDIR/log/master-bin.000001 
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
@@ -115,14 +115,14 @@ select "--- start-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=608 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 
--disable_query_log
select "--- start and stop positions ---" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=600 --stop-position 725 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log
select "--- stop-position --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --stop-position=608 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001 
--disable_query_log
select "--- start and stop positions ---" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form --start-position=608 --stop-position 725 --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
--disable_query_log
select "--- start-datetime --" as "";
--enable_query_log
--exec $MYSQL_BINLOG --short-form "--start-datetime=2020-01-21 15:32:24" --read-from-remote-server --user=root --host=127.0.0.1 --port=$MASTER_MYPORT master-bin.000001
Loading