mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 04:53:01 +01:00
d40f7056ae
mysql-test/include/have_outfile.inc: Use MYSQLTEST_VARDIR mysql-test/include/test_outfile.inc: Use MYSQLTEST_VARDIR mysql-test/mysql-test-run.pl: Create variable $MYSQLTEST_VARDIR that points to the vardir Don't create a symlink from var/ to the physical vardir if it's somewhere else Setup a symlink(or copy dir on windows) for std_data so it is available in the physical vardir Use "../tmp" as slave-load-tmpdir, since the server is started in var/master-data and slave in var/slave-data they will both find the dumps in "../tmp" mysql-test/mysql-test-run.sh: Export MYSQLTEST_VARDIR, always pointing at mysql-test/var mysql-test/r/backup.result: Use MYSQLTEST_VARDIR mysql-test/r/blackhole.result: Use "../std_data_ln" to find std_data files mysql-test/r/loaddata.result: Use "../std_data_ln" to find std_data files mysql-test/r/mysqlbinlog.result: Use "../std_data_ln" to find std_data files mysql-test/r/mysqltest.result: Use MYSQLTEST_VARDIR mysql-test/r/outfile.result: Use MYSQLTEST_VARDIR mysql-test/r/query_cache.result: Add missing drop function mysql-test/r/rpl000001.result: Use "../std_data_ln" to find std_data files mysql-test/r/rpl000004.result: Use "../std_data_ln" to find std_data files mysql-test/r/rpl_innodb.result: Use "../std_data_ln" to find std_data files mysql-test/r/rpl_loaddata.result: Use "../std_data_ln" to find std_data files mysql-test/r/rpl_loaddata_rule_m.result: Use "../std_data_ln" to find std_data files mysql-test/r/rpl_loaddata_rule_s.result: Use "../std_data_ln" to find std_data files mysql-test/r/rpl_loaddatalocal.result: Use MYSQLTEST_VARDIR mysql-test/r/rpl_log.result: Use "../std_data_ln" to find std_data files mysql-test/r/rpl_misc_functions.result: Use MYSQLTEST_VARDIR mysql-test/r/rpl_replicate_do.result: Use "../std_data_ln" to find std_data files mysql-test/r/rpl_rewrite_db.result: Use "../std_data_ln" to find std_data files mysql-test/r/rpl_timezone.result: Use "../std_data_ln" to find std_data files mysql-test/r/symlink.result: Use MYSQLTEST_VARDIR mysql-test/r/trigger.result: Use "../std_data_ln" to find std_data files mysql-test/r/view.result: Use "../std_data_ln" to find std_data files mysql-test/r/warnings.result: Use "../std_data_ln" to find std_data files mysql-test/t/backup-master.sh: Use MYSQLTEST_VARDIR mysql-test/t/backup.test: Use MYSQLTEST_VARDIR mysql-test/t/blackhole.test: Use "../std_data_ln" to find std_data files mysql-test/t/ctype_ucs_binlog.test: Use MYSQLTEST_VARDIR mysql-test/t/im_daemon_life_cycle-im.opt: Use MYSQLTEST_VARDIR mysql-test/t/im_options_set.imtest: Use MYSQLTEST_VARDIR mysql-test/t/im_options_unset.imtest: Use MYSQLTEST_VARDIR mysql-test/t/loaddata.test: Use "../std_data_ln" to find std_data files mysql-test/t/myisam.test: Use MYSQLTEST_VARDIR mysql-test/t/mysqlbinlog.test: Use "../std_data_ln" to find std_data files mysql-test/t/mysqlbinlog2.test: Use MYSQLTEST_VARDIR mysql-test/t/mysqldump.test: Use MYSQLTEST_VARDIR mysql-test/t/mysqltest.test: Use MYSQLTEST_VARDIR mysql-test/t/ndb_autodiscover.test: Use MYSQLTEST_VARDIR mysql-test/t/outfile.test: Use MYSQLTEST_VARDIR mysql-test/t/query_cache.test: Add missing drop function mysql-test/t/repair.test: Use MYSQLTEST_VARDIR mysql-test/t/rpl000001.test: Use "../std_data_ln" to find std_data files mysql-test/t/rpl000004.test: Use "../std_data_ln" to find std_data files mysql-test/t/rpl000009.test: Use MYSQLTEST_VARDIR mysql-test/t/rpl000015-slave.sh: Use MYSQLTEST_VARDIR mysql-test/t/rpl000017-slave.sh: Use MYSQLTEST_VARDIR mysql-test/t/rpl_EE_error.test: Use MYSQLTEST_VARDIR mysql-test/t/rpl_charset.test: Use MYSQLTEST_VARDIR mysql-test/t/rpl_drop_db.test: Use MYSQLTEST_VARDIR mysql-test/t/rpl_flush_log_loop-master.opt: Use MYSQLTEST_VARDIR mysql-test/t/rpl_flush_log_loop-master.sh: Use MYSQLTEST_VARDIR mysql-test/t/rpl_flush_log_loop-slave.opt: Use MYSQLTEST_VARDIR mysql-test/t/rpl_flush_log_loop-slave.sh: Use MYSQLTEST_VARDIR mysql-test/t/rpl_innodb.test: Use "../std_data_ln" to find std_data files mysql-test/t/rpl_loaddata.test: Use "../std_data_ln" to find std_data files mysql-test/t/rpl_loaddata_rule_m.test: Use "../std_data_ln" to find std_data files mysql-test/t/rpl_loaddata_rule_s.test: Use "../std_data_ln" to find std_data files mysql-test/t/rpl_loaddatalocal.test: Use MYSQLTEST_VARDIR mysql-test/t/rpl_log.test: Use "../std_data_ln" to find std_data files mysql-test/t/rpl_misc_functions-slave.sh: Use MYSQLTEST_VARDIR mysql-test/t/rpl_misc_functions.test: Use MYSQLTEST_VARDIR mysql-test/t/rpl_replicate_do.test: Use "../std_data_ln" to find std_data files mysql-test/t/rpl_rewrite_db.test: Use "../std_data_ln" to find std_data files mysql-test/t/rpl_rotate_logs-slave.sh: Use MYSQLTEST_VARDIR mysql-test/t/rpl_rotate_logs.test: Use MYSQLTEST_VARDIR mysql-test/t/rpl_timezone.test: Use MYSQLTEST_VARDIR mysql-test/t/show_check.test: Use MYSQLTEST_VARDIR mysql-test/t/sp-destruct.test: Use MYSQLTEST_VARDIR mysql-test/t/symlink.test: Use MYSQLTEST_VARDIR mysql-test/t/temp_table-master.opt: Use MYSQLTEST_VARDIR mysql-test/t/trigger-compat.test: Use MYSQLTEST_VARDIR mysql-test/t/trigger-grant.test: Use MYSQLTEST_VARDIR mysql-test/t/trigger.test: Use "../std_data_ln" to find std_data files mysql-test/t/type_varchar.test: Use MYSQLTEST_VARDIR mysql-test/t/user_var-binlog.test: Use MYSQLTEST_VARDIR mysql-test/t/view.test: Use "../std_data_ln" to find std_data files mysql-test/t/warnings.test: Use "../std_data_ln" to find std_data files mysql-test/include/sourced.inc: New BitKeeper file ``mysql-test/include/sourced.inc'' mysql-test/include/sourced1.inc: New BitKeeper file ``mysql-test/include/sourced1.inc''
238 lines
8.5 KiB
Text
238 lines
8.5 KiB
Text
drop table if exists t1, t2;
|
|
SET SQL_WARNINGS=1;
|
|
create table t1 (a int);
|
|
create table t1 (a int);
|
|
ERROR 42S01: Table 't1' already exists
|
|
show count(*) errors;
|
|
@@session.error_count
|
|
1
|
|
show errors;
|
|
Level Code Message
|
|
Error 1050 Table 't1' already exists
|
|
show warnings;
|
|
Level Code Message
|
|
Error 1050 Table 't1' already exists
|
|
create table t2(a int) default charset qwerty;
|
|
ERROR 42000: Unknown character set: 'qwerty'
|
|
show count(*) errors;
|
|
@@session.error_count
|
|
1
|
|
show errors;
|
|
Level Code Message
|
|
Error 1115 Unknown character set: 'qwerty'
|
|
create table t (i);
|
|
ERROR 42000: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
|
|
show count(*) errors;
|
|
@@session.error_count
|
|
1
|
|
show errors;
|
|
Level Code Message
|
|
Error 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ')' at line 1
|
|
insert into t1 values (1);
|
|
insert into t1 values ("hej");
|
|
Warnings:
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 1
|
|
insert into t1 values ("hej"),("då");
|
|
Warnings:
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 1
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 2
|
|
set SQL_WARNINGS=1;
|
|
insert into t1 values ("hej");
|
|
Warnings:
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 1
|
|
insert into t1 values ("hej"),("då");
|
|
Warnings:
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 1
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 2
|
|
drop table t1;
|
|
set SQL_WARNINGS=0;
|
|
drop temporary table if exists not_exists;
|
|
Warnings:
|
|
Note 1051 Unknown table 'not_exists'
|
|
drop table if exists not_exists_table;
|
|
Warnings:
|
|
Note 1051 Unknown table 'not_exists_table'
|
|
show warnings limit 1;
|
|
Level Code Message
|
|
Note 1051 Unknown table 'not_exists_table'
|
|
drop database if exists not_exists_db;
|
|
Warnings:
|
|
Note 1008 Can't drop database 'not_exists_db'; database doesn't exist
|
|
show count(*) warnings;
|
|
@@session.warning_count
|
|
1
|
|
create table t1(id int);
|
|
create table if not exists t1(id int);
|
|
Warnings:
|
|
Note 1050 Table 't1' already exists
|
|
select @@warning_count;
|
|
@@warning_count
|
|
1
|
|
drop table t1;
|
|
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 ',';
|
|
Warnings:
|
|
Warning 1263 Column set to default value; NULL supplied to NOT NULL column 'b' at row 2
|
|
Warning 1265 Data truncated for column 'd' at row 3
|
|
Warning 1265 Data truncated for column 'c' at row 4
|
|
Warning 1261 Row 5 doesn't contain data for all columns
|
|
Warning 1265 Data truncated for column 'b' at row 6
|
|
Warning 1262 Row 7 was truncated; it contained more data than there were input columns
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 8
|
|
select @@warning_count;
|
|
@@warning_count
|
|
7
|
|
drop table t1;
|
|
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');
|
|
Warnings:
|
|
Warning 1263 Column set to default value; NULL supplied to NOT NULL column 'a' at row 1
|
|
Warning 1264 Out of range value adjusted for column 'b' at row 2
|
|
Warning 1265 Data truncated for column 'c' at row 2
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 3
|
|
Warning 1264 Out of range value adjusted for column 'b' at row 3
|
|
Warning 1265 Data truncated for column 'c' at row 3
|
|
alter table t1 modify c char(4);
|
|
Warnings:
|
|
Warning 1265 Data truncated for column 'c' at row 1
|
|
Warning 1265 Data truncated for column 'c' at row 2
|
|
alter table t1 add d char(2);
|
|
update t1 set a=NULL where a=10;
|
|
Warnings:
|
|
Warning 1263 Column set to default value; NULL supplied to NOT NULL column 'a' at row 2
|
|
update t1 set c='mysql ab' where c='test';
|
|
Warnings:
|
|
Warning 1265 Data truncated for column 'c' at row 4
|
|
update t1 set d=c;
|
|
Warnings:
|
|
Warning 1265 Data truncated for column 'd' at row 1
|
|
Warning 1265 Data truncated for column 'd' at row 2
|
|
Warning 1265 Data truncated for column 'd' at row 3
|
|
Warning 1265 Data truncated for column 'd' at row 4
|
|
create table t2(a tinyint NOT NULL, b char(3));
|
|
insert into t2 select b,c from t1;
|
|
Warnings:
|
|
Warning 1265 Data truncated for column 'b' at row 1
|
|
Warning 1265 Data truncated for column 'b' at row 2
|
|
Warning 1265 Data truncated for column 'b' at row 3
|
|
Warning 1263 Column set to default value; NULL supplied to NOT NULL column 'a' at row 4
|
|
Warning 1265 Data truncated for column 'b' at row 4
|
|
insert into t2(b) values('mysqlab');
|
|
Warnings:
|
|
Warning 1364 Field 'a' doesn't have a default value
|
|
Warning 1265 Data truncated for column 'b' at row 1
|
|
set sql_warnings=1;
|
|
insert into t2(b) values('mysqlab');
|
|
Warnings:
|
|
Warning 1364 Field 'a' doesn't have a default value
|
|
Warning 1265 Data truncated for column 'b' at row 1
|
|
set sql_warnings=0;
|
|
drop table t1, t2;
|
|
create table t1(a char(10));
|
|
alter table t1 add b char;
|
|
set max_error_count=10;
|
|
update t1 set b=a;
|
|
Warnings:
|
|
Warning 1265 Data truncated for column 'b' at row 1
|
|
Warning 1265 Data truncated for column 'b' at row 2
|
|
Warning 1265 Data truncated for column 'b' at row 3
|
|
Warning 1265 Data truncated for column 'b' at row 4
|
|
Warning 1265 Data truncated for column 'b' at row 5
|
|
Warning 1265 Data truncated for column 'b' at row 6
|
|
Warning 1265 Data truncated for column 'b' at row 7
|
|
Warning 1265 Data truncated for column 'b' at row 8
|
|
Warning 1265 Data truncated for column 'b' at row 9
|
|
Warning 1265 Data truncated for column 'b' at row 10
|
|
select @@warning_count;
|
|
@@warning_count
|
|
50
|
|
set max_error_count=0;
|
|
show variables like 'max_error_count';
|
|
Variable_name Value
|
|
max_error_count 0
|
|
update t1 set b='hi';
|
|
Warnings:
|
|
select @@warning_count;
|
|
@@warning_count
|
|
50
|
|
show warnings;
|
|
Level Code Message
|
|
set max_error_count=65535;
|
|
show variables like 'max_error_count';
|
|
Variable_name Value
|
|
max_error_count 65535
|
|
set max_error_count=10;
|
|
show variables like 'max_error_count';
|
|
Variable_name Value
|
|
max_error_count 10
|
|
drop table t1;
|
|
create table t1 (id int) engine=isam;
|
|
Warnings:
|
|
Warning 1266 Using storage engine MyISAM for table 't1'
|
|
alter table t1 engine=isam;
|
|
Warnings:
|
|
Warning 1266 Using storage engine MyISAM for table 't1'
|
|
drop table t1;
|
|
create table t1 (id int) type=heap;
|
|
Warnings:
|
|
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
|
|
alter table t1 type=myisam;
|
|
Warnings:
|
|
Warning 1287 'TYPE=storage_engine' is deprecated; use 'ENGINE=storage_engine' instead
|
|
drop table t1;
|
|
set table_type=MYISAM;
|
|
Warnings:
|
|
Warning 1287 'table_type' is deprecated; use 'storage_engine' instead
|
|
create table t1 (a int);
|
|
insert into t1 (a) values (1), (2), (3), (4), (5), (6), (7), (8), (9), (10);
|
|
update t1 set a='abc';
|
|
Warnings:
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 1
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 2
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 3
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 4
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 5
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 6
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 7
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 8
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 9
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 10
|
|
show warnings limit 2, 1;
|
|
Level Code Message
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 3
|
|
show warnings limit 0, 10;
|
|
Level Code Message
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 1
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 2
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 3
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 4
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 5
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 6
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 7
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 8
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 9
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 10
|
|
show warnings limit 9, 1;
|
|
Level Code Message
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 10
|
|
show warnings limit 10, 1;
|
|
Level Code Message
|
|
show warnings limit 9, 2;
|
|
Level Code Message
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 10
|
|
show warnings limit 0, 0;
|
|
Level Code Message
|
|
show warnings limit 1;
|
|
Level Code Message
|
|
Warning 1264 Out of range value adjusted for column 'a' at row 1
|
|
show warnings limit 0;
|
|
Level Code Message
|
|
show warnings limit 1, 0;
|
|
Level Code Message
|
|
select * from t1 limit 0;
|
|
a
|
|
select * from t1 limit 1, 0;
|
|
a
|
|
select * from t1 limit 0, 0;
|
|
a
|
|
drop table t1;
|