mirror of
https://github.com/MariaDB/server.git
synced 2025-01-19 21:42:35 +01:00
004123892d
Bug#35335 funcs_1: Some tests fail within load_file during pushbuild runs Solution: 1. Move files with input data used in load_file, load data etc. from suite/funcs_1/<whatever> to std_data 2. Use for testsuite funcs_1 the server option --secure-file-priv=<MYSQLTEST_VARDIR> 3. Outfiles have to be stored under MYSQLTEST_VARDIR + changes according to WL#4304 Cleanup in funcs_1 tests - backport of fixes/improvements made in 5.1 to 5.0 The differences between scripts in 5.0 and 5.1 cause much additional and annoying work during any upmerge. - replace error numbers with names - improved comments - improved formatting - Unify storage engine names so that result files for storage engine variants do not differ (some tests) - remove a script no more used (tests are done in other scripts) BitKeeper/deleted/.del-triggers_master.test: Delete: mysql-test/suite/funcs_1/triggers/triggers_master.test mysql-test/std_data/funcs_1/innodb_tb1.txt: Rename: mysql-test/suite/funcs_1/data/innodb_tb1.txt -> mysql-test/std_data/funcs_1/innodb_tb1.txt mysql-test/std_data/funcs_1/innodb_tb2.txt: Rename: mysql-test/suite/funcs_1/data/innodb_tb2.txt -> mysql-test/std_data/funcs_1/innodb_tb2.txt mysql-test/std_data/funcs_1/innodb_tb3.txt: Rename: mysql-test/suite/funcs_1/data/innodb_tb3.txt -> mysql-test/std_data/funcs_1/innodb_tb3.txt mysql-test/std_data/funcs_1/innodb_tb4.txt: Rename: mysql-test/suite/funcs_1/data/innodb_tb4.txt -> mysql-test/std_data/funcs_1/innodb_tb4.txt mysql-test/std_data/funcs_1/memory_tb1.txt: Rename: mysql-test/suite/funcs_1/data/memory_tb1.txt -> mysql-test/std_data/funcs_1/memory_tb1.txt mysql-test/std_data/funcs_1/memory_tb2.txt: Rename: mysql-test/suite/funcs_1/data/memory_tb2.txt -> mysql-test/std_data/funcs_1/memory_tb2.txt mysql-test/std_data/funcs_1/memory_tb3.txt: Rename: mysql-test/suite/funcs_1/data/memory_tb3.txt -> mysql-test/std_data/funcs_1/memory_tb3.txt mysql-test/std_data/funcs_1/memory_tb4.txt: Rename: mysql-test/suite/funcs_1/data/memory_tb4.txt -> mysql-test/std_data/funcs_1/memory_tb4.txt mysql-test/std_data/funcs_1/myisam_tb1.txt: Rename: mysql-test/suite/funcs_1/data/myisam_tb1.txt -> mysql-test/std_data/funcs_1/myisam_tb1.txt mysql-test/std_data/funcs_1/myisam_tb2.txt: Rename: mysql-test/suite/funcs_1/data/myisam_tb2.txt -> mysql-test/std_data/funcs_1/myisam_tb2.txt mysql-test/std_data/funcs_1/myisam_tb3.txt: Rename: mysql-test/suite/funcs_1/data/myisam_tb3.txt -> mysql-test/std_data/funcs_1/myisam_tb3.txt mysql-test/std_data/funcs_1/myisam_tb4.txt: Rename: mysql-test/suite/funcs_1/data/myisam_tb4.txt -> mysql-test/std_data/funcs_1/myisam_tb4.txt mysql-test/std_data/funcs_1/t3.txt: Rename: mysql-test/suite/funcs_1/data/t3.txt -> mysql-test/std_data/funcs_1/t3.txt mysql-test/std_data/funcs_1/t4.txt: Rename: mysql-test/suite/funcs_1/data/t4.txt -> mysql-test/std_data/funcs_1/t4.txt mysql-test/std_data/funcs_1/t7.txt: Rename: mysql-test/suite/funcs_1/data/t7.txt -> mysql-test/std_data/funcs_1/t7.txt mysql-test/std_data/funcs_1/t9.txt: Rename: mysql-test/suite/funcs_1/data/t9.txt -> mysql-test/std_data/funcs_1/t9.txt mysql-test/Makefile.am: Introduce installation of funcs_1 files in std_data. mysql-test/mysql-test-run.pl: The tests within funcs_1 need a server started with --secure-file-priv=<MYSQLTEST_VARDIR> like the main regression tests. mysql-test/suite/funcs_1/README.txt: Extended description mysql-test/suite/funcs_1/datadict/datadict_bug_12777.inc: Cleanup mysql-test/suite/funcs_1/datadict/datadict_load.inc: Cleanup mysql-test/suite/funcs_1/include/innodb_tb1.inc: Adjustment to new storage place of infile. mysql-test/suite/funcs_1/include/innodb_tb2.inc: Adjustment to new storage place of infile. mysql-test/suite/funcs_1/include/innodb_tb3.inc: Adjustment to new storage place of infile. mysql-test/suite/funcs_1/include/innodb_tb4.inc: Adjustment to new storage place of infile. mysql-test/suite/funcs_1/include/memory_tb1.inc: Adjustment to new storage place of infile. mysql-test/suite/funcs_1/include/memory_tb2.inc: Adjustment to new storage place of infile. mysql-test/suite/funcs_1/include/memory_tb3.inc: Adjustment to new storage place of infile. mysql-test/suite/funcs_1/include/memory_tb4.inc: Adjustment to new storage place of infile. mysql-test/suite/funcs_1/include/myisam_tb1.inc: Adjustment to new storage place of infile. mysql-test/suite/funcs_1/include/myisam_tb2.inc: Adjustment to new storage place of infile. mysql-test/suite/funcs_1/include/myisam_tb3.inc: Adjustment to new storage place of infile. mysql-test/suite/funcs_1/include/myisam_tb4.inc: Adjustment to new storage place of infile. mysql-test/suite/funcs_1/include/sp_tb.inc: Adjustment to new storage place of infile. mysql-test/suite/funcs_1/r/innodb_func_view.result: Updated results mysql-test/suite/funcs_1/r/innodb_storedproc_02.result: Updated results mysql-test/suite/funcs_1/r/innodb_storedproc_03.result: Updated results mysql-test/suite/funcs_1/r/innodb_storedproc_06.result: Updated results mysql-test/suite/funcs_1/r/innodb_storedproc_07.result: Updated results mysql-test/suite/funcs_1/r/innodb_storedproc_08.result: Updated results mysql-test/suite/funcs_1/r/innodb_storedproc_10.result: Updated results mysql-test/suite/funcs_1/r/innodb_trig_0102.result: Updated results mysql-test/suite/funcs_1/r/innodb_trig_03.result: Updated results mysql-test/suite/funcs_1/r/innodb_trig_0407.result: Updated results mysql-test/suite/funcs_1/r/innodb_trig_08.result: Updated results mysql-test/suite/funcs_1/r/innodb_trig_09.result: Updated results mysql-test/suite/funcs_1/r/innodb_trig_1011ext.result: Updated results mysql-test/suite/funcs_1/r/innodb_trig_frkey.result: Updated results mysql-test/suite/funcs_1/r/innodb_views.result: Updated results mysql-test/suite/funcs_1/r/is_columns_innodb.result: Updated results mysql-test/suite/funcs_1/r/is_columns_memory.result: Updated results mysql-test/suite/funcs_1/r/is_columns_myisam.result: Updated results mysql-test/suite/funcs_1/r/is_columns_ndb.result: Updated results mysql-test/suite/funcs_1/r/is_tables_innodb.result: Updated results mysql-test/suite/funcs_1/r/is_tables_memory.result: Updated results mysql-test/suite/funcs_1/r/is_tables_myisam.result: Updated results mysql-test/suite/funcs_1/r/is_tables_ndb.result: Updated results mysql-test/suite/funcs_1/r/memory_func_view.result: Updated results mysql-test/suite/funcs_1/r/memory_storedproc_02.result: Updated results mysql-test/suite/funcs_1/r/memory_storedproc_03.result: Updated results mysql-test/suite/funcs_1/r/memory_storedproc_06.result: Updated results mysql-test/suite/funcs_1/r/memory_storedproc_07.result: Updated results mysql-test/suite/funcs_1/r/memory_storedproc_08.result: Updated results mysql-test/suite/funcs_1/r/memory_storedproc_10.result: Updated results mysql-test/suite/funcs_1/r/memory_trig_0102.result: Updated results mysql-test/suite/funcs_1/r/memory_trig_03.result: Updated results mysql-test/suite/funcs_1/r/memory_trig_0407.result: Updated results mysql-test/suite/funcs_1/r/memory_trig_08.result: Updated results mysql-test/suite/funcs_1/r/memory_trig_09.result: Updated results mysql-test/suite/funcs_1/r/memory_trig_1011ext.result: Updated results mysql-test/suite/funcs_1/r/memory_views.result: Updated results mysql-test/suite/funcs_1/r/myisam_func_view.result: Updated results mysql-test/suite/funcs_1/r/myisam_storedproc_02.result: Updated results mysql-test/suite/funcs_1/r/myisam_storedproc_03.result: Updated results mysql-test/suite/funcs_1/r/myisam_storedproc_06.result: Updated results mysql-test/suite/funcs_1/r/myisam_storedproc_07.result: Updated results mysql-test/suite/funcs_1/r/myisam_storedproc_08.result: Updated results mysql-test/suite/funcs_1/r/myisam_storedproc_10.result: Updated results mysql-test/suite/funcs_1/r/myisam_trig_0102.result: Updated results mysql-test/suite/funcs_1/r/myisam_trig_03.result: Updated results mysql-test/suite/funcs_1/r/myisam_trig_0407.result: Updated results mysql-test/suite/funcs_1/r/myisam_trig_08.result: Updated results mysql-test/suite/funcs_1/r/myisam_trig_09.result: Updated results mysql-test/suite/funcs_1/r/myisam_trig_1011ext.result: Updated results mysql-test/suite/funcs_1/r/myisam_views.result: Updated results mysql-test/suite/funcs_1/storedproc/cleanup_sp_tb.inc: "--echo" instead of SQL command. mysql-test/suite/funcs_1/storedproc/load_sp_tb.inc: Adjustment to new storage place of infile + correct formatting. mysql-test/suite/funcs_1/storedproc/storedproc_02.inc: Backport from 5.1 + correct formatting. mysql-test/suite/funcs_1/storedproc/storedproc_03.inc: Minor improvements + correct formatting. mysql-test/suite/funcs_1/storedproc/storedproc_06.inc: Backport from 5.1 + correct formatting mysql-test/suite/funcs_1/storedproc/storedproc_10.inc: Backport from 5.1. + correct formatting mysql-test/suite/funcs_1/t/innodb_trig_0407.test: Cleanup mysql-test/suite/funcs_1/t/is_basics_mixed.test: Adjustment to new storage place of outfile. mysql-test/suite/funcs_1/t/memory_storedproc_02.test: Cleanup mysql-test/suite/funcs_1/t/memory_storedproc_03.test: Cleanup mysql-test/suite/funcs_1/t/memory_storedproc_06.test: Cleanup mysql-test/suite/funcs_1/t/memory_storedproc_07.test: Cleanup mysql-test/suite/funcs_1/t/memory_storedproc_08.test: Cleanup mysql-test/suite/funcs_1/t/memory_storedproc_10.test: Cleanup mysql-test/suite/funcs_1/t/myisam_storedproc_02.test: Cleanup mysql-test/suite/funcs_1/t/myisam_storedproc_03.test: Cleanup mysql-test/suite/funcs_1/t/myisam_storedproc_06.test: Cleanup mysql-test/suite/funcs_1/t/myisam_storedproc_07.test: Cleanup mysql-test/suite/funcs_1/t/myisam_storedproc_08.test: Cleanup mysql-test/suite/funcs_1/t/myisam_storedproc_10.test: Cleanup mysql-test/suite/funcs_1/triggers/trig_frkey2.inc: Cleanup mysql-test/suite/funcs_1/triggers/triggers_0102.inc: Cleanup mysql-test/suite/funcs_1/triggers/triggers_03.inc: Backport from 5.1 mysql-test/suite/funcs_1/triggers/triggers_0407.inc: Backport from 5.1 mysql-test/suite/funcs_1/triggers/triggers_08.inc: Backport from 5.1 mysql-test/suite/funcs_1/triggers/triggers_09.inc: Backport from 5.1 mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc: Backport from 5.1 mysql-test/suite/funcs_1/views/func_view.inc: Backport from 5.1 mysql-test/suite/funcs_1/views/views_master.inc: Cleanup mysql-test/std_data/funcs_1/load_file.txt: New BitKeeper file ``mysql-test/std_data/funcs_1/load_file.txt''
481 lines
16 KiB
Text
481 lines
16 KiB
Text
USE test;
|
|
drop table if exists tb3 ;
|
|
create table tb3 (
|
|
f118 char not null DEFAULT 'a',
|
|
f119 char binary not null DEFAULT b'101',
|
|
f120 char ascii not null DEFAULT b'101',
|
|
f121 tinytext,
|
|
f122 text,
|
|
f123 mediumtext,
|
|
f124 longtext unicode,
|
|
f125 tinyblob,
|
|
f126 blob,
|
|
f127 mediumblob,
|
|
f128 longblob,
|
|
f129 binary not null DEFAULT b'101',
|
|
f130 tinyint not null DEFAULT 99,
|
|
f131 tinyint unsigned not null DEFAULT 99,
|
|
f132 tinyint zerofill not null DEFAULT 99,
|
|
f133 tinyint unsigned zerofill not null DEFAULT 99,
|
|
f134 smallint not null DEFAULT 999,
|
|
f135 smallint unsigned not null DEFAULT 999,
|
|
f136 smallint zerofill not null DEFAULT 999,
|
|
f137 smallint unsigned zerofill not null DEFAULT 999,
|
|
f138 mediumint not null DEFAULT 9999,
|
|
f139 mediumint unsigned not null DEFAULT 9999,
|
|
f140 mediumint zerofill not null DEFAULT 9999,
|
|
f141 mediumint unsigned zerofill not null DEFAULT 9999,
|
|
f142 int not null DEFAULT 99999,
|
|
f143 int unsigned not null DEFAULT 99999,
|
|
f144 int zerofill not null DEFAULT 99999,
|
|
f145 int unsigned zerofill not null DEFAULT 99999,
|
|
f146 bigint not null DEFAULT 999999,
|
|
f147 bigint unsigned not null DEFAULT 999999,
|
|
f148 bigint zerofill not null DEFAULT 999999,
|
|
f149 bigint unsigned zerofill not null DEFAULT 999999,
|
|
f150 decimal not null DEFAULT 999.999,
|
|
f151 decimal unsigned not null DEFAULT 999.17,
|
|
f152 decimal zerofill not null DEFAULT 999.999,
|
|
f153 decimal unsigned zerofill,
|
|
f154 decimal (0),
|
|
f155 decimal (64),
|
|
f156 decimal (0) unsigned,
|
|
f157 decimal (64) unsigned,
|
|
f158 decimal (0) zerofill,
|
|
f159 decimal (64) zerofill,
|
|
f160 decimal (0) unsigned zerofill,
|
|
f161 decimal (64) unsigned zerofill,
|
|
f162 decimal (0,0),
|
|
f163 decimal (63,30),
|
|
f164 decimal (0,0) unsigned,
|
|
f165 decimal (63,30) unsigned,
|
|
f166 decimal (0,0) zerofill,
|
|
f167 decimal (63,30) zerofill,
|
|
f168 decimal (0,0) unsigned zerofill,
|
|
f169 decimal (63,30) unsigned zerofill,
|
|
f170 numeric,
|
|
f171 numeric unsigned,
|
|
f172 numeric zerofill,
|
|
f173 numeric unsigned zerofill,
|
|
f174 numeric (0),
|
|
f175 numeric (64)
|
|
) Engine = myisam;
|
|
Warnings:
|
|
Note 1265 Data truncated for column 'f150' at row 1
|
|
Note 1265 Data truncated for column 'f151' at row 1
|
|
Note 1265 Data truncated for column 'f152' at row 1
|
|
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb3.txt'
|
|
into table tb3;
|
|
|
|
Testcase: 3.5:
|
|
--------------
|
|
create User test_general@localhost;
|
|
set password for test_general@localhost = password('PWD');
|
|
revoke ALL PRIVILEGES, GRANT OPTION FROM test_general@localhost;
|
|
create User test_super@localhost;
|
|
set password for test_super@localhost = password('PWD');
|
|
grant ALL on *.* to test_super@localhost with grant OPTION;
|
|
connect(localhost,test_general,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
|
connect(localhost,test_super,PWD,test,MASTER_MYPORT,MASTER_MYSOCK);
|
|
|
|
Testcase 3.5.4:
|
|
---------------
|
|
use test;
|
|
|
|
Testcase 3.5.4.1:
|
|
-----------------
|
|
create database db_drop;
|
|
Use db_drop;
|
|
create table t1 (f1 char(30)) engine=myisam;
|
|
grant INSERT, SELECT on db_drop.t1 to test_general;
|
|
Use db_drop;
|
|
Create trigger trg1 BEFORE INSERT on t1
|
|
for each row set new.f1='Trigger 3.5.4.1';
|
|
Use db_drop;
|
|
Insert into t1 values ('Insert error 3.5.4.1');
|
|
Select * from t1 order by f1;
|
|
f1
|
|
Trigger 3.5.4.1
|
|
drop trigger trg1;
|
|
select trigger_schema, trigger_name, event_object_table
|
|
from information_schema.triggers order by trigger_name;
|
|
trigger_schema trigger_name event_object_table
|
|
Insert into t1 values ('Insert no trigger 3.5.4.1');
|
|
Select * from t1 order by f1;
|
|
f1
|
|
Insert no trigger 3.5.4.1
|
|
Trigger 3.5.4.1
|
|
drop trigger trg1;
|
|
drop database if exists db_drop;
|
|
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
|
|
|
|
Testcase 3.5.4.2:
|
|
-----------------
|
|
create database db_drop2;
|
|
Use db_drop2;
|
|
drop table if exists t1_432 ;
|
|
create table t1_432 (f1 char (30)) engine=myisam;
|
|
Drop trigger tr_does_not_exit;
|
|
ERROR HY000: Trigger does not exist
|
|
drop table if exists t1_432 ;
|
|
drop database if exists db_drop2;
|
|
|
|
Testcase 3.5.4.3:
|
|
-----------------
|
|
create database db_drop3;
|
|
Use db_drop3;
|
|
drop table if exists t1_433 ;
|
|
drop table if exists t1_433a ;
|
|
create table t1_433 (f1 char (30)) engine=myisam;
|
|
create table t1_433a (f1a char (5)) engine=myisam;
|
|
CREATE TRIGGER trg3 BEFORE INSERT on t1_433 for each row
|
|
set new.f1 = 'Trigger 3.5.4.3';
|
|
Drop trigger t1.433.trg3;
|
|
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 '.trg3' at line 1
|
|
Drop trigger db_drop3.t1.433.trg3;
|
|
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 '.433.trg3' at line 1
|
|
Drop trigger mysql.trg3;
|
|
ERROR HY000: Trigger does not exist
|
|
Drop trigger tbx.trg3;
|
|
ERROR HY000: Trigger does not exist
|
|
Drop trigger db_drop3.trg3;
|
|
drop table if exists t1_433;
|
|
drop table if exists t1_433a;
|
|
drop database if exists db_drop3;
|
|
|
|
Testcase 3.5.4.4:
|
|
-----------------
|
|
create database db_drop4;
|
|
Use db_drop4;
|
|
create table t1 (f1 char(30)) engine=myisam;
|
|
grant INSERT, SELECT on db_drop4.t1 to test_general;
|
|
Create trigger trg4 BEFORE INSERT on t1
|
|
for each row set new.f1='Trigger 3.5.4.4';
|
|
Use db_drop4;
|
|
Insert into t1 values ('Insert 3.5.4.4');
|
|
Select * from t1;
|
|
f1
|
|
Trigger 3.5.4.4
|
|
Drop database db_drop4;
|
|
Show databases;
|
|
Database
|
|
information_schema
|
|
mysql
|
|
test
|
|
select trigger_schema, trigger_name, event_object_table
|
|
from information_schema.triggers
|
|
where information_schema.triggers.trigger_name='trg4';
|
|
trigger_schema trigger_name event_object_table
|
|
create database db_drop4;
|
|
Use db_drop4;
|
|
create table t1 (f1 char(30)) engine=myisam;
|
|
grant INSERT, SELECT on db_drop4.t1 to test_general;
|
|
Insert into t1 values ('2nd Insert 3.5.4.4');
|
|
Select * from t1;
|
|
f1
|
|
2nd Insert 3.5.4.4
|
|
drop trigger trg4;
|
|
ERROR HY000: Trigger does not exist
|
|
drop database if exists db_drop4;
|
|
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
|
|
|
|
Testcase 3.5.4.5:
|
|
-----------------
|
|
create database db_drop5;
|
|
Use db_drop5;
|
|
create table t1 (f1 char(50)) engine=myisam;
|
|
grant INSERT, SELECT on t1 to test_general;
|
|
Create trigger trg5 BEFORE INSERT on t1
|
|
for each row set new.f1='Trigger 3.5.4.5';
|
|
Use db_drop5;
|
|
Insert into t1 values ('Insert 3.5.4.5');
|
|
Select * from t1;
|
|
f1
|
|
Trigger 3.5.4.5
|
|
Drop table t1;
|
|
Show tables;
|
|
Tables_in_db_drop5
|
|
select trigger_schema, trigger_name, event_object_table
|
|
from information_schema.triggers
|
|
where information_schema.triggers.trigger_name='trg5';
|
|
trigger_schema trigger_name event_object_table
|
|
create table t1 (f1 char(50)) engine=myisam;
|
|
grant INSERT, SELECT on t1 to test_general;
|
|
Insert into t1 values ('2nd Insert 3.5.4.5');
|
|
Select * from t1;
|
|
f1
|
|
2nd Insert 3.5.4.5
|
|
drop trigger trg5;
|
|
ERROR HY000: Trigger does not exist
|
|
drop database if exists db_drop5;
|
|
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
|
|
|
|
Testcase 3.5.5:
|
|
---------------
|
|
use test;
|
|
|
|
Testcase 3.5.5.1:
|
|
-----------------
|
|
Create trigger trg1 before INSERT on t100 for each row set new.f2=1000;
|
|
ERROR 42S02: Table 'test.t100' doesn't exist
|
|
|
|
Testcase 3.5.5.2:
|
|
-----------------
|
|
Create temporary table t1_temp (f1 bigint signed, f2 bigint unsigned);
|
|
Create trigger trg2 before INSERT
|
|
on t1_temp for each row set new.f2=9999;
|
|
ERROR HY000: Trigger's 't1_temp' is view or temporary table
|
|
drop table t1_temp;
|
|
|
|
Testcase 3.5.5.3:
|
|
-----------------
|
|
Create view vw3 as select f118 from tb3;
|
|
Create trigger trg3 before INSERT
|
|
on vw3 for each row set new.f118='s';
|
|
ERROR HY000: 'test.vw3' is not BASE TABLE
|
|
drop view vw3;
|
|
|
|
Testcase 3.5.5.4:
|
|
-----------------
|
|
create database dbtest_one;
|
|
create database dbtest_two;
|
|
use dbtest_two;
|
|
create table t2 (f1 char(15)) engine=myisam;
|
|
use dbtest_one;
|
|
create trigger trg4 before INSERT
|
|
on dbtest_two.t2 for each row set new.f1='trig 3.5.5.4';
|
|
ERROR HY000: Trigger in wrong schema
|
|
grant INSERT, SELECT on dbtest_two.t2 to test_general;
|
|
grant SELECT on dbtest_one.* to test_general;
|
|
use dbtest_two;
|
|
Insert into t2 values ('1st Insert 3.5.5.4');
|
|
Warnings:
|
|
Warning 1265 Data truncated for column 'f1' at row 1
|
|
Select * from t2;
|
|
f1
|
|
1st Insert 3.5.
|
|
use dbtest_one;
|
|
Insert into dbtest_two.t2 values ('2nd Insert 3.5.5.4');
|
|
Warnings:
|
|
Warning 1265 Data truncated for column 'f1' at row 1
|
|
Select * from dbtest_two.t2 order by f1;
|
|
f1
|
|
1st Insert 3.5.
|
|
2nd Insert 3.5.
|
|
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
|
|
DROP DATABASE if exists dbtest_one;
|
|
drop database if EXISTS dbtest_two;
|
|
|
|
Testcase 3.5.6:
|
|
---------------
|
|
use test;
|
|
|
|
Testcase 3.5.6.1 (see Testcase 3.5.1.1)
|
|
---------------------------------------
|
|
|
|
Testcase 3.5.6.2 (see Testcase 3.5.1.1)
|
|
---------------------------------------
|
|
|
|
Testcase 3.5.6.3:
|
|
-----------------
|
|
Create trigger trg3_1 DURING UPDATE on tb3 for each row set new.f132=25;
|
|
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 'DURING UPDATE on tb3 for each row set new.f132=25' at line 1
|
|
Create trigger trg3_2 TIME INSERT on tb3 for each row set new.f132=15;
|
|
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 'TIME INSERT on tb3 for each row set new.f132=15' at line 1
|
|
drop trigger tb3.trg3_1;
|
|
drop trigger tb3.trg3_2;
|
|
|
|
Testcase 3.5.6.4 (see Testcase 3.5.1.1)
|
|
---------------------------------------
|
|
|
|
Testcase 3.5.6.5 (see Testcase 3.5.1.1)
|
|
---------------------------------------
|
|
|
|
Testcase 3.5.7.1 (see Testcase 3.5.1.1)
|
|
---------------------------------------
|
|
|
|
Testcase 3.5.7.2 (see Testcase 3.5.1.1)
|
|
---------------------------------------
|
|
|
|
Testcase 3.5.7.3 (see Testcase 3.5.1.1)
|
|
---------------------------------------
|
|
|
|
Testcase 3.5.7.4:
|
|
-----------------
|
|
Create trigger trg4_1 BEFORE SELECT on tb3 for each row set new.f132=5;
|
|
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 'SELECT on tb3 for each row set new.f132=5' at line 1
|
|
Create trigger trg4_2 AFTER VALUE on tb3 for each row set new.f132=1;
|
|
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 'VALUE on tb3 for each row set new.f132=1' at line 1
|
|
drop trigger tb3.trg4_1;
|
|
drop trigger tb3.trg4_2;
|
|
|
|
Testcase 3.5.7.5 / 3.5.7.6:
|
|
---------------------------
|
|
Create trigger trg5_1 BEFORE INSERT
|
|
on tb3 for each row set new.f122='Trigger1 3.5.7.5/6';
|
|
Create trigger trg5_2 BEFORE INSERT
|
|
on tb3 for each row set new.f122='Trigger2 3.5.7.5';
|
|
ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
|
|
Insert into tb3 (f121,f122) values ('Test 3.5.7.5/6','Insert 3.5.7.5');
|
|
Select f121,f122 from tb3 where f121='Test 3.5.7.5/6';
|
|
f121 f122
|
|
Test 3.5.7.5/6 Trigger1 3.5.7.5/6
|
|
update tb3 set f122='Update 3.5.7.6' where f121= 'Test 3.5.7.5/6';
|
|
Select f121,f122 from tb3 where f121='Test 3.5.7.5/6';
|
|
f121 f122
|
|
Test 3.5.7.5/6 Update 3.5.7.6
|
|
drop trigger trg5_1;
|
|
drop trigger trg5_2;
|
|
delete from tb3 where f121='Test 3.5.7.5/6';
|
|
|
|
Testcase 3.5.7.7 / 3.5.7.8:
|
|
---------------------------
|
|
set @test_var='Before trig 3.5.7.7';
|
|
Create trigger trg6_1 AFTER INSERT
|
|
on tb3 for each row set @test_var='Trigger1 3.5.7.7/8';
|
|
Create trigger trg6_2 AFTER INSERT
|
|
on tb3 for each row set @test_var='Trigger2 3.5.7.7';
|
|
ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
|
|
select @test_var;
|
|
@test_var
|
|
Before trig 3.5.7.7
|
|
Insert into tb3 (f121,f122) values ('Test 3.5.7.7/8','Insert 3.5.7.7');
|
|
Select f121,f122 from tb3 where f121='Test 3.5.7.7/8';
|
|
f121 f122
|
|
Test 3.5.7.7/8 Insert 3.5.7.7
|
|
select @test_var;
|
|
@test_var
|
|
Trigger1 3.5.7.7/8
|
|
update tb3 set f122='Update 3.5.7.8' where f121= 'Test 3.5.7.7/8';
|
|
Select f121,f122 from tb3 where f121='Test 3.5.7.7/8';
|
|
f121 f122
|
|
Test 3.5.7.7/8 Update 3.5.7.8
|
|
select @test_var;
|
|
@test_var
|
|
Trigger1 3.5.7.7/8
|
|
drop trigger trg6_1;
|
|
drop trigger trg6_2;
|
|
delete from tb3 where f121='Test 3.5.7.7/8';
|
|
|
|
Testcase 3.5.7.9/10:
|
|
--------------------
|
|
Create trigger trg7_1 BEFORE UPDATE
|
|
on tb3 for each row set new.f122='Trigger1 3.5.7.9/10';
|
|
Create trigger trg7_2 BEFORE UPDATE
|
|
on tb3 for each row set new.f122='Trigger2 3.5.7.9';
|
|
ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
|
|
Insert into tb3 (f121,f122) values ('Test 3.5.7.9/10','Insert 3.5.7.9');
|
|
Select f121,f122 from tb3 where f121='Test 3.5.7.9/10';
|
|
f121 f122
|
|
Test 3.5.7.9/10 Insert 3.5.7.9
|
|
update tb3 set f122='update 3.5.7.10' where f121='Test 3.5.7.9/10';
|
|
Select f121,f122 from tb3 where f121='Test 3.5.7.9/10';
|
|
f121 f122
|
|
Test 3.5.7.9/10 Trigger1 3.5.7.9/10
|
|
drop trigger trg7_1;
|
|
drop trigger trg7_2;
|
|
delete from tb3 where f121='Test 3.5.7.9/10';
|
|
|
|
Testcase 3.5.7.11/12:
|
|
---------------------
|
|
set @test_var='Before trig 3.5.7.11';
|
|
Create trigger trg8_1 AFTER UPDATE
|
|
on tb3 for each row set @test_var='Trigger 3.5.7.11/12';
|
|
Create trigger trg8_2 AFTER UPDATE
|
|
on tb3 for each row set @test_var='Trigger2 3.5.7.11';
|
|
ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
|
|
select @test_var;
|
|
@test_var
|
|
Before trig 3.5.7.11
|
|
Insert into tb3 (f121,f122) values ('Test 3.5.7.11/12','Insert 3.5.7.11/12');
|
|
select @test_var;
|
|
@test_var
|
|
Before trig 3.5.7.11
|
|
Select f121,f122 from tb3 where f121='Test 3.5.7.11/12';
|
|
f121 f122
|
|
Test 3.5.7.11/12 Insert 3.5.7.11/12
|
|
update tb3 set f122='update 3.5.7.12' where f121='Test 3.5.7.11/12';
|
|
Select f121,f122 from tb3 where f121='Test 3.5.7.11/12';
|
|
f121 f122
|
|
Test 3.5.7.11/12 update 3.5.7.12
|
|
select @test_var;
|
|
@test_var
|
|
Trigger 3.5.7.11/12
|
|
delete from tb3 where f121='Test 3.5.7.11/12';
|
|
drop trigger trg8_1;
|
|
drop trigger trg8_2;
|
|
delete from tb3 where f121='Test 3.5.7.11/12';
|
|
|
|
Testcase 3.5.7.13/14:
|
|
---------------------
|
|
set @test_var=1;
|
|
Create trigger trg9_1 BEFORE DELETE
|
|
on tb3 for each row set @test_var=@test_var+1;
|
|
Create trigger trg9_2 BEFORE DELETE
|
|
on tb3 for each row set @test_var=@test_var+10;
|
|
ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
|
|
select @test_var;
|
|
@test_var
|
|
1
|
|
Insert into tb3 (f121,f122) values ('Test 3.5.7.13/14','Insert 3.5.7.13');
|
|
Select f121,f122 from tb3 where f121='Test 3.5.7.13/14';
|
|
f121 f122
|
|
Test 3.5.7.13/14 Insert 3.5.7.13
|
|
select @test_var;
|
|
@test_var
|
|
1
|
|
delete from tb3 where f121='Test 3.5.7.13/14';
|
|
Select f121,f122 from tb3 where f121='Test 3.5.7.13/14';
|
|
f121 f122
|
|
select @test_var;
|
|
@test_var
|
|
2
|
|
delete from tb3 where f121='Test 3.5.7.13/14';
|
|
select @test_var;
|
|
@test_var
|
|
2
|
|
drop trigger trg9_1;
|
|
drop trigger trg9_2;
|
|
delete from tb3 where f121='Test 3.5.7.13/14';
|
|
|
|
Testcase 3.5.7.15/16:
|
|
---------------------
|
|
set @test_var=1;
|
|
Create trigger trg_3_406010_1 AFTER DELETE
|
|
on tb3 for each row set @test_var=@test_var+5;
|
|
Create trigger trg_3_406010_2 AFTER DELETE
|
|
on tb3 for each row set @test_var=@test_var+50;
|
|
ERROR 42000: This version of MySQL doesn't yet support 'multiple triggers with the same action time and event for one table'
|
|
Create trigger trg_3_406010_1 AFTER INSERT
|
|
on tb3 for each row set @test_var=@test_var+1;
|
|
ERROR HY000: Trigger already exists
|
|
select @test_var;
|
|
@test_var
|
|
1
|
|
Insert into tb3 (f121,f122) values ('Test 3.5.7.15/16','Insert 3.5.7.15/16');
|
|
Select f121,f122 from tb3 where f121='Test 3.5.7.15/16';
|
|
f121 f122
|
|
Test 3.5.7.15/16 Insert 3.5.7.15/16
|
|
select @test_var;
|
|
@test_var
|
|
1
|
|
delete from tb3 where f121='Test 3.5.7.15/16';
|
|
Select f121,f122 from tb3 where f121='Test 3.5.7.15/16';
|
|
f121 f122
|
|
select @test_var;
|
|
@test_var
|
|
6
|
|
delete from tb3 where f121='Test 3.5.7.15/16';
|
|
select @test_var;
|
|
@test_var
|
|
6
|
|
drop trigger trg_3_406010_1;
|
|
drop trigger trg_3_406010_2;
|
|
delete from tb3 where f121='Test 3.5.7.15/16';
|
|
|
|
Testcase 3.5.7.17 (see Testcase 3.5.1.1)
|
|
----------------------------------------
|
|
drop user test_general@localhost;
|
|
drop user test_general;
|
|
drop user test_super@localhost;
|
|
DROP TABLE test.tb3;
|