mirror of
				https://github.com/MariaDB/server.git
				synced 2025-11-03 14:33:32 +03:00 
			
		
		
		
	BitKeeper/deleted/.del-raid.test~501e9e00b3c27a55: Delete: mysql-test/t/raid.test mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test: Test change mysql-test/r/binlog_stm_mix_innodb_myisam.result: New results mysql-test/r/ctype_ujis.result: New results mysql-test/r/innodb_concurrent.result: New results. mysql-test/r/rpl_heap.result: New results mysql-test/r/warnings.result: New results mysql-test/t/ctype_ujis.test: Fixed ENGINE=, test should now actually function mysql-test/t/innodb_concurrent.test: Fixed test for engine mysql-test/t/rpl_heap.test: Fixed test for engine mysql-test/t/system_mysql_db_fix.test: Fixed setup. mysql-test/t/warnings.test: Removed deprecated tests scripts/fill_func_tables.sh: Fixed script scripts/mysql_convert_table_format.sh: Fixed script sql/ha_innodb.cc: Fixed comment sql/sql_yacc.yy: Removed deprecated syntax tests/fork_big.pl: Fixed scipt tests/fork_big2.pl: Fixed script tests/mail_to_db.pl: Fixed script tests/mysql_client_test.c: Fixed test
		
			
				
	
	
		
			148 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			148 lines
		
	
	
		
			3.2 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
#
 | 
						|
# Test some warnings
 | 
						|
#
 | 
						|
--disable_warnings
 | 
						|
drop table if exists t1, t2;
 | 
						|
--enable_warnings
 | 
						|
SET SQL_WARNINGS=1;
 | 
						|
 | 
						|
create table t1 (a int);
 | 
						|
--error 1050
 | 
						|
create table t1 (a int);
 | 
						|
show count(*) errors;
 | 
						|
show errors;
 | 
						|
show warnings;
 | 
						|
--error 1115
 | 
						|
create table t2(a int) default charset qwerty;
 | 
						|
show count(*) errors;
 | 
						|
show errors;
 | 
						|
--error 1064
 | 
						|
create table t (i);
 | 
						|
show count(*) errors;
 | 
						|
show errors;
 | 
						|
insert into t1 values (1);
 | 
						|
insert into t1 values ("hej");
 | 
						|
insert into t1 values ("hej"),("då");
 | 
						|
set SQL_WARNINGS=1;
 | 
						|
insert into t1 values ("hej");
 | 
						|
insert into t1 values ("hej"),("då");
 | 
						|
drop table t1;
 | 
						|
set SQL_WARNINGS=0;
 | 
						|
 | 
						|
#
 | 
						|
# Test other warnings
 | 
						|
#
 | 
						|
 | 
						|
drop temporary table if exists not_exists;
 | 
						|
drop table if exists not_exists_table;
 | 
						|
show warnings limit 1;
 | 
						|
drop database if exists not_exists_db;
 | 
						|
show count(*) warnings;
 | 
						|
create table t1(id int);
 | 
						|
create table if not exists t1(id int);
 | 
						|
--disable_ps_protocol
 | 
						|
select @@warning_count;
 | 
						|
--enable_ps_protocol
 | 
						|
drop table t1;
 | 
						|
 | 
						|
#
 | 
						|
# Test warnings for LOAD DATA INFILE
 | 
						|
#
 | 
						|
 | 
						|
create table t1(a tinyint, b int not null, c date, d char(5));
 | 
						|
load data infile '../std_data_ln/warnings_loaddata.dat' into table t1 fields terminated by ',';
 | 
						|
# PS doesn't work good with @@warning_count
 | 
						|
--disable_ps_protocol
 | 
						|
select @@warning_count;
 | 
						|
--enable_ps_protocol
 | 
						|
drop table t1;
 | 
						|
 | 
						|
#
 | 
						|
# Warnings from basic INSERT, UPDATE and ALTER commands
 | 
						|
#
 | 
						|
 | 
						|
create table t1(a tinyint NOT NULL, b tinyint unsigned, c char(5));
 | 
						|
insert into t1 values(NULL,100,'mysql'),(10,-1,'mysql ab'),(500,256,'open source'),(20,NULL,'test');
 | 
						|
alter table t1 modify c char(4);
 | 
						|
alter table t1 add d char(2);
 | 
						|
update t1 set a=NULL where a=10;
 | 
						|
update t1 set c='mysql ab' where c='test';
 | 
						|
update t1 set d=c;
 | 
						|
create table t2(a tinyint NOT NULL, b char(3));
 | 
						|
insert into t2 select b,c from t1;
 | 
						|
insert into t2(b) values('mysqlab');
 | 
						|
set sql_warnings=1;
 | 
						|
insert into t2(b) values('mysqlab');
 | 
						|
set sql_warnings=0;
 | 
						|
drop table t1, t2;
 | 
						|
 | 
						|
#
 | 
						|
# Test for max_error_count
 | 
						|
#
 | 
						|
 | 
						|
create table t1(a char(10));
 | 
						|
let $1=50;
 | 
						|
disable_query_log;
 | 
						|
while ($1)
 | 
						|
{
 | 
						|
  eval insert into t1 values('mysql ab');
 | 
						|
  dec $1;
 | 
						|
}
 | 
						|
enable_query_log;
 | 
						|
alter table t1 add b char;
 | 
						|
set max_error_count=10;
 | 
						|
update t1 set b=a;
 | 
						|
--disable_ps_protocol
 | 
						|
select @@warning_count;
 | 
						|
--enable_ps_protocol
 | 
						|
 | 
						|
# Bug#9072
 | 
						|
set max_error_count=0;
 | 
						|
show variables like 'max_error_count';
 | 
						|
update t1 set b='hi';
 | 
						|
--disable_ps_protocol
 | 
						|
select @@warning_count;
 | 
						|
--enable_ps_protocol
 | 
						|
show warnings;
 | 
						|
set max_error_count=65535;
 | 
						|
show variables like 'max_error_count';
 | 
						|
set max_error_count=10;
 | 
						|
show variables like 'max_error_count';
 | 
						|
 | 
						|
#
 | 
						|
# Test for handler type
 | 
						|
#
 | 
						|
drop table t1;
 | 
						|
#create table t1 (id int) engine=isam;
 | 
						|
#alter table t1 engine=isam;
 | 
						|
#drop table t1;
 | 
						|
 | 
						|
#
 | 
						|
# Test for deprecated table_type variable
 | 
						|
#
 | 
						|
set table_type=MYISAM;
 | 
						|
 | 
						|
#
 | 
						|
# Tests for show warnings limit a, b
 | 
						|
#
 | 
						|
create table t1 (a int);
 | 
						|
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
 | 
						|
# should generate 10 warnings
 | 
						|
update t1 set a='abc';
 | 
						|
show warnings limit 2, 1;
 | 
						|
show warnings limit 0, 10;
 | 
						|
show warnings limit 9, 1;
 | 
						|
show warnings limit 10, 1;
 | 
						|
show warnings limit 9, 2;
 | 
						|
show warnings limit 0, 0;
 | 
						|
show warnings limit 1;
 | 
						|
show warnings limit 0;
 | 
						|
show warnings limit 1, 0;
 | 
						|
# make sure behaviour is consistent with select ... limit
 | 
						|
select * from t1 limit 0;
 | 
						|
select * from t1 limit 1, 0;
 | 
						|
select * from t1 limit 0, 0;
 | 
						|
drop table t1;
 | 
						|
 | 
						|
# End of 4.1 tests
 |