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)
This commit is contained in:
mleich@five.local.lan 2008-03-31 19:48:02 +02:00
parent dc00a52464
commit 89ddc0aa52
116 changed files with 9138 additions and 10742 deletions

View File

@ -45,7 +45,8 @@ dist-hook:
mkdir -p $(distdir)/t $(distdir)/r $(distdir)/include \
$(distdir)/std_data \
$(distdir)/std_data/ndb_backup50_data_be $(distdir)/std_data/ndb_backup50_data_le \
$(distdir)/lib
$(distdir)/lib \
$(distdir)/funcs_1
-$(INSTALL_DATA) $(srcdir)/t/*.def $(distdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.test $(distdir)/t
-$(INSTALL_DATA) $(srcdir)/t/*.imtest $(distdir)/t
@ -66,6 +67,7 @@ dist-hook:
$(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(distdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50_data_be/BACKUP* $(distdir)/std_data/ndb_backup50_data_be
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50_data_le/BACKUP* $(distdir)/std_data/ndb_backup50_data_le
$(INSTALL_DATA) $(srcdir)/std_data/funcs_1/* $(distdir)/std_data/funcs_1
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(distdir)/lib
-rm -rf `find $(distdir)/suite -type d -name SCCS`
@ -77,7 +79,8 @@ install-data-local:
$(DESTDIR)$(testdir)/std_data \
$(DESTDIR)$(testdir)/std_data/ndb_backup50_data_be \
$(DESTDIR)$(testdir)/std_data/ndb_backup50_data_le \
$(DESTDIR)$(testdir)/lib
$(DESTDIR)$(testdir)/lib \
$(DESTDIR)$(testdir)/funcs_1
$(INSTALL_DATA) $(srcdir)/README $(DESTDIR)$(testdir)
-$(INSTALL_DATA) $(srcdir)/t/*.def $(DESTDIR)$(testdir)/t
$(INSTALL_DATA) $(srcdir)/t/*.test $(DESTDIR)$(testdir)/t
@ -103,6 +106,7 @@ install-data-local:
$(INSTALL_DATA) $(srcdir)/std_data/*.cnf $(DESTDIR)$(testdir)/std_data
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50_data_be/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup50_data_be
$(INSTALL_DATA) $(srcdir)/std_data/ndb_backup50_data_le/BACKUP* $(DESTDIR)$(testdir)/std_data/ndb_backup50_data_le
$(INSTALL_DATA) $(srcdir)/std_data/funcs_1/* $(distdir)/std_data/funcs_1
$(INSTALL_DATA) $(srcdir)/lib/*.pl $(DESTDIR)$(testdir)/lib
for f in `(cd $(srcdir); find suite -type f | grep -v SCCS)`; \
do \

View File

@ -3739,9 +3739,9 @@ sub mysqld_arguments ($$$$) {
{
# By default, prevent the started mysqld to access files outside of vardir
my $secure_file_dir= $opt_vardir;
if ( $opt_suite ne "main" )
if ( $opt_suite ne "main" and $opt_suite ne "funcs_1" )
{
# When running a suite other than default allow the mysqld
# When running a suite other than default or funcs_1 allow the mysqld
# access to subdirs of mysql-test/ in order to make it possible
# to "load data" from the suites data/ directory.
$secure_file_dir= $glob_mysql_test_dir;

View File

@ -0,0 +1 @@
Here is content from load_file

View File

@ -25,7 +25,7 @@
SESSION_STATUS
SESSION_VARIABLES
3. Some hints:
3. Some hints for maintainers of this suite:
- SHOW TABLES ... LIKE '<pattern>'
does a case sensitive comparison between the tablename and
the pattern.
@ -43,4 +43,12 @@
ERROR 42000: Access denied for user ... to database 'information_schema'
DROP DATABASE INFORMATION_SCHEMA;
ERROR 42000: Access denied for user ... to database 'INFORMATION_SCHEMA'
- Try to unify results by
--replace_result $engine_type <engine_to_be_tested>
if we could expect that the results for storage engine variants of a
test differ only in the engine names.
This makes future maintenance easier.
- Avoid the use of include/show_msg*.inc.
They produce "SQL" noise which annoys during server debugging and can be
easy replaced by "--echo ...".

View File

@ -64,6 +64,7 @@ f57 numeric (0) not null DEFAULT 99,
f58 numeric (64) not null DEFAULT 99
) engine = innodb;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb1.txt' into table tb1 ;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/innodb_tb1.txt'
into table tb1;

View File

@ -57,5 +57,7 @@ f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = innodb;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb2.txt' into table tb2 ;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/innodb_tb2.txt'
into table tb2;

View File

@ -64,5 +64,7 @@ f174 numeric (0),
f175 numeric (64)
) engine = innodb;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb3.txt' into table tb3 ;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/innodb_tb3.txt'
into table tb3;

View File

@ -64,5 +64,7 @@ f240 varchar(2000) unicode,
f241 char(100) unicode
) engine = innodb;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb4.txt' into table tb4 ;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/innodb_tb4.txt'
into table tb4;

View File

@ -56,5 +56,7 @@ f57 numeric (0) not null DEFAULT 99,
f58 numeric (64) not null DEFAULT 99
) engine = memory;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb1.txt' into table tb1 ;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb1.txt'
into table tb1;

View File

@ -57,5 +57,7 @@ f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = memory;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb2.txt' into table tb2 ;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb2.txt'
into table tb2 ;

View File

@ -58,6 +58,7 @@ f174 numeric (0),
f175 numeric (64)
) engine = memory;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb3.txt' into table tb3 ;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;

View File

@ -63,5 +63,7 @@ f239 varbinary(0),
f240 varchar(1200) unicode
) engine = memory;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb4.txt' into table tb4 ;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/memory_tb4.txt'
into table tb4;

View File

@ -64,5 +64,7 @@ f57 numeric (0) not null DEFAULT 99,
f58 numeric (64) not null DEFAULT 99
) engine = myisam;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb1.txt' into table tb1 ;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/myisam_tb1.txt'
into table tb1;

View File

@ -76,5 +76,7 @@ f117 VARBINARY(192) null
# f116 multilinestring null,
# f117 multipolygon null
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb2.txt' into table tb2 ;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/myisam_tb2.txt'
into table tb2;

View File

@ -64,5 +64,7 @@ f174 numeric (0),
f175 numeric (64)
) Engine = myisam;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb3.txt' into table tb3 ;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/myisam_tb3.txt'
into table tb3;

View File

@ -84,5 +84,7 @@ f242 bit(30)
# f233 multilinestring,
# f234 multipolygon,
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb4.txt' into table tb4 ;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/myisam_tb4.txt'
into table tb4;

View File

@ -5,29 +5,46 @@ USE test;
--disable_warnings
DROP TABLE IF EXISTS t1, t2, t4, t10, t11;
--enable_warnings
eval CREATE TABLE t1 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = $engine_type;
eval CREATE TABLE t2 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = $engine_type;
eval CREATE TABLE t4 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = $engine_type;
eval CREATE TABLE t10 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = $engine_type;
eval CREATE TABLE t11 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = $engine_type;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval LOAD DATA INFILE '$MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t1;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval LOAD DATA INFILE '$MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t2;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval LOAD DATA INFILE '$MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t4;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval LOAD DATA INFILE '$MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t10;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval LOAD DATA INFILE '$MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t11;
eval
CREATE TABLE t1 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = $engine_type;
eval
CREATE TABLE t2 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = $engine_type;
eval
CREATE TABLE t4 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = $engine_type;
eval
CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = $engine_type;
eval
CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' INTO TABLE t1;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' INTO TABLE t2;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' INTO TABLE t4;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' INTO TABLE t10;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' INTO TABLE t11;
--disable_warnings
drop TABLE if exists t3;
--enable_warnings
eval CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = $engine_type;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval LOAD DATA INFILE '$MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' INTO TABLE t3;
eval
CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t3.txt' INTO TABLE t3;
#---------------------------
@ -37,9 +54,12 @@ drop database if exists test4;
CREATE database test4;
use test4;
eval CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = $engine_type;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval LOAD DATA INFILE '$MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t6;
eval
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int)
ENGINE = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' INTO TABLE t6;
#---------------------------
use test;
@ -47,18 +67,23 @@ use test;
--disable_warnings
drop TABLE if exists t7, t8;
--enable_warnings
eval CREATE TABLE t7 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = $engine_type;
eval CREATE TABLE t8 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = $engine_type;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval LOAD DATA INFILE '$MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t7;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval LOAD DATA INFILE '$MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t8;
eval
CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = $engine_type;
eval
CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t7.txt' INTO TABLE t7;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t7.txt' INTO TABLE t8;
--disable_warnings
drop TABLE if exists t9;
--enable_warnings
eval CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = $engine_type;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval LOAD DATA INFILE '$MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' INTO TABLE t9;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
LOAD DATA INFILE '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t9.txt' INTO TABLE t9;

File diff suppressed because it is too large Load Diff

View File

@ -9,20 +9,25 @@ DROP DATABASE IF EXISTS db_storedproc_1;
CREATE DATABASE db_storedproc;
CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t4;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t6;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t7;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -34,8 +39,9 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t8;
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -47,12 +53,14 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
Section 3.1.2 - Syntax checks for the stored procedure-specific
programming statements BEGIN/END, DECLARE, SET, SELECT/INTO, OPEN, FETCH, CLOSE:
@ -164,7 +172,7 @@ declare y integer default 1;
set @x = x;
set @y = y;
set @z = 234;
SELECT f1, f2 into @x, @y from t2 limit 1;
SELECT f1, f2 into @x, @y from t2 where f1='a`' and f2='a`' limit 1;
SELECT @x, @y, @z, invar;
BEGIN
set @x = 2;
@ -207,7 +215,7 @@ BEGIN
declare x integer; declare y integer;
set @x=x;
set @y=y;
SELECT f4, f3 into @x, @y from t2 limit 1;
SELECT f4, f3 into @x, @y from t2 where f4=-5000 and f3='1000-01-01' limit 1;
SELECT @x, @y;
END//
CALL sp1();
@ -695,7 +703,7 @@ Testcase 3.1.2.54:
------------------
Ensure that a handler with a condition defined with an SQLSTATE that begins with
“01“ is always exactly equivalent in action to a handler with an SQLWARNING
“01“ is always exactly equivalent in action to a handler with an SQLWARNING
condition.
--------------------------------------------------------------------------------
DROP PROCEDURE IF EXISTS sp0;
@ -794,7 +802,7 @@ Testcase 3.1.2.56:
------------------
Ensure that a handler with a condition defined with an SQLSTATE that begins with
“02“ is always exactly equivalent in action to a handler with a NOT FOUND
“02“ is always exactly equivalent in action to a handler with a NOT FOUND
condition.
--------------------------------------------------------------------------------
DROP PROCEDURE IF EXISTS sp0;
@ -902,7 +910,7 @@ Testcase 3.1.2.58:
------------------
Ensure that a handler with a condition defined with an SQLSTATE that begins with
anything other that “01“ or “02“ is always exactly equivalent in action to a
anything other that “01“ or “02“ is always exactly equivalent in action to a
handler with an SQLEXCEPTION condition.
--------------------------------------------------------------------------------
DROP PROCEDURE IF EXISTS sp0;
@ -1082,7 +1090,8 @@ declare f2_value char(20);
declare f5_value char(20);
declare f4_value integer;
declare f6_value integer;
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2 limit 3;
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2
where f4 >=-5000 order by f4 limit 3;
open cur1;
while proceed do
SELECT count AS 'loop';
@ -1165,7 +1174,7 @@ of a compound statement ends.
DROP TABLE IF EXISTS temp1;
DROP PROCEDURE IF EXISTS sp1;
create table temp1( f0 char(20), f1 char(20), f2 char(20), f3 int, f4 char(20) );
SELECT f1, f2, f4, f5 from t2;
SELECT f1, f2, f4, f5 from t2 order by f4;
f1 f2 f4 f5
a` a` -5000 a`
aaa aaa -4999 aaa
@ -1185,8 +1194,8 @@ declare newf1 char(20);
declare newf2 char(20);
declare newf5 char(20);
declare newf4 integer;
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
open cur1;
open cur2;
BEGIN
@ -1268,8 +1277,10 @@ declare i_newf11 char(20);
declare i_newf12 char(20);
declare i_newf13 date;
declare i_newf14 integer;
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2 limit 4;
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2 limit 3;
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2
where f4>=-5000 order by f4 limit 4;
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2
where f4>=-5000 order by f4 limit 3;
declare continue handler for sqlstate '02000' set proceed=0;
open cur1;
open cur2;
@ -1300,8 +1311,10 @@ DECLARE o_newf11 CHAR(20);
DECLARE o_newf12 CHAR(20);
DECLARE o_newf13 DATE;
DECLARE o_newf14 INTEGER;
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET proceed=0;
OPEN cur1;
OPEN cur2;

View File

@ -9,20 +9,25 @@ DROP DATABASE IF EXISTS db_storedproc_1;
CREATE DATABASE db_storedproc;
CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t4;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t6;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t7;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -34,8 +39,9 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t8;
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -47,12 +53,14 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
Section 3.1.3 - Syntax checks for the stored procedure-specific flow
control statements IF, CASE, LOOP, LEAVE, ITERATE, REPEAT, WHILE:

View File

@ -9,20 +9,25 @@ DROP DATABASE IF EXISTS db_storedproc_1;
CREATE DATABASE db_storedproc;
CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t4;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t6;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t7;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -34,8 +39,9 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t8;
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -47,12 +53,14 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
Section 3.1.6 - Privilege Checks:
--------------------------------------------------------------------------------
@ -79,6 +87,7 @@ BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
ERROR 42000: Access denied for user 'user_1'@'localhost' to database 'db_storedproc_1'
USE db_storedproc_1;
root@localhost db_storedproc_1
GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost';
@ -90,6 +99,7 @@ CREATE PROCEDURE sp1(v1 char(20))
BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
USE db_storedproc_1;
root@localhost db_storedproc_1
DROP USER 'user_1'@'localhost';
@ -115,6 +125,7 @@ CREATE FUNCTION fn1(v1 int) returns int
BEGIN
return v1;
END//
USE db_storedproc_1;
root@localhost db_storedproc_1
drop user 'user_1'@'localhost';

View File

@ -9,20 +9,25 @@ DROP DATABASE IF EXISTS db_storedproc_1;
CREATE DATABASE db_storedproc;
CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t4;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t6;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t7;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -34,8 +39,9 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t8;
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -47,12 +53,14 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
Section 3.1.7 - SQL mode checks:
--------------------------------------------------------------------------------

View File

@ -9,20 +9,25 @@ DROP DATABASE IF EXISTS db_storedproc_1;
CREATE DATABASE db_storedproc;
CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t4;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t6;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t7;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -34,8 +39,9 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t8;
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -47,12 +53,14 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
Section 3.1.8 - SHOW statement checks:
--------------------------------------------------------------------------------

View File

@ -9,20 +9,25 @@ DROP DATABASE IF EXISTS db_storedproc_1;
CREATE DATABASE db_storedproc;
CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t4;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t6;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t7;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -34,8 +39,9 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t8;
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -47,12 +53,14 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
Section 3.1.10 - CALL checks:
--------------------------------------------------------------------------------
@ -78,7 +86,7 @@ connect(localhost,user_1,,db_storedproc,MYSQL_PORT,MYSQL_SOCK);
user_1@localhost db_storedproc
CREATE PROCEDURE sp31102 () SQL SECURITY INVOKER
BEGIN
SELECT * FROM db_storedproc.t1 LIMIT 1;
SELECT * FROM db_storedproc.t1 WHERE f4=-5000 LIMIT 1;
END//
CREATE FUNCTION fn31105(n INT) RETURNS INT
BEGIN
@ -93,6 +101,8 @@ CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
connection default;
USE db_storedproc;
root@localhost db_storedproc
CALL sp31102();
@ -112,6 +122,8 @@ a` a` 1000-01-01 -5000 a` -5000
SELECT fn31105( 9 );
fn31105( 9 )
81
connection default;
USE db_storedproc;
root@localhost db_storedproc
REVOKE EXECUTE ON db_storedproc.* FROM 'user_2'@'localhost';
@ -129,6 +141,7 @@ CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
USE db_storedproc;
root@localhost db_storedproc
DROP PROCEDURE sp31102;
@ -176,6 +189,8 @@ DROP PROCEDURE IF EXISTS sp_ins_1;
DROP PROCEDURE IF EXISTS sp_ins_3;
DROP PROCEDURE IF EXISTS sp_upd;
DROP PROCEDURE IF EXISTS sp_ins_upd;
DROP PROCEDURE IF EXISTS sp_del;
DROP PROCEDURE IF EXISTS sp_with_rowcount;
CREATE TABLE temp(f1 CHAR(20),f2 CHAR(25),f3 DATE,f4 INT,f5 CHAR(25),f6 INT);
INSERT INTO temp SELECT * FROM t10;
CREATE PROCEDURE sp_ins_1()
@ -203,49 +218,72 @@ END;
SELECT COUNT( f1 ), f1 FROM temp GROUP BY f1;
UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f1 ='qwe' AND temp.f2 = 'abc';
END//
CREATE PROCEDURE sp_del()
BEGIN
DELETE FROM temp WHERE temp.f1 ='qwe' OR temp.f1 = 'updated_2';
END//
CREATE PROCEDURE sp_with_rowcount()
BEGIN
BEGIN
INSERT INTO temp VALUES ('qwe', 'abc', '1989-11-09', 100, 'uvw', 1000),
('qwe', 'xyz', '1998-03-26', 100, 'uvw', 1000),
('qwe', 'abc', '2000-11-09', 100, 'uvw', 1000),
('qwe', 'xyz', '2005-11-07', 100, 'uvw', 1000);
END;
SELECT row_count() AS 'row_count() after insert';
SELECT row_count() AS 'row_count() after select row_count()';
SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3;
UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f2 = 'abc';
SELECT row_count() AS 'row_count() after update';
SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3;
DELETE FROM temp WHERE temp.f1 = 'updated_2';
SELECT row_count() AS 'row_count() after delete';
END//
CALL sp_ins_1();
SELECT row_count();
row_count()
1
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
abc abc 2005-10-03 100 uvw 1000
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
abc abc 2005-10-03 100 uvw 1000
CALL sp_ins_3();
SELECT row_count();
row_count()
1
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
abc abc 2005-10-03 100 uvw 1000
abc xyz 1949-05-23 100 uvw 1000
abc xyz 1989-11-09 100 uvw 1000
abc xyz 2005-10-24 100 uvw 1000
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
abc abc 2005-10-03 100 uvw 1000
abc xyz 1949-05-23 100 uvw 1000
abc xyz 1989-11-09 100 uvw 1000
abc xyz 2005-10-24 100 uvw 1000
CALL sp_upd();
SELECT row_count();
row_count()
4
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
@ -254,8 +292,6 @@ adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
@ -279,6 +315,8 @@ row_count()
3
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
@ -287,20 +325,67 @@ adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
qwe xyz 1998-03-26 100 uvw 1000
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
updated xyz 2005-10-24 100 uvw 1000
updated_2 abc 1989-11-09 100 uvw 1000
qwe xyz 1998-03-26 100 uvw 1000
updated_2 abc 2000-11-09 100 uvw 1000
updated_2 abc 2005-11-07 100 uvw 1000
CALL sp_del();
SELECT row_count();
row_count()
4
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
updated xyz 2005-10-24 100 uvw 1000
DELETE FROM temp;
CALL sp_with_rowcount();
row_count() after insert
4
row_count() after select row_count()
-1
f1 f2 f3
qwe abc 1989-11-09
qwe abc 2000-11-09
qwe xyz 1998-03-26
qwe xyz 2005-11-07
row_count() after update
2
f1 f2 f3
qwe xyz 1998-03-26
qwe xyz 2005-11-07
updated_2 abc 1989-11-09
updated_2 abc 2000-11-09
row_count() after delete
2
SELECT row_count();
row_count()
-1
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
qwe xyz 1998-03-26 100 uvw 1000
qwe xyz 2005-11-07 100 uvw 1000
DROP PROCEDURE sp_ins_1;
DROP PROCEDURE sp_ins_3;
DROP PROCEDURE sp_upd;
DROP PROCEDURE sp_ins_upd;
DROP PROCEDURE sp_del;
DROP PROCEDURE sp_with_rowcount;
DROP TABLE temp;
Testcase 3.1.10.8:

View File

@ -64,7 +64,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
into table tb3;
Testcase: 3.5.1.1:
------------------
@ -206,7 +207,7 @@ update t1 set f2='update 3.5.1.7';
select * from t1;
f1 f2 f3
NULL update 3.5.1.7 42
select trigger_name from information_schema.triggers;
select trigger_name from information_schema.triggers order by trigger_name;
trigger_name
trg5_1
trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
@ -313,7 +314,7 @@ insert into trig_db3.t1 (f1,f2) values ('insert to db3 t1 from db1',4);
select @test_var1, @test_var2, @test_var3;
@test_var1 @test_var2 @test_var3
trig1 trig2 trig3
select * from t1;
select * from t1 order by f2;
f1 f2
trig1 1
trig1 2
@ -323,7 +324,7 @@ trig2 3
select * from trig_db3.t1;
f1 f2
trig3 4
select * from t1;
select * from t1 order by f2;
f1 f2
trig1 1
trig1 2
@ -348,10 +349,10 @@ for each row set @test_var2='trig1_a';
create trigger trig_db2.trig2 before insert on trig_db2.t1
for each row set @test_var3='trig2';
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers;
from information_schema.triggers order by trigger_name;
trigger_schema trigger_name event_object_table
trig_db1 trig1_b t1
trig_db1 trig1_a t1
trig_db1 trig1_b t1
trig_db2 trig2 t1
set @test_var1= '', @test_var2= '', @test_var3= '';
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);

View File

@ -64,7 +64,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
into table tb3;
Testcase 3.5.3:
---------------
@ -106,7 +107,7 @@ set new.f1 = 'trig 3.5.3.2_1-no';
ERROR 42000: Access denied; you need the SUPER privilege for this operation
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.2-no');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
select current_user;
@ -121,15 +122,12 @@ root@localhost
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.2-yes');
ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
note: once 15166 is fixed a similar case for SELECT needs to be added
---------------------------------------------------------------------
insert into t1 (f1) values ('insert 3.5.3.2-yes');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
@ -141,7 +139,7 @@ drop trigger trg1_2;
ERROR 42000: Access denied; you need the SUPER privilege for this operation
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-yes');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
@ -150,12 +148,12 @@ use priv_db;
drop trigger trg1_2;
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-no');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
drop trigger trg1_2;
Testcase 3.5.3.7a:
@ -180,23 +178,22 @@ use priv_db;
show grants;
Grants for test_noprivs@localhost
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
Trigger create disabled - should fail - Bug 8884
------------------------------------------------
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
create trigger trg4a_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1a';
insert into t1 (f1) values ('insert 3.5.3.7-1a');
select f1 from t1;
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
drop trigger trg4a_1;
use priv_db;
select current_user;
@ -207,18 +204,13 @@ Grants for test_yesprivs@localhost
GRANT UPDATE, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg4a_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2a';
SELECT priv added to bypass bug 15166
-------------------------------------
grant SELECT on *.* to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.7-2b');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
drop trigger trg4a_2;
@ -245,30 +237,29 @@ Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `priv_db`.* TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8884
------------------------------------------------
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
ERROR 42000: Access denied; you need the SUPER privilege for this operation
insert into t1 (f1) values ('insert 3.5.3.7-1b');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.7-2a
insert 3.5.3.7-1b
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update t1 set f1 = 'update 3.5.3.7-1b' where f1 = 'insert 3.5.3.7-1b';
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update 3.5.3.7-1b
drop trigger trg4b_1;
ERROR HY000: Trigger does not exist
show grants;
Grants for test_yesprivs@localhost
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@ -276,32 +267,26 @@ GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4b_2 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-2b';
SELECT priv added to bypass bug 15166
-------------------------------------
grant SELECT on priv_db.* to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.7-2b');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.7-2a
update 3.5.3.7-1b
insert 3.5.3.7-2b
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
select f1 from t1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.7-2a
update 3.5.3.7-1b
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
trig 3.5.3.7-2b
update 3.5.3.7-1b
drop trigger trg4b_2;
Testcase 3.5.3.7c
@ -327,21 +312,19 @@ Grants for test_noprivs@localhost
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8884
------------------------------------------------
create trigger trg4c_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1c';
insert into t1 (f1) values ('insert 3.5.3.7-1c');
select f1 from t1;
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update 3.5.3.7-1b
trig 3.5.3.7-2b
insert 3.5.3.7-1c
update 3.5.3.7-1b
drop trigger trg4c_1;
show grants;
Grants for test_yesprivs@localhost
@ -350,23 +333,17 @@ GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4c_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2c';
SELECT priv added to bypass bug 15166
-------------------------------------
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.7-2c');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update 3.5.3.7-1b
trig 3.5.3.7-2b
insert 3.5.3.7-1c
trig 3.5.3.7-2c
update 3.5.3.7-1b
drop trigger trg4c_2;
Testcase 3.5.3.7d:
@ -390,23 +367,20 @@ Grants for test_noprivs@localhost
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8884
------------------------------------------------
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
insert into t1 (f1) values ('insert 3.5.3.7-1d');
select f1 from t1;
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update 3.5.3.7-1b
trig 3.5.3.7-2b
insert 3.5.3.7-1c
trig 3.5.3.7-2c
insert 3.5.3.7-1d
update 3.5.3.7-1b
drop trigger trg4d_1;
show grants;
Grants for test_yesprivs@localhost
@ -415,25 +389,18 @@ GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4d_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2d';
SELECT priv added to bypass bug 15166
-------------------------------------
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.7-2d');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update 3.5.3.7-1b
trig 3.5.3.7-2b
insert 3.5.3.7-1c
trig 3.5.3.7-2c
insert 3.5.3.7-1d
trig 3.5.3.7-2d
update 3.5.3.7-1b
drop trigger trg4d_2;
Testcase 3.5.3.8a:
@ -458,14 +425,14 @@ use priv_db;
show grants;
Grants for test_noprivs@localhost
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
set @test_var = 'before trig 3.5.3.8-1a';
select @test_var;
@test_var
before trig 3.5.3.8-1a
insert into t1 (f1) values ('insert 3.5.3.8-1a');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1a
@ -483,10 +450,6 @@ set @test_var= 'before trig 3.5.3.8-2a';
select @test_var;
@test_var
before trig 3.5.3.8-2a
UPDATE priv added to bypass bug 15166
-------------------------------------
grant UPDATE on *.* to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.8-2a');
select @test_var;
@test_var
@ -517,15 +480,15 @@ Grants for test_noprivs@localhost
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `priv_db`.* TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
set @test_var= 'before trig 3.5.3.8-1b';
insert into t1 (f1) values ('insert 3.5.3.8-1b');
select @test_var;
@test_var
before trig 3.5.3.8-1b
update t1 set f1= 'update 3.5.3.8-1b' where f1 = 'insert 3.5.3.8-1b';
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1b
@ -542,10 +505,6 @@ insert into t1 (f1) values ('insert 3.5.3.8-2b');
select @test_var;
@test_var
before trig 3.5.3.8-2b
UPDATE priv added to bypass bug 15166
-------------------------------------
grant UPDATE on priv_db.* to test_yesprivs@localhost;
update t1 set f1= 'update 3.5.3.8-2b' where f1 = 'insert 3.5.3.8-2b';
select @test_var;
@test_var
@ -576,11 +535,11 @@ Grants for test_noprivs@localhost
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5c_1 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var= 'before trig 3.5.3.8-1c';
insert into t1 (f1) values ('insert 3.5.3.8-1c');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1c
@ -593,10 +552,6 @@ use priv_db;
create trigger trg5c_2 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var='before trig 3.5.3.8-2c';
UPDATE priv added to bypass bug 15166
-------------------------------------
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.8-2c');
select @test_var;
@test_var
@ -626,11 +581,11 @@ Grants for test_noprivs@localhost
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var='before trig 3.5.3.8-1d';
insert into t1 (f1) values ('insert 3.5.3.8-1d');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1d
@ -643,10 +598,6 @@ use priv_db;
create trigger trg5d_2 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var='before trig 3.5.3.8-2d';
UPDATE priv added to bypass bug 15166
-------------------------------------
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.8-2d');
select @test_var;
@test_var
@ -682,10 +633,10 @@ ERROR 42000: INSERT command denied to user 'test_yesprivs'@'localhost' for table
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
grant INSERT on priv_db.t2 to test_yesprivs@localhost;
insert into t1 (f1) values (4);
select f1 from t1;
select f1 from t1 order by f1;
f1
4
select f2 from t2;
select f2 from t2 order by f2;
f2
4
use priv_db;
@ -698,11 +649,11 @@ ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for table
revoke INSERT on priv_db.t2 from test_yesprivs@localhost;
grant UPDATE on priv_db.t2 to test_yesprivs@localhost;
insert into t1 (f1) values (2);
select f1 from t1;
select f1 from t1 order by f1;
f1
4
2
select f2 from t2;
4
select f2 from t2 order by f2;
f2
1
use priv_db;
@ -715,12 +666,12 @@ ERROR 42000: SELECT command denied to user 'test_yesprivs'@'localhost' for table
revoke UPDATE on priv_db.t2 from test_yesprivs@localhost;
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
insert into t1 (f1) values (1);
select f1 from t1;
select f1 from t1 order by f1;
f1
4
2
1
select f2 from t2;
2
4
select f2 from t2 order by f2;
f2
1
select @aaa;
@ -736,13 +687,13 @@ ERROR 42000: DELETE command denied to user 'test_yesprivs'@'localhost' for table
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
grant DELETE on priv_db.t2 to test_yesprivs@localhost;
insert into t1 (f1) values (1);
select f1 from t1;
select f1 from t1 order by f1;
f1
4
1
1
2
1
1
select f2 from t2;
4
select f2 from t2 order by f2;
f2
drop database if exists priv_db;
drop user test_yesprivs@localhost;

View File

@ -64,7 +64,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
into table tb3;
Testcase: 3.5:
--------------
@ -92,18 +93,18 @@ 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;
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;
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;
Select * from t1 order by f1;
f1
Trigger 3.5.4.1
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';
@ -257,7 +258,7 @@ 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;
Select * from dbtest_two.t2 order by f1;
f1
1st Insert 3.5.
2nd Insert 3.5.

View File

@ -64,7 +64,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
into table tb3;
Testcase: 3.5:
--------------
@ -161,14 +162,22 @@ select @test_var;
3.5.8.4 - single SQL - insert
-----------------------------
Create trigger trg2 BEFORE UPDATE on tb3 for each row
BEGIN
insert into db_test.t1_i
values (new.f120, new.f136, new.f144, new.f163);
END//
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i order by i120;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
update tb3 set f120='I', f122='Test 3.5.8.4-Single Insert'
where f122='Test 3.5.8.4';
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
I Test 3.5.8.4-Single Insert 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i;
select * from db_test.t1_i order by i120;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
I 00222 0000023456 1.050000000000000000000000000000
@ -185,14 +194,14 @@ update tb3 set f120='U', f122='Test 3.5.8.4-Single Update'
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
U Test 3.5.8.4-Single Update 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_u;
select * from db_test.t1_u order by u120;
u120 u136 u144 u163
a 00111 0000099999 999.990000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
f 00333 0000099999 999.990000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
3.5.8.3/4 - single SQL - delete
-------------------------------
@ -205,7 +214,7 @@ f122='Test 3.5.8.4-Single Delete'
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
D Test 3.5.8.4-Single Delete 00444 0000023456 1.050000000000000000000000000000
select * from db_test.t1_d;
select * from db_test.t1_d order by d120;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
@ -252,29 +261,29 @@ END//
set @test_var='Empty', @test_var2=0;
Insert into tb3 (f120, f122, f136) values ('1', 'Test 3.5.8.5-if', 101);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
D Test 3.5.8.5-if 00101 one 2nd else
Insert into tb3 (f120, f122, f136) values ('2', 'Test 3.5.8.5-if', 102);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
D Test 3.5.8.5-if 00101 two 2nd else
D Test 3.5.8.5-if 00102 two 2nd else
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 10);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
d Test 3.5.8.5-if 00010 three 2nd if
D Test 3.5.8.5-if 00101 three 2nd if
D Test 3.5.8.5-if 00102 three 2nd if
d Test 3.5.8.5-if 00010 three 2nd if
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 103);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
d Test 3.5.8.5-if 00010 three 2nd else
D Test 3.5.8.5-if 00101 three 2nd else
D Test 3.5.8.5-if 00102 three 2nd else
d Test 3.5.8.5-if 00010 three 2nd else
D Test 3.5.8.5-if 00103 three 2nd else
create trigger trg3 before update on tb3 for each row
BEGIN
@ -334,20 +343,20 @@ set @test_var='Empty';
Insert into tb3 (f120, f122, f136, f144)
values ('a', 'Test 3.5.8.5-case', 5, 7);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 A*seven
Insert into tb3 (f120, f122, f136, f144)
values ('b', 'Test 3.5.8.5-case', 71,16);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 B*0000000016
B Test 3.5.8.5-case 00191 0000000016 B*0000000016
Insert into tb3 (f120, f122, f136, f144)
values ('c', 'Test 3.5.8.5-case', 80,1);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 C=one
B Test 3.5.8.5-case 00191 0000000016 C=one
@ -357,34 +366,34 @@ values ('d', 'Test 3.5.8.5-case', 152);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
A Test 3.5.8.5-case 00125 0000000007 1*0000099999
B Test 3.5.8.5-case 00191 0000000016 1*0000099999
C Test 3.5.8.5-case 00200 0000000001 1*0000099999
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
Insert into tb3 (f120, f122, f136, f144)
values ('e', 'Test 3.5.8.5-case', 200, 8);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
A Test 3.5.8.5-case 00125 0000000007 1=eight
B Test 3.5.8.5-case 00191 0000000016 1=eight
C Test 3.5.8.5-case 00200 0000000001 1=eight
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
Insert into tb3 (f120, f122, f136, f144)
values ('f', 'Test 3.5.8.5-case', 100, 8);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
A Test 3.5.8.5-case 00125 0000000007 1=eight
B Test 3.5.8.5-case 00191 0000000016 1=eight
C Test 3.5.8.5-case 00200 0000000001 1=eight
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
create trigger trg3a before update on tb3 for each row
BEGIN
CASE
@ -490,9 +499,38 @@ drop trigger trg7;
Testcase 3.5.8.6: (requirement void)
------------------------------------
CREATE PROCEDURE sp_01 () BEGIN set @v1=1; END//
CREATE TRIGGER trg8_1 BEFORE UPDATE ON tb3 FOR EACH ROW
BEGIN
CALL sp_01 ();
END//
Insert into tb3 (f120, f122, f136) values ('6', 'Test 3.5.8.6-insert', 101);
update tb3 set f120='S', f136=111,
f122='Test 3.5.8.6-tr8_1'
where f122='Test 3.5.8.6-insert';
select f120, f122
from tb3 where f122 like 'Test 3.5.8.6%' order by f120;
f120 f122
S Test 3.5.8.6-tr8_1
DROP TRIGGER trg8_1;
DROP PROCEDURE sp_01;
Testcase 3.5.8.7: (Disabled as a result of bug _____)
-----------------------------------------------------
Testcase 3.5.8.7
----------------
Create trigger trg9_1 before update on tb3 for each row
BEGIN
Start transaction;
Set new.f120='U';
Commit;
END//
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
Create trigger trg9_2 before delete on tb3 for each row
BEGIN
Start transaction;
Set @var2=old.f120;
Rollback;
END//
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;

View File

@ -64,7 +64,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
into table tb3;
Testcase 3.5.9.1/2:
-------------------
@ -119,7 +120,7 @@ set @tr_var_af_118=old.f118, @tr_var_af_121=old.f121,
Insert into tb3 (f122, f136, f163)
values ('Test 3.5.9.3', 7, 123.17);
Update tb3 Set f136=8 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
f118 f121 f122 f136 f163
a NULL Test 3.5.9.3 00008 123.170000000000000000000000000000
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@ -135,7 +136,7 @@ a NULL Test 3.5.9.3 7 123.170000000000000000000000000000
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
0 0 0 0 0
delete from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
f118 f121 f122 f136 f163
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_163;
@ -175,7 +176,7 @@ set @tr_var_af_118=new.f118, @tr_var_af_121=new.f121,
Insert into tb3 (f122, f136, f151, f163)
values ('Test 3.5.9.4', 7, DEFAULT, 995.24);
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4%';
where f122 like 'Test 3.5.9.4%' order by f163;
f118 f121 f122 f136 f151 f163
a NULL Test 3.5.9.4 00007 999 995.240000000000000000000000000000
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@ -195,7 +196,7 @@ where f122='Test 3.5.9.4';
Warnings:
Warning 1048 Column 'f136' cannot be null
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4-trig';
where f122 like 'Test 3.5.9.4-trig' order by f163;
f118 f121 f122 f136 f151 f163
a NULL Test 3.5.9.4-trig 00000 999 NULL
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@ -240,6 +241,7 @@ ERROR HY000: There is no NEW row in on DELETE trigger
create trigger trg5b after DELETE on tb3 for each row
set new.f122='test';
ERROR HY000: There is no NEW row in on DELETE trigger
drop trigger trg5a;
drop trigger trg5b;
Testcase 3.5.9.10: (implied in previous tests)

View File

@ -64,7 +64,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
into table tb3;
Testcase 3.5.10.1/2/3:
----------------------
@ -86,7 +87,7 @@ Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 1);
Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 2);
Insert into vw11 (f122, f151) values ('Not in View', 3);
select f121, f122, f151, f163
from tb3 where f122 like 'Test 3.5.10.1/2/3%';
from tb3 where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
NULL Test 3.5.10.1/2/3 1 111.110000000000000000000000000000
NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
@ -100,7 +101,7 @@ f121 f122 f151 f163
NULL Not in View 3 111.110000000000000000000000000000
Update vw11 set f163=1;
select f121, f122, f151, f163 from tb3
where f122 like 'Test 3.5.10.1/2/3%';
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
Y Test 3.5.10.1/2/3-Update 1 1.000000000000000000000000000000
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
@ -114,7 +115,7 @@ before delete
0
delete from vw11 where f151=1;
select f121, f122, f151, f163 from tb3
where f122 like 'Test 3.5.10.1/2/3%';
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
select f121, f122, f151, f163 from vw11;
@ -141,11 +142,11 @@ set @counter= 0;
select @counter as 'Rows Loaded Before';
Rows Loaded Before
0
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table tb_load;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table tb_load;
select @counter as 'Rows Loaded After';
Rows Loaded After
10
Select * from tb_load limit 10;
Select * from tb_load order by f1 limit 10;
f1 f2 f3
-5000 a` 1000
-4999 aaa 999
@ -240,7 +241,7 @@ insert into t3 (f1) values (new.f1+1000);
create trigger tr2_4 after insert on t2_4 for each row
insert into t3 (f1) values (new.f1+10000);
insert into t1 values (1);
select * from t3;
select * from t3 order by f1;
f1
12
102
@ -275,14 +276,14 @@ create trigger tr4 after insert on t4
for each row insert into t1 (f1) values (new.f4+1);
insert into t1 values (1);
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
select * from t1;
select * from t1 order by f1;
f1
0
select * from t2;
select * from t2 order by f2;
f2
select * from t3;
select * from t3 order by f3;
f3
select * from t4;
select * from t4 order by f4;
f4
drop trigger tr1;
drop trigger tr2;
@ -293,8 +294,8 @@ drop table t2;
drop table t3;
drop table t4;
Testcase y.y.y.4: Recursive trigger/SP references (disabled bug 11889)
----------------------------------------------------------------------
Testcase y.y.y.4: Recursive trigger/SP references
-------------------------------------------------
set @sql_mode='traditional';
create table t1_sp (
count integer,
@ -382,12 +383,12 @@ start transaction;
insert into t1 values (1);
ERROR 22003: Out of range value adjusted for column 'f4' at row 1
commit;
select * from t1;
select * from t1 order by f1;
f1
1
select * from t2;
select * from t2 order by f2;
f2
select * from t3;
select * from t3 order by f3;
f3
drop trigger tr1;
drop trigger tr2;

View File

@ -64,7 +64,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
into table tb3;
Testcase x.x.x.1:
-----------------

View File

@ -53,7 +53,8 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb2.txt' into table tb2 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb2.txt'
into table tb2;
DROP DATABASE IF EXISTS test1;
CREATE DATABASE test1;
USE test1;
@ -111,7 +112,8 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb2.txt' into table tb2 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb2.txt'
into table tb2;
USE test;
! Attention: The file with the expected results is not

View File

@ -76,7 +76,8 @@ Note 1265 Data truncated for column 'f45' at row 1
Note 1265 Data truncated for column 'f47' at row 1
Note 1265 Data truncated for column 'f49' at row 1
Note 1265 Data truncated for column 'f51' at row 1
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb1.txt' into table tb1 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb1.txt'
into table tb1;
drop table if exists tb2 ;
create table tb2 (
f59 numeric (0) unsigned,
@ -131,7 +132,8 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb2.txt' into table tb2 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb2.txt'
into table tb2;
drop table if exists tb3 ;
create table tb3 (
f118 char not null DEFAULT 'a',
@ -197,7 +199,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
into table tb3;
drop table if exists tb4;
create table tb4 (
f176 numeric (0) unsigned not null DEFAULT 9,
@ -259,7 +262,8 @@ f239 varchar(20000) binary,
f240 varchar(2000) unicode,
f241 char(100) unicode
) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb4.txt' into table tb4 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb4.txt'
into table tb4;
USE test1;
drop table if exists tb2 ;
create table tb2 (
@ -315,33 +319,40 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb2.txt' into table tb2 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb2.txt'
into table tb2;
USE test;
USE test;
DROP TABLE IF EXISTS t1, t2, t4, t10, t11;
CREATE TABLE t1 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = InnoDB;
CREATE TABLE t2 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = InnoDB;
CREATE TABLE t4 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = InnoDB;
CREATE TABLE t10 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = InnoDB;
CREATE TABLE t11 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = InnoDB;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t1;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t2;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t4;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t10;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t11;
CREATE TABLE t1 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = InnoDB;
CREATE TABLE t2 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = InnoDB;
CREATE TABLE t4 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = InnoDB;
CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = InnoDB;
CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = InnoDB;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t1;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t2;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t4;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t10;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t11;
drop TABLE if exists t3;
CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = InnoDB;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' INTO TABLE t3;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' INTO TABLE t3;
drop database if exists test4;
CREATE database test4;
use test4;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = InnoDB;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t6;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int)
ENGINE = InnoDB;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t6;
use test;
drop TABLE if exists t7, t8;
CREATE TABLE t7 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = InnoDB;
CREATE TABLE t8 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = InnoDB;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t7;
CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = InnoDB;
CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = InnoDB;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -353,7 +364,7 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t8;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -367,7 +378,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
drop TABLE if exists t9;
CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = InnoDB;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' INTO TABLE t9;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' INTO TABLE t9;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;

View File

@ -72,7 +72,8 @@ Note 1265 Data truncated for column 'f45' at row 1
Note 1265 Data truncated for column 'f47' at row 1
Note 1265 Data truncated for column 'f49' at row 1
Note 1265 Data truncated for column 'f51' at row 1
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb1.txt' into table tb1 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb1.txt'
into table tb1;
drop table if exists tb2 ;
create table tb2 (
f59 numeric (0) unsigned,
@ -127,7 +128,8 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb2.txt' into table tb2 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb2.txt'
into table tb2 ;
drop table if exists tb3;
create table tb3 (
f118 char not null DEFAULT 'a',
@ -187,7 +189,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
drop table if exists tb4 ;
create table tb4 (
f176 numeric (0) unsigned not null DEFAULT 9,
@ -248,7 +251,8 @@ f238 varchar(25000) binary,
f239 varbinary(0),
f240 varchar(1200) unicode
) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb4.txt' into table tb4 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb4.txt'
into table tb4;
USE test1;
drop table if exists tb2 ;
create table tb2 (
@ -304,33 +308,40 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb2.txt' into table tb2 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb2.txt'
into table tb2 ;
USE test;
USE test;
DROP TABLE IF EXISTS t1, t2, t4, t10, t11;
CREATE TABLE t1 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MEMORY;
CREATE TABLE t2 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MEMORY;
CREATE TABLE t4 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MEMORY;
CREATE TABLE t10 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MEMORY;
CREATE TABLE t11 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MEMORY;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t1;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t2;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t4;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t10;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t11;
CREATE TABLE t1 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MEMORY;
CREATE TABLE t2 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MEMORY;
CREATE TABLE t4 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MEMORY;
CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MEMORY;
CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MEMORY;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t1;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t2;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t4;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t10;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t11;
drop TABLE if exists t3;
CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = MEMORY;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' INTO TABLE t3;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' INTO TABLE t3;
drop database if exists test4;
CREATE database test4;
use test4;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MEMORY;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t6;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int)
ENGINE = MEMORY;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t6;
use test;
drop TABLE if exists t7, t8;
CREATE TABLE t7 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = MEMORY;
CREATE TABLE t8 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = MEMORY;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t7;
CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = MEMORY;
CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = MEMORY;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -342,7 +353,7 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t8;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -356,7 +367,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
drop TABLE if exists t9;
CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = MEMORY;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' INTO TABLE t9;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' INTO TABLE t9;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;

View File

@ -80,7 +80,8 @@ Note 1265 Data truncated for column 'f45' at row 1
Note 1265 Data truncated for column 'f47' at row 1
Note 1265 Data truncated for column 'f49' at row 1
Note 1265 Data truncated for column 'f51' at row 1
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb1.txt' into table tb1 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb1.txt'
into table tb1;
drop table if exists tb2 ;
create table tb2 (
f59 numeric (0) unsigned,
@ -143,7 +144,8 @@ f115 VARBINARY(27) null ,
f116 VARBINARY(64) null,
f117 VARBINARY(192) null
) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb2.txt' into table tb2 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb2.txt'
into table tb2;
drop table if exists tb3 ;
create table tb3 (
f118 char not null DEFAULT 'a',
@ -209,7 +211,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb3.txt'
into table tb3;
drop table if exists tb4 ;
create table tb4 (
f176 numeric (0) unsigned not null DEFAULT 9,
@ -280,7 +283,8 @@ f240 varchar(120) unicode,
f241 char(100) unicode,
f242 bit(30)
) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb4.txt' into table tb4 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb4.txt'
into table tb4;
USE test1;
drop table if exists tb2 ;
create table tb2 (
@ -344,33 +348,40 @@ f115 VARBINARY(27) null ,
f116 VARBINARY(64) null,
f117 VARBINARY(192) null
) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb2.txt' into table tb2 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb2.txt'
into table tb2;
USE test;
USE test;
DROP TABLE IF EXISTS t1, t2, t4, t10, t11;
CREATE TABLE t1 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MyISAM;
CREATE TABLE t2 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MyISAM;
CREATE TABLE t4 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MyISAM;
CREATE TABLE t10 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MyISAM;
CREATE TABLE t11 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MyISAM;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t1;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t2;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t4;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t10;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t11;
CREATE TABLE t1 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MyISAM;
CREATE TABLE t2 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MyISAM;
CREATE TABLE t4 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MyISAM;
CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MyISAM;
CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MyISAM;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t1;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t2;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t4;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t10;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t11;
drop TABLE if exists t3;
CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = MyISAM;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' INTO TABLE t3;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' INTO TABLE t3;
drop database if exists test4;
CREATE database test4;
use test4;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MyISAM;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t6;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int)
ENGINE = MyISAM;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t6;
use test;
drop TABLE if exists t7, t8;
CREATE TABLE t7 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = MyISAM;
CREATE TABLE t8 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = MyISAM;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t7;
CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = MyISAM;
CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = MyISAM;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -382,7 +393,7 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t8;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -396,7 +407,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
drop TABLE if exists t9;
CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = MyISAM;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' INTO TABLE t9;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' INTO TABLE t9;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;

View File

@ -4,29 +4,35 @@ USE test;
USE test;
USE test;
DROP TABLE IF EXISTS t1, t2, t4, t10, t11;
CREATE TABLE t1 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = ndb;
CREATE TABLE t2 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = ndb;
CREATE TABLE t4 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = ndb;
CREATE TABLE t10 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = ndb;
CREATE TABLE t11 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = ndb;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t1;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t2;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t4;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t10;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t11;
CREATE TABLE t1 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = ndb;
CREATE TABLE t2 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = ndb;
CREATE TABLE t4 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = ndb;
CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = ndb;
CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = ndb;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t1;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t2;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t4;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t10;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t11;
drop TABLE if exists t3;
CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = ndb;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' INTO TABLE t3;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' INTO TABLE t3;
drop database if exists test4;
CREATE database test4;
use test4;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = ndb;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t6;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int)
ENGINE = ndb;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t6;
use test;
drop TABLE if exists t7, t8;
CREATE TABLE t7 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = ndb;
CREATE TABLE t8 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = ndb;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t7;
CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = ndb;
CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = ndb;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -38,7 +44,7 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t8;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -52,7 +58,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
drop TABLE if exists t9;
CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = ndb;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' INTO TABLE t9;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' INTO TABLE t9;
SELECT * FROM information_schema.columns
WHERE table_schema LIKE 'test%'
ORDER BY table_schema, table_name, column_name;

View File

@ -76,7 +76,8 @@ Note 1265 Data truncated for column 'f45' at row 1
Note 1265 Data truncated for column 'f47' at row 1
Note 1265 Data truncated for column 'f49' at row 1
Note 1265 Data truncated for column 'f51' at row 1
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb1.txt' into table tb1 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb1.txt'
into table tb1;
drop table if exists tb2 ;
create table tb2 (
f59 numeric (0) unsigned,
@ -131,7 +132,8 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb2.txt' into table tb2 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb2.txt'
into table tb2;
drop table if exists tb3 ;
create table tb3 (
f118 char not null DEFAULT 'a',
@ -197,7 +199,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb3.txt'
into table tb3;
drop table if exists tb4;
create table tb4 (
f176 numeric (0) unsigned not null DEFAULT 9,
@ -259,7 +262,8 @@ f239 varchar(20000) binary,
f240 varchar(2000) unicode,
f241 char(100) unicode
) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb4.txt' into table tb4 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb4.txt'
into table tb4;
USE test1;
drop table if exists tb2 ;
create table tb2 (
@ -315,33 +319,40 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = innodb;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/innodb_tb2.txt' into table tb2 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/innodb_tb2.txt'
into table tb2;
USE test;
USE test;
DROP TABLE IF EXISTS t1, t2, t4, t10, t11;
CREATE TABLE t1 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = InnoDB;
CREATE TABLE t2 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = InnoDB;
CREATE TABLE t4 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = InnoDB;
CREATE TABLE t10 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = InnoDB;
CREATE TABLE t11 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = InnoDB;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t1;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t2;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t4;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t10;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t11;
CREATE TABLE t1 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = InnoDB;
CREATE TABLE t2 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = InnoDB;
CREATE TABLE t4 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = InnoDB;
CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = InnoDB;
CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = InnoDB;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t1;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t2;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t4;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t10;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t11;
drop TABLE if exists t3;
CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = InnoDB;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' INTO TABLE t3;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' INTO TABLE t3;
drop database if exists test4;
CREATE database test4;
use test4;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = InnoDB;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t6;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int)
ENGINE = InnoDB;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t6;
use test;
drop TABLE if exists t7, t8;
CREATE TABLE t7 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = InnoDB;
CREATE TABLE t8 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = InnoDB;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t7;
CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = InnoDB;
CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = InnoDB;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -353,7 +364,7 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t8;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -367,7 +378,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
drop TABLE if exists t9;
CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = InnoDB;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' INTO TABLE t9;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' INTO TABLE t9;
DROP DATABASE IF EXISTS db_datadict;
CREATE DATABASE db_datadict;
SELECT *,

View File

@ -72,7 +72,8 @@ Note 1265 Data truncated for column 'f45' at row 1
Note 1265 Data truncated for column 'f47' at row 1
Note 1265 Data truncated for column 'f49' at row 1
Note 1265 Data truncated for column 'f51' at row 1
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb1.txt' into table tb1 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb1.txt'
into table tb1;
drop table if exists tb2 ;
create table tb2 (
f59 numeric (0) unsigned,
@ -127,7 +128,8 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb2.txt' into table tb2 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb2.txt'
into table tb2 ;
drop table if exists tb3;
create table tb3 (
f118 char not null DEFAULT 'a',
@ -187,7 +189,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
drop table if exists tb4 ;
create table tb4 (
f176 numeric (0) unsigned not null DEFAULT 9,
@ -248,7 +251,8 @@ f238 varchar(25000) binary,
f239 varbinary(0),
f240 varchar(1200) unicode
) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb4.txt' into table tb4 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb4.txt'
into table tb4;
USE test1;
drop table if exists tb2 ;
create table tb2 (
@ -304,33 +308,40 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb2.txt' into table tb2 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb2.txt'
into table tb2 ;
USE test;
USE test;
DROP TABLE IF EXISTS t1, t2, t4, t10, t11;
CREATE TABLE t1 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MEMORY;
CREATE TABLE t2 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MEMORY;
CREATE TABLE t4 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MEMORY;
CREATE TABLE t10 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MEMORY;
CREATE TABLE t11 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MEMORY;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t1;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t2;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t4;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t10;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t11;
CREATE TABLE t1 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MEMORY;
CREATE TABLE t2 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MEMORY;
CREATE TABLE t4 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MEMORY;
CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MEMORY;
CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MEMORY;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t1;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t2;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t4;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t10;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t11;
drop TABLE if exists t3;
CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = MEMORY;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' INTO TABLE t3;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' INTO TABLE t3;
drop database if exists test4;
CREATE database test4;
use test4;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MEMORY;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t6;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int)
ENGINE = MEMORY;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t6;
use test;
drop TABLE if exists t7, t8;
CREATE TABLE t7 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = MEMORY;
CREATE TABLE t8 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = MEMORY;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t7;
CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = MEMORY;
CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = MEMORY;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -342,7 +353,7 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t8;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -356,7 +367,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
drop TABLE if exists t9;
CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = MEMORY;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' INTO TABLE t9;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' INTO TABLE t9;
DROP DATABASE IF EXISTS db_datadict;
CREATE DATABASE db_datadict;
SELECT *,

View File

@ -80,7 +80,8 @@ Note 1265 Data truncated for column 'f45' at row 1
Note 1265 Data truncated for column 'f47' at row 1
Note 1265 Data truncated for column 'f49' at row 1
Note 1265 Data truncated for column 'f51' at row 1
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb1.txt' into table tb1 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb1.txt'
into table tb1;
drop table if exists tb2 ;
create table tb2 (
f59 numeric (0) unsigned,
@ -143,7 +144,8 @@ f115 VARBINARY(27) null ,
f116 VARBINARY(64) null,
f117 VARBINARY(192) null
) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb2.txt' into table tb2 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb2.txt'
into table tb2;
drop table if exists tb3 ;
create table tb3 (
f118 char not null DEFAULT 'a',
@ -209,7 +211,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb3.txt'
into table tb3;
drop table if exists tb4 ;
create table tb4 (
f176 numeric (0) unsigned not null DEFAULT 9,
@ -280,7 +283,8 @@ f240 varchar(120) unicode,
f241 char(100) unicode,
f242 bit(30)
) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb4.txt' into table tb4 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb4.txt'
into table tb4;
USE test1;
drop table if exists tb2 ;
create table tb2 (
@ -344,33 +348,40 @@ f115 VARBINARY(27) null ,
f116 VARBINARY(64) null,
f117 VARBINARY(192) null
) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb2.txt' into table tb2 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb2.txt'
into table tb2;
USE test;
USE test;
DROP TABLE IF EXISTS t1, t2, t4, t10, t11;
CREATE TABLE t1 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MyISAM;
CREATE TABLE t2 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MyISAM;
CREATE TABLE t4 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MyISAM;
CREATE TABLE t10 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MyISAM;
CREATE TABLE t11 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MyISAM;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t1;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t2;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t4;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t10;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t11;
CREATE TABLE t1 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MyISAM;
CREATE TABLE t2 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MyISAM;
CREATE TABLE t4 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MyISAM;
CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MyISAM;
CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = MyISAM;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t1;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t2;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t4;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t10;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t11;
drop TABLE if exists t3;
CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = MyISAM;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' INTO TABLE t3;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' INTO TABLE t3;
drop database if exists test4;
CREATE database test4;
use test4;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = MyISAM;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t6;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int)
ENGINE = MyISAM;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t6;
use test;
drop TABLE if exists t7, t8;
CREATE TABLE t7 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = MyISAM;
CREATE TABLE t8 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = MyISAM;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t7;
CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = MyISAM;
CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = MyISAM;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -382,7 +393,7 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t8;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -396,7 +407,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
drop TABLE if exists t9;
CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = MyISAM;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' INTO TABLE t9;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' INTO TABLE t9;
DROP DATABASE IF EXISTS db_datadict;
CREATE DATABASE db_datadict;
SELECT *,

View File

@ -4,29 +4,35 @@ USE test;
USE test;
USE test;
DROP TABLE IF EXISTS t1, t2, t4, t10, t11;
CREATE TABLE t1 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = NDB;
CREATE TABLE t2 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = NDB;
CREATE TABLE t4 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = NDB;
CREATE TABLE t10 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = NDB;
CREATE TABLE t11 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = NDB;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t1;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t2;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t4;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t10;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t11;
CREATE TABLE t1 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = NDB;
CREATE TABLE t2 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = NDB;
CREATE TABLE t4 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = NDB;
CREATE TABLE t10 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = NDB;
CREATE TABLE t11 (f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
ENGINE = NDB;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t1;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t2;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t4;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t10;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t11;
drop TABLE if exists t3;
CREATE TABLE t3 (f1 char(20), f2 char(20), f3 integer) ENGINE = NDB;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' INTO TABLE t3;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' INTO TABLE t3;
drop database if exists test4;
CREATE database test4;
use test4;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int) ENGINE = NDB;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' INTO TABLE t6;
CREATE TABLE t6 (f1 char(20), f2 char(25), f3 date, f4 int, f5 char(25), f6 int)
ENGINE = NDB;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' INTO TABLE t6;
use test;
drop TABLE if exists t7, t8;
CREATE TABLE t7 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = NDB;
CREATE TABLE t8 (f1 char(20), f2 char(25), f3 date, f4 int) ENGINE = NDB;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t7;
CREATE TABLE t7 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = NDB;
CREATE TABLE t8 (f1 char(20),f2 char(25),f3 date,f4 int) ENGINE = NDB;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -38,7 +44,7 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' INTO TABLE t8;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' INTO TABLE t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -52,7 +58,7 @@ Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
drop TABLE if exists t9;
CREATE TABLE t9 (f1 int, f2 char(25), f3 int) ENGINE = NDB;
LOAD DATA INFILE 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' INTO TABLE t9;
LOAD DATA INFILE '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' INTO TABLE t9;
DROP DATABASE IF EXISTS db_datadict;
CREATE DATABASE db_datadict;
SELECT *,

File diff suppressed because it is too large Load Diff

View File

@ -9,20 +9,25 @@ DROP DATABASE IF EXISTS db_storedproc_1;
CREATE DATABASE db_storedproc;
CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t4;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t6;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t7;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -34,8 +39,9 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t8;
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -47,12 +53,14 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
Section 3.1.2 - Syntax checks for the stored procedure-specific
programming statements BEGIN/END, DECLARE, SET, SELECT/INTO, OPEN, FETCH, CLOSE:
@ -164,7 +172,7 @@ declare y integer default 1;
set @x = x;
set @y = y;
set @z = 234;
SELECT f1, f2 into @x, @y from t2 limit 1;
SELECT f1, f2 into @x, @y from t2 where f1='a`' and f2='a`' limit 1;
SELECT @x, @y, @z, invar;
BEGIN
set @x = 2;
@ -207,7 +215,7 @@ BEGIN
declare x integer; declare y integer;
set @x=x;
set @y=y;
SELECT f4, f3 into @x, @y from t2 limit 1;
SELECT f4, f3 into @x, @y from t2 where f4=-5000 and f3='1000-01-01' limit 1;
SELECT @x, @y;
END//
CALL sp1();
@ -695,7 +703,7 @@ Testcase 3.1.2.54:
------------------
Ensure that a handler with a condition defined with an SQLSTATE that begins with
“01“ is always exactly equivalent in action to a handler with an SQLWARNING
“01“ is always exactly equivalent in action to a handler with an SQLWARNING
condition.
--------------------------------------------------------------------------------
DROP PROCEDURE IF EXISTS sp0;
@ -794,7 +802,7 @@ Testcase 3.1.2.56:
------------------
Ensure that a handler with a condition defined with an SQLSTATE that begins with
“02“ is always exactly equivalent in action to a handler with a NOT FOUND
“02“ is always exactly equivalent in action to a handler with a NOT FOUND
condition.
--------------------------------------------------------------------------------
DROP PROCEDURE IF EXISTS sp0;
@ -902,7 +910,7 @@ Testcase 3.1.2.58:
------------------
Ensure that a handler with a condition defined with an SQLSTATE that begins with
anything other that “01“ or “02“ is always exactly equivalent in action to a
anything other that “01“ or “02“ is always exactly equivalent in action to a
handler with an SQLEXCEPTION condition.
--------------------------------------------------------------------------------
DROP PROCEDURE IF EXISTS sp0;
@ -1082,7 +1090,8 @@ declare f2_value char(20);
declare f5_value char(20);
declare f4_value integer;
declare f6_value integer;
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2 limit 3;
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2
where f4 >=-5000 order by f4 limit 3;
open cur1;
while proceed do
SELECT count AS 'loop';
@ -1165,7 +1174,7 @@ of a compound statement ends.
DROP TABLE IF EXISTS temp1;
DROP PROCEDURE IF EXISTS sp1;
create table temp1( f0 char(20), f1 char(20), f2 char(20), f3 int, f4 char(20) );
SELECT f1, f2, f4, f5 from t2;
SELECT f1, f2, f4, f5 from t2 order by f4;
f1 f2 f4 f5
a` a` -5000 a`
aaa aaa -4999 aaa
@ -1185,8 +1194,8 @@ declare newf1 char(20);
declare newf2 char(20);
declare newf5 char(20);
declare newf4 integer;
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
open cur1;
open cur2;
BEGIN
@ -1268,8 +1277,10 @@ declare i_newf11 char(20);
declare i_newf12 char(20);
declare i_newf13 date;
declare i_newf14 integer;
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2 limit 4;
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2 limit 3;
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2
where f4>=-5000 order by f4 limit 4;
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2
where f4>=-5000 order by f4 limit 3;
declare continue handler for sqlstate '02000' set proceed=0;
open cur1;
open cur2;
@ -1300,8 +1311,10 @@ DECLARE o_newf11 CHAR(20);
DECLARE o_newf12 CHAR(20);
DECLARE o_newf13 DATE;
DECLARE o_newf14 INTEGER;
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET proceed=0;
OPEN cur1;
OPEN cur2;

View File

@ -9,20 +9,25 @@ DROP DATABASE IF EXISTS db_storedproc_1;
CREATE DATABASE db_storedproc;
CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t4;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t6;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t7;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -34,8 +39,9 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t8;
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -47,12 +53,14 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
Section 3.1.3 - Syntax checks for the stored procedure-specific flow
control statements IF, CASE, LOOP, LEAVE, ITERATE, REPEAT, WHILE:

View File

@ -9,20 +9,25 @@ DROP DATABASE IF EXISTS db_storedproc_1;
CREATE DATABASE db_storedproc;
CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t4;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t6;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t7;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -34,8 +39,9 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t8;
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -47,12 +53,14 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
Section 3.1.6 - Privilege Checks:
--------------------------------------------------------------------------------
@ -79,6 +87,7 @@ BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
ERROR 42000: Access denied for user 'user_1'@'localhost' to database 'db_storedproc_1'
USE db_storedproc_1;
root@localhost db_storedproc_1
GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost';
@ -90,6 +99,7 @@ CREATE PROCEDURE sp1(v1 char(20))
BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
USE db_storedproc_1;
root@localhost db_storedproc_1
DROP USER 'user_1'@'localhost';
@ -115,6 +125,7 @@ CREATE FUNCTION fn1(v1 int) returns int
BEGIN
return v1;
END//
USE db_storedproc_1;
root@localhost db_storedproc_1
drop user 'user_1'@'localhost';

View File

@ -9,20 +9,25 @@ DROP DATABASE IF EXISTS db_storedproc_1;
CREATE DATABASE db_storedproc;
CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t4;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t6;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t7;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -34,8 +39,9 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t8;
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -47,12 +53,14 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
Section 3.1.7 - SQL mode checks:
--------------------------------------------------------------------------------

View File

@ -9,20 +9,25 @@ DROP DATABASE IF EXISTS db_storedproc_1;
CREATE DATABASE db_storedproc;
CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t4;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t6;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t7;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -34,8 +39,9 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t8;
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -47,12 +53,14 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
Section 3.1.8 - SHOW statement checks:
--------------------------------------------------------------------------------

View File

@ -9,20 +9,25 @@ DROP DATABASE IF EXISTS db_storedproc_1;
CREATE DATABASE db_storedproc;
CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t4;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t6;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t7;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -34,8 +39,9 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t8;
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -47,12 +53,14 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
Section 3.1.10 - CALL checks:
--------------------------------------------------------------------------------
@ -78,7 +86,7 @@ connect(localhost,user_1,,db_storedproc,MYSQL_PORT,MYSQL_SOCK);
user_1@localhost db_storedproc
CREATE PROCEDURE sp31102 () SQL SECURITY INVOKER
BEGIN
SELECT * FROM db_storedproc.t1 LIMIT 1;
SELECT * FROM db_storedproc.t1 WHERE f4=-5000 LIMIT 1;
END//
CREATE FUNCTION fn31105(n INT) RETURNS INT
BEGIN
@ -93,6 +101,8 @@ CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
connection default;
USE db_storedproc;
root@localhost db_storedproc
CALL sp31102();
@ -112,6 +122,8 @@ a` a` 1000-01-01 -5000 a` -5000
SELECT fn31105( 9 );
fn31105( 9 )
81
connection default;
USE db_storedproc;
root@localhost db_storedproc
REVOKE EXECUTE ON db_storedproc.* FROM 'user_2'@'localhost';
@ -129,6 +141,7 @@ CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
USE db_storedproc;
root@localhost db_storedproc
DROP PROCEDURE sp31102;
@ -176,6 +189,8 @@ DROP PROCEDURE IF EXISTS sp_ins_1;
DROP PROCEDURE IF EXISTS sp_ins_3;
DROP PROCEDURE IF EXISTS sp_upd;
DROP PROCEDURE IF EXISTS sp_ins_upd;
DROP PROCEDURE IF EXISTS sp_del;
DROP PROCEDURE IF EXISTS sp_with_rowcount;
CREATE TABLE temp(f1 CHAR(20),f2 CHAR(25),f3 DATE,f4 INT,f5 CHAR(25),f6 INT);
INSERT INTO temp SELECT * FROM t10;
CREATE PROCEDURE sp_ins_1()
@ -203,49 +218,72 @@ END;
SELECT COUNT( f1 ), f1 FROM temp GROUP BY f1;
UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f1 ='qwe' AND temp.f2 = 'abc';
END//
CREATE PROCEDURE sp_del()
BEGIN
DELETE FROM temp WHERE temp.f1 ='qwe' OR temp.f1 = 'updated_2';
END//
CREATE PROCEDURE sp_with_rowcount()
BEGIN
BEGIN
INSERT INTO temp VALUES ('qwe', 'abc', '1989-11-09', 100, 'uvw', 1000),
('qwe', 'xyz', '1998-03-26', 100, 'uvw', 1000),
('qwe', 'abc', '2000-11-09', 100, 'uvw', 1000),
('qwe', 'xyz', '2005-11-07', 100, 'uvw', 1000);
END;
SELECT row_count() AS 'row_count() after insert';
SELECT row_count() AS 'row_count() after select row_count()';
SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3;
UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f2 = 'abc';
SELECT row_count() AS 'row_count() after update';
SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3;
DELETE FROM temp WHERE temp.f1 = 'updated_2';
SELECT row_count() AS 'row_count() after delete';
END//
CALL sp_ins_1();
SELECT row_count();
row_count()
1
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
abc abc 2005-10-03 100 uvw 1000
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
abc abc 2005-10-03 100 uvw 1000
CALL sp_ins_3();
SELECT row_count();
row_count()
1
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
abc abc 2005-10-03 100 uvw 1000
abc xyz 1949-05-23 100 uvw 1000
abc xyz 1989-11-09 100 uvw 1000
abc xyz 2005-10-24 100 uvw 1000
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
abc abc 2005-10-03 100 uvw 1000
abc xyz 1949-05-23 100 uvw 1000
abc xyz 1989-11-09 100 uvw 1000
abc xyz 2005-10-24 100 uvw 1000
CALL sp_upd();
SELECT row_count();
row_count()
4
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
@ -254,8 +292,6 @@ adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
@ -279,6 +315,8 @@ row_count()
3
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
@ -287,20 +325,67 @@ adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
qwe xyz 1998-03-26 100 uvw 1000
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
updated xyz 2005-10-24 100 uvw 1000
updated_2 abc 1989-11-09 100 uvw 1000
qwe xyz 1998-03-26 100 uvw 1000
updated_2 abc 2000-11-09 100 uvw 1000
updated_2 abc 2005-11-07 100 uvw 1000
CALL sp_del();
SELECT row_count();
row_count()
4
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
updated xyz 2005-10-24 100 uvw 1000
DELETE FROM temp;
CALL sp_with_rowcount();
row_count() after insert
4
row_count() after select row_count()
-1
f1 f2 f3
qwe abc 1989-11-09
qwe abc 2000-11-09
qwe xyz 1998-03-26
qwe xyz 2005-11-07
row_count() after update
2
f1 f2 f3
qwe xyz 1998-03-26
qwe xyz 2005-11-07
updated_2 abc 1989-11-09
updated_2 abc 2000-11-09
row_count() after delete
2
SELECT row_count();
row_count()
-1
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
qwe xyz 1998-03-26 100 uvw 1000
qwe xyz 2005-11-07 100 uvw 1000
DROP PROCEDURE sp_ins_1;
DROP PROCEDURE sp_ins_3;
DROP PROCEDURE sp_upd;
DROP PROCEDURE sp_ins_upd;
DROP PROCEDURE sp_del;
DROP PROCEDURE sp_with_rowcount;
DROP TABLE temp;
Testcase 3.1.10.8:

View File

@ -58,7 +58,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
Testcase: 3.5.1.1:
------------------
@ -200,7 +201,7 @@ update t1 set f2='update 3.5.1.7';
select * from t1;
f1 f2 f3
NULL update 3.5.1.7 42
select trigger_name from information_schema.triggers;
select trigger_name from information_schema.triggers order by trigger_name;
trigger_name
trg5_1
trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
@ -307,7 +308,7 @@ insert into trig_db3.t1 (f1,f2) values ('insert to db3 t1 from db1',4);
select @test_var1, @test_var2, @test_var3;
@test_var1 @test_var2 @test_var3
trig1 trig2 trig3
select * from t1;
select * from t1 order by f2;
f1 f2
trig1 1
trig1 2
@ -317,7 +318,7 @@ trig2 3
select * from trig_db3.t1;
f1 f2
trig3 4
select * from t1;
select * from t1 order by f2;
f1 f2
trig1 1
trig1 2
@ -342,10 +343,10 @@ for each row set @test_var2='trig1_a';
create trigger trig_db2.trig2 before insert on trig_db2.t1
for each row set @test_var3='trig2';
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers;
from information_schema.triggers order by trigger_name;
trigger_schema trigger_name event_object_table
trig_db1 trig1_b t1
trig_db1 trig1_a t1
trig_db1 trig1_b t1
trig_db2 trig2 t1
set @test_var1= '', @test_var2= '', @test_var3= '';
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);

View File

@ -58,7 +58,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
Testcase 3.5.3:
---------------
@ -100,7 +101,7 @@ set new.f1 = 'trig 3.5.3.2_1-no';
ERROR 42000: Access denied; you need the SUPER privilege for this operation
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.2-no');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
select current_user;
@ -115,15 +116,12 @@ root@localhost
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.2-yes');
ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
note: once 15166 is fixed a similar case for SELECT needs to be added
---------------------------------------------------------------------
insert into t1 (f1) values ('insert 3.5.3.2-yes');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
@ -135,7 +133,7 @@ drop trigger trg1_2;
ERROR 42000: Access denied; you need the SUPER privilege for this operation
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-yes');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
@ -144,12 +142,12 @@ use priv_db;
drop trigger trg1_2;
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-no');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
drop trigger trg1_2;
Testcase 3.5.3.7a:
@ -174,23 +172,22 @@ use priv_db;
show grants;
Grants for test_noprivs@localhost
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
Trigger create disabled - should fail - Bug 8884
------------------------------------------------
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
create trigger trg4a_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1a';
insert into t1 (f1) values ('insert 3.5.3.7-1a');
select f1 from t1;
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
drop trigger trg4a_1;
use priv_db;
select current_user;
@ -201,18 +198,13 @@ Grants for test_yesprivs@localhost
GRANT UPDATE, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg4a_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2a';
SELECT priv added to bypass bug 15166
-------------------------------------
grant SELECT on *.* to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.7-2b');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
drop trigger trg4a_2;
@ -239,30 +231,29 @@ Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `priv_db`.* TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8884
------------------------------------------------
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
ERROR 42000: Access denied; you need the SUPER privilege for this operation
insert into t1 (f1) values ('insert 3.5.3.7-1b');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.7-2a
insert 3.5.3.7-1b
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update t1 set f1 = 'update 3.5.3.7-1b' where f1 = 'insert 3.5.3.7-1b';
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update 3.5.3.7-1b
drop trigger trg4b_1;
ERROR HY000: Trigger does not exist
show grants;
Grants for test_yesprivs@localhost
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@ -270,32 +261,26 @@ GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4b_2 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-2b';
SELECT priv added to bypass bug 15166
-------------------------------------
grant SELECT on priv_db.* to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.7-2b');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.7-2a
update 3.5.3.7-1b
insert 3.5.3.7-2b
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
select f1 from t1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.7-2a
update 3.5.3.7-1b
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
trig 3.5.3.7-2b
update 3.5.3.7-1b
drop trigger trg4b_2;
Testcase 3.5.3.7c
@ -321,21 +306,19 @@ Grants for test_noprivs@localhost
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8884
------------------------------------------------
create trigger trg4c_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1c';
insert into t1 (f1) values ('insert 3.5.3.7-1c');
select f1 from t1;
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update 3.5.3.7-1b
trig 3.5.3.7-2b
insert 3.5.3.7-1c
update 3.5.3.7-1b
drop trigger trg4c_1;
show grants;
Grants for test_yesprivs@localhost
@ -344,23 +327,17 @@ GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4c_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2c';
SELECT priv added to bypass bug 15166
-------------------------------------
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.7-2c');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update 3.5.3.7-1b
trig 3.5.3.7-2b
insert 3.5.3.7-1c
trig 3.5.3.7-2c
update 3.5.3.7-1b
drop trigger trg4c_2;
Testcase 3.5.3.7d:
@ -384,23 +361,20 @@ Grants for test_noprivs@localhost
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8884
------------------------------------------------
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
insert into t1 (f1) values ('insert 3.5.3.7-1d');
select f1 from t1;
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update 3.5.3.7-1b
trig 3.5.3.7-2b
insert 3.5.3.7-1c
trig 3.5.3.7-2c
insert 3.5.3.7-1d
update 3.5.3.7-1b
drop trigger trg4d_1;
show grants;
Grants for test_yesprivs@localhost
@ -409,25 +383,18 @@ GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4d_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2d';
SELECT priv added to bypass bug 15166
-------------------------------------
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.7-2d');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update 3.5.3.7-1b
trig 3.5.3.7-2b
insert 3.5.3.7-1c
trig 3.5.3.7-2c
insert 3.5.3.7-1d
trig 3.5.3.7-2d
update 3.5.3.7-1b
drop trigger trg4d_2;
Testcase 3.5.3.8a:
@ -452,14 +419,14 @@ use priv_db;
show grants;
Grants for test_noprivs@localhost
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
set @test_var = 'before trig 3.5.3.8-1a';
select @test_var;
@test_var
before trig 3.5.3.8-1a
insert into t1 (f1) values ('insert 3.5.3.8-1a');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1a
@ -477,10 +444,6 @@ set @test_var= 'before trig 3.5.3.8-2a';
select @test_var;
@test_var
before trig 3.5.3.8-2a
UPDATE priv added to bypass bug 15166
-------------------------------------
grant UPDATE on *.* to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.8-2a');
select @test_var;
@test_var
@ -511,15 +474,15 @@ Grants for test_noprivs@localhost
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `priv_db`.* TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
set @test_var= 'before trig 3.5.3.8-1b';
insert into t1 (f1) values ('insert 3.5.3.8-1b');
select @test_var;
@test_var
before trig 3.5.3.8-1b
update t1 set f1= 'update 3.5.3.8-1b' where f1 = 'insert 3.5.3.8-1b';
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1b
@ -536,10 +499,6 @@ insert into t1 (f1) values ('insert 3.5.3.8-2b');
select @test_var;
@test_var
before trig 3.5.3.8-2b
UPDATE priv added to bypass bug 15166
-------------------------------------
grant UPDATE on priv_db.* to test_yesprivs@localhost;
update t1 set f1= 'update 3.5.3.8-2b' where f1 = 'insert 3.5.3.8-2b';
select @test_var;
@test_var
@ -570,11 +529,11 @@ Grants for test_noprivs@localhost
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5c_1 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var= 'before trig 3.5.3.8-1c';
insert into t1 (f1) values ('insert 3.5.3.8-1c');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1c
@ -587,10 +546,6 @@ use priv_db;
create trigger trg5c_2 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var='before trig 3.5.3.8-2c';
UPDATE priv added to bypass bug 15166
-------------------------------------
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.8-2c');
select @test_var;
@test_var
@ -620,11 +575,11 @@ Grants for test_noprivs@localhost
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var='before trig 3.5.3.8-1d';
insert into t1 (f1) values ('insert 3.5.3.8-1d');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1d
@ -637,10 +592,6 @@ use priv_db;
create trigger trg5d_2 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var='before trig 3.5.3.8-2d';
UPDATE priv added to bypass bug 15166
-------------------------------------
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.8-2d');
select @test_var;
@test_var
@ -676,10 +627,10 @@ ERROR 42000: INSERT command denied to user 'test_yesprivs'@'localhost' for table
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
grant INSERT on priv_db.t2 to test_yesprivs@localhost;
insert into t1 (f1) values (4);
select f1 from t1;
select f1 from t1 order by f1;
f1
4
select f2 from t2;
select f2 from t2 order by f2;
f2
4
use priv_db;
@ -692,11 +643,11 @@ ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for table
revoke INSERT on priv_db.t2 from test_yesprivs@localhost;
grant UPDATE on priv_db.t2 to test_yesprivs@localhost;
insert into t1 (f1) values (2);
select f1 from t1;
select f1 from t1 order by f1;
f1
4
2
select f2 from t2;
4
select f2 from t2 order by f2;
f2
1
use priv_db;
@ -709,12 +660,12 @@ ERROR 42000: SELECT command denied to user 'test_yesprivs'@'localhost' for table
revoke UPDATE on priv_db.t2 from test_yesprivs@localhost;
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
insert into t1 (f1) values (1);
select f1 from t1;
select f1 from t1 order by f1;
f1
4
2
1
select f2 from t2;
2
4
select f2 from t2 order by f2;
f2
1
select @aaa;
@ -730,13 +681,13 @@ ERROR 42000: DELETE command denied to user 'test_yesprivs'@'localhost' for table
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
grant DELETE on priv_db.t2 to test_yesprivs@localhost;
insert into t1 (f1) values (1);
select f1 from t1;
select f1 from t1 order by f1;
f1
4
1
1
2
1
1
select f2 from t2;
4
select f2 from t2 order by f2;
f2
drop database if exists priv_db;
drop user test_yesprivs@localhost;

View File

@ -58,7 +58,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
Testcase: 3.5:
--------------
@ -86,18 +87,18 @@ 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;
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;
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;
Select * from t1 order by f1;
f1
Trigger 3.5.4.1
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';
@ -251,7 +252,7 @@ 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;
Select * from dbtest_two.t2 order by f1;
f1
1st Insert 3.5.
2nd Insert 3.5.

View File

@ -58,7 +58,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
Testcase: 3.5:
--------------
@ -155,14 +156,22 @@ select @test_var;
3.5.8.4 - single SQL - insert
-----------------------------
Create trigger trg2 BEFORE UPDATE on tb3 for each row
BEGIN
insert into db_test.t1_i
values (new.f120, new.f136, new.f144, new.f163);
END//
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i order by i120;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
update tb3 set f120='I', f122='Test 3.5.8.4-Single Insert'
where f122='Test 3.5.8.4';
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
I Test 3.5.8.4-Single Insert 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i;
select * from db_test.t1_i order by i120;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
I 00222 0000023456 1.050000000000000000000000000000
@ -179,14 +188,14 @@ update tb3 set f120='U', f122='Test 3.5.8.4-Single Update'
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
U Test 3.5.8.4-Single Update 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_u;
select * from db_test.t1_u order by u120;
u120 u136 u144 u163
a 00111 0000099999 999.990000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
f 00333 0000099999 999.990000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
3.5.8.3/4 - single SQL - delete
-------------------------------
@ -199,7 +208,7 @@ f122='Test 3.5.8.4-Single Delete'
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
D Test 3.5.8.4-Single Delete 00444 0000023456 1.050000000000000000000000000000
select * from db_test.t1_d;
select * from db_test.t1_d order by d120;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
@ -246,29 +255,29 @@ END//
set @test_var='Empty', @test_var2=0;
Insert into tb3 (f120, f122, f136) values ('1', 'Test 3.5.8.5-if', 101);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
D Test 3.5.8.5-if 00101 one 2nd else
Insert into tb3 (f120, f122, f136) values ('2', 'Test 3.5.8.5-if', 102);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
D Test 3.5.8.5-if 00101 two 2nd else
D Test 3.5.8.5-if 00102 two 2nd else
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 10);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
d Test 3.5.8.5-if 00010 three 2nd if
D Test 3.5.8.5-if 00101 three 2nd if
D Test 3.5.8.5-if 00102 three 2nd if
d Test 3.5.8.5-if 00010 three 2nd if
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 103);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
d Test 3.5.8.5-if 00010 three 2nd else
D Test 3.5.8.5-if 00101 three 2nd else
D Test 3.5.8.5-if 00102 three 2nd else
d Test 3.5.8.5-if 00010 three 2nd else
D Test 3.5.8.5-if 00103 three 2nd else
create trigger trg3 before update on tb3 for each row
BEGIN
@ -328,20 +337,20 @@ set @test_var='Empty';
Insert into tb3 (f120, f122, f136, f144)
values ('a', 'Test 3.5.8.5-case', 5, 7);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 A*seven
Insert into tb3 (f120, f122, f136, f144)
values ('b', 'Test 3.5.8.5-case', 71,16);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 B*0000000016
B Test 3.5.8.5-case 00191 0000000016 B*0000000016
Insert into tb3 (f120, f122, f136, f144)
values ('c', 'Test 3.5.8.5-case', 80,1);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 C=one
B Test 3.5.8.5-case 00191 0000000016 C=one
@ -351,34 +360,34 @@ values ('d', 'Test 3.5.8.5-case', 152);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
A Test 3.5.8.5-case 00125 0000000007 1*0000099999
B Test 3.5.8.5-case 00191 0000000016 1*0000099999
C Test 3.5.8.5-case 00200 0000000001 1*0000099999
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
Insert into tb3 (f120, f122, f136, f144)
values ('e', 'Test 3.5.8.5-case', 200, 8);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
A Test 3.5.8.5-case 00125 0000000007 1=eight
B Test 3.5.8.5-case 00191 0000000016 1=eight
C Test 3.5.8.5-case 00200 0000000001 1=eight
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
Insert into tb3 (f120, f122, f136, f144)
values ('f', 'Test 3.5.8.5-case', 100, 8);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
A Test 3.5.8.5-case 00125 0000000007 1=eight
B Test 3.5.8.5-case 00191 0000000016 1=eight
C Test 3.5.8.5-case 00200 0000000001 1=eight
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
create trigger trg3a before update on tb3 for each row
BEGIN
CASE
@ -484,9 +493,38 @@ drop trigger trg7;
Testcase 3.5.8.6: (requirement void)
------------------------------------
CREATE PROCEDURE sp_01 () BEGIN set @v1=1; END//
CREATE TRIGGER trg8_1 BEFORE UPDATE ON tb3 FOR EACH ROW
BEGIN
CALL sp_01 ();
END//
Insert into tb3 (f120, f122, f136) values ('6', 'Test 3.5.8.6-insert', 101);
update tb3 set f120='S', f136=111,
f122='Test 3.5.8.6-tr8_1'
where f122='Test 3.5.8.6-insert';
select f120, f122
from tb3 where f122 like 'Test 3.5.8.6%' order by f120;
f120 f122
S Test 3.5.8.6-tr8_1
DROP TRIGGER trg8_1;
DROP PROCEDURE sp_01;
Testcase 3.5.8.7: (Disabled as a result of bug _____)
-----------------------------------------------------
Testcase 3.5.8.7
----------------
Create trigger trg9_1 before update on tb3 for each row
BEGIN
Start transaction;
Set new.f120='U';
Commit;
END//
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
Create trigger trg9_2 before delete on tb3 for each row
BEGIN
Start transaction;
Set @var2=old.f120;
Rollback;
END//
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;

View File

@ -58,7 +58,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
Testcase 3.5.9.1/2:
-------------------
@ -113,7 +114,7 @@ set @tr_var_af_118=old.f118, @tr_var_af_121=old.f121,
Insert into tb3 (f122, f136, f163)
values ('Test 3.5.9.3', 7, 123.17);
Update tb3 Set f136=8 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
f118 f121 f122 f136 f163
a NULL Test 3.5.9.3 00008 123.170000000000000000000000000000
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@ -129,7 +130,7 @@ a NULL Test 3.5.9.3 7 123.170000000000000000000000000000
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
0 0 0 0 0
delete from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
f118 f121 f122 f136 f163
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_163;
@ -169,7 +170,7 @@ set @tr_var_af_118=new.f118, @tr_var_af_121=new.f121,
Insert into tb3 (f122, f136, f151, f163)
values ('Test 3.5.9.4', 7, DEFAULT, 995.24);
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4%';
where f122 like 'Test 3.5.9.4%' order by f163;
f118 f121 f122 f136 f151 f163
a NULL Test 3.5.9.4 00007 999 995.240000000000000000000000000000
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@ -189,7 +190,7 @@ where f122='Test 3.5.9.4';
Warnings:
Warning 1048 Column 'f136' cannot be null
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4-trig';
where f122 like 'Test 3.5.9.4-trig' order by f163;
f118 f121 f122 f136 f151 f163
a NULL Test 3.5.9.4-trig 00000 999 NULL
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@ -234,6 +235,7 @@ ERROR HY000: There is no NEW row in on DELETE trigger
create trigger trg5b after DELETE on tb3 for each row
set new.f122='test';
ERROR HY000: There is no NEW row in on DELETE trigger
drop trigger trg5a;
drop trigger trg5b;
Testcase 3.5.9.10: (implied in previous tests)

View File

@ -58,7 +58,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb3.txt'
into table tb3;
Testcase 3.5.10.1/2/3:
----------------------
@ -80,7 +81,7 @@ Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 1);
Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 2);
Insert into vw11 (f122, f151) values ('Not in View', 3);
select f121, f122, f151, f163
from tb3 where f122 like 'Test 3.5.10.1/2/3%';
from tb3 where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
NULL Test 3.5.10.1/2/3 1 111.110000000000000000000000000000
NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
@ -94,7 +95,7 @@ f121 f122 f151 f163
NULL Not in View 3 111.110000000000000000000000000000
Update vw11 set f163=1;
select f121, f122, f151, f163 from tb3
where f122 like 'Test 3.5.10.1/2/3%';
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
Y Test 3.5.10.1/2/3-Update 1 1.000000000000000000000000000000
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
@ -108,7 +109,7 @@ before delete
0
delete from vw11 where f151=1;
select f121, f122, f151, f163 from tb3
where f122 like 'Test 3.5.10.1/2/3%';
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
select f121, f122, f151, f163 from vw11;
@ -135,11 +136,11 @@ set @counter= 0;
select @counter as 'Rows Loaded Before';
Rows Loaded Before
0
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table tb_load;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table tb_load;
select @counter as 'Rows Loaded After';
Rows Loaded After
10
Select * from tb_load limit 10;
Select * from tb_load order by f1 limit 10;
f1 f2 f3
-5000 a` 1000
-4999 aaa 999
@ -234,7 +235,7 @@ insert into t3 (f1) values (new.f1+1000);
create trigger tr2_4 after insert on t2_4 for each row
insert into t3 (f1) values (new.f1+10000);
insert into t1 values (1);
select * from t3;
select * from t3 order by f1;
f1
12
102
@ -269,17 +270,17 @@ create trigger tr4 after insert on t4
for each row insert into t1 (f1) values (new.f4+1);
insert into t1 values (1);
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
select * from t1;
select * from t1 order by f1;
f1
0
1
select * from t2;
select * from t2 order by f2;
f2
2
select * from t3;
select * from t3 order by f3;
f3
3
select * from t4;
select * from t4 order by f4;
f4
4
drop trigger tr1;
@ -291,8 +292,8 @@ drop table t2;
drop table t3;
drop table t4;
Testcase y.y.y.4: Recursive trigger/SP references (disabled bug 11889)
----------------------------------------------------------------------
Testcase y.y.y.4: Recursive trigger/SP references
-------------------------------------------------
set @sql_mode='traditional';
create table t1_sp (
count integer,
@ -380,14 +381,14 @@ start transaction;
insert into t1 values (1);
ERROR 22003: Out of range value adjusted for column 'f4' at row 1
commit;
select * from t1;
select * from t1 order by f1;
f1
1
1
select * from t2;
select * from t2 order by f2;
f2
2
select * from t3;
select * from t3 order by f3;
f3
3
drop trigger tr1;

View File

@ -53,7 +53,8 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb2.txt' into table tb2 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb2.txt'
into table tb2 ;
DROP DATABASE IF EXISTS test1;
CREATE DATABASE test1;
USE test1;
@ -111,7 +112,8 @@ f107 year(4) not null default 2000,
f108 enum("1enum","2enum") not null default "1enum",
f109 set("1set","2set") not null default "1set"
) engine = memory;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/memory_tb2.txt' into table tb2 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/memory_tb2.txt'
into table tb2 ;
USE test;
! Attention: The file with the expected results is not

File diff suppressed because it is too large Load Diff

View File

@ -9,20 +9,25 @@ DROP DATABASE IF EXISTS db_storedproc_1;
CREATE DATABASE db_storedproc;
CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t4;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t6;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t7;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -34,8 +39,9 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t8;
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -47,12 +53,14 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
Section 3.1.2 - Syntax checks for the stored procedure-specific
programming statements BEGIN/END, DECLARE, SET, SELECT/INTO, OPEN, FETCH, CLOSE:
@ -164,7 +172,7 @@ declare y integer default 1;
set @x = x;
set @y = y;
set @z = 234;
SELECT f1, f2 into @x, @y from t2 limit 1;
SELECT f1, f2 into @x, @y from t2 where f1='a`' and f2='a`' limit 1;
SELECT @x, @y, @z, invar;
BEGIN
set @x = 2;
@ -207,7 +215,7 @@ BEGIN
declare x integer; declare y integer;
set @x=x;
set @y=y;
SELECT f4, f3 into @x, @y from t2 limit 1;
SELECT f4, f3 into @x, @y from t2 where f4=-5000 and f3='1000-01-01' limit 1;
SELECT @x, @y;
END//
CALL sp1();
@ -695,7 +703,7 @@ Testcase 3.1.2.54:
------------------
Ensure that a handler with a condition defined with an SQLSTATE that begins with
“01“ is always exactly equivalent in action to a handler with an SQLWARNING
“01“ is always exactly equivalent in action to a handler with an SQLWARNING
condition.
--------------------------------------------------------------------------------
DROP PROCEDURE IF EXISTS sp0;
@ -794,7 +802,7 @@ Testcase 3.1.2.56:
------------------
Ensure that a handler with a condition defined with an SQLSTATE that begins with
“02“ is always exactly equivalent in action to a handler with a NOT FOUND
“02“ is always exactly equivalent in action to a handler with a NOT FOUND
condition.
--------------------------------------------------------------------------------
DROP PROCEDURE IF EXISTS sp0;
@ -902,7 +910,7 @@ Testcase 3.1.2.58:
------------------
Ensure that a handler with a condition defined with an SQLSTATE that begins with
anything other that “01“ or “02“ is always exactly equivalent in action to a
anything other that “01“ or “02“ is always exactly equivalent in action to a
handler with an SQLEXCEPTION condition.
--------------------------------------------------------------------------------
DROP PROCEDURE IF EXISTS sp0;
@ -1082,7 +1090,8 @@ declare f2_value char(20);
declare f5_value char(20);
declare f4_value integer;
declare f6_value integer;
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2 limit 3;
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2
where f4 >=-5000 order by f4 limit 3;
open cur1;
while proceed do
SELECT count AS 'loop';
@ -1165,7 +1174,7 @@ of a compound statement ends.
DROP TABLE IF EXISTS temp1;
DROP PROCEDURE IF EXISTS sp1;
create table temp1( f0 char(20), f1 char(20), f2 char(20), f3 int, f4 char(20) );
SELECT f1, f2, f4, f5 from t2;
SELECT f1, f2, f4, f5 from t2 order by f4;
f1 f2 f4 f5
a` a` -5000 a`
aaa aaa -4999 aaa
@ -1185,8 +1194,8 @@ declare newf1 char(20);
declare newf2 char(20);
declare newf5 char(20);
declare newf4 integer;
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
open cur1;
open cur2;
BEGIN
@ -1268,8 +1277,10 @@ declare i_newf11 char(20);
declare i_newf12 char(20);
declare i_newf13 date;
declare i_newf14 integer;
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2 limit 4;
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2 limit 3;
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2
where f4>=-5000 order by f4 limit 4;
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2
where f4>=-5000 order by f4 limit 3;
declare continue handler for sqlstate '02000' set proceed=0;
open cur1;
open cur2;
@ -1300,8 +1311,10 @@ DECLARE o_newf11 CHAR(20);
DECLARE o_newf12 CHAR(20);
DECLARE o_newf13 DATE;
DECLARE o_newf14 INTEGER;
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET proceed=0;
OPEN cur1;
OPEN cur2;

View File

@ -9,20 +9,25 @@ DROP DATABASE IF EXISTS db_storedproc_1;
CREATE DATABASE db_storedproc;
CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t4;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t6;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t7;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -34,8 +39,9 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t8;
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -47,12 +53,14 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
Section 3.1.3 - Syntax checks for the stored procedure-specific flow
control statements IF, CASE, LOOP, LEAVE, ITERATE, REPEAT, WHILE:

View File

@ -9,20 +9,25 @@ DROP DATABASE IF EXISTS db_storedproc_1;
CREATE DATABASE db_storedproc;
CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t4;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t6;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t7;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -34,8 +39,9 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t8;
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -47,12 +53,14 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
Section 3.1.6 - Privilege Checks:
--------------------------------------------------------------------------------
@ -79,6 +87,7 @@ BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
ERROR 42000: Access denied for user 'user_1'@'localhost' to database 'db_storedproc_1'
USE db_storedproc_1;
root@localhost db_storedproc_1
GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost';
@ -90,6 +99,7 @@ CREATE PROCEDURE sp1(v1 char(20))
BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
END//
USE db_storedproc_1;
root@localhost db_storedproc_1
DROP USER 'user_1'@'localhost';
@ -115,6 +125,7 @@ CREATE FUNCTION fn1(v1 int) returns int
BEGIN
return v1;
END//
USE db_storedproc_1;
root@localhost db_storedproc_1
drop user 'user_1'@'localhost';

View File

@ -9,20 +9,25 @@ DROP DATABASE IF EXISTS db_storedproc_1;
CREATE DATABASE db_storedproc;
CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t4;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t6;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t7;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -34,8 +39,9 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t8;
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -47,12 +53,14 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
Section 3.1.7 - SQL mode checks:
--------------------------------------------------------------------------------

View File

@ -9,20 +9,25 @@ DROP DATABASE IF EXISTS db_storedproc_1;
CREATE DATABASE db_storedproc;
CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t4;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t6;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t7;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -34,8 +39,9 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t8;
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -47,12 +53,14 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
Section 3.1.8 - SHOW statement checks:
--------------------------------------------------------------------------------

View File

@ -9,20 +9,25 @@ DROP DATABASE IF EXISTS db_storedproc_1;
CREATE DATABASE db_storedproc;
CREATE DATABASE db_storedproc_1;
USE db_storedproc;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t4;
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t1;
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t2;
create table t3(f1 char(20),f2 char(20),f3 integer) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t3.txt' into table t3;
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t6;
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t6;
USE db_storedproc;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t7;
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t7;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -34,8 +39,9 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t8;
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t7.txt' into table t8;
Warnings:
Warning 1265 Data truncated for column 'f3' at row 1
Warning 1265 Data truncated for column 'f3' at row 2
@ -47,12 +53,14 @@ Warning 1265 Data truncated for column 'f3' at row 7
Warning 1265 Data truncated for column 'f3' at row 8
Warning 1265 Data truncated for column 'f3' at row 9
Warning 1265 Data truncated for column 'f3' at row 10
create table t9(f1 int, f2 char(25), f3 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
create table t9(f1 int, f2 char(25), f3 int) engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table t9;
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t10;
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = <engine_to_be_tested>;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t4.txt' into table t11;
Section 3.1.10 - CALL checks:
--------------------------------------------------------------------------------
@ -78,7 +86,7 @@ connect(localhost,user_1,,db_storedproc,MYSQL_PORT,MYSQL_SOCK);
user_1@localhost db_storedproc
CREATE PROCEDURE sp31102 () SQL SECURITY INVOKER
BEGIN
SELECT * FROM db_storedproc.t1 LIMIT 1;
SELECT * FROM db_storedproc.t1 WHERE f4=-5000 LIMIT 1;
END//
CREATE FUNCTION fn31105(n INT) RETURNS INT
BEGIN
@ -93,6 +101,8 @@ CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
connection default;
USE db_storedproc;
root@localhost db_storedproc
CALL sp31102();
@ -112,6 +122,8 @@ a` a` 1000-01-01 -5000 a` -5000
SELECT fn31105( 9 );
fn31105( 9 )
81
connection default;
USE db_storedproc;
root@localhost db_storedproc
REVOKE EXECUTE ON db_storedproc.* FROM 'user_2'@'localhost';
@ -129,6 +141,7 @@ CALL sp31102();
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.sp31102'
SELECT fn31105( 9 );
ERROR 42000: execute command denied to user 'user_2'@'localhost' for routine 'db_storedproc.fn31105'
USE db_storedproc;
root@localhost db_storedproc
DROP PROCEDURE sp31102;
@ -176,6 +189,8 @@ DROP PROCEDURE IF EXISTS sp_ins_1;
DROP PROCEDURE IF EXISTS sp_ins_3;
DROP PROCEDURE IF EXISTS sp_upd;
DROP PROCEDURE IF EXISTS sp_ins_upd;
DROP PROCEDURE IF EXISTS sp_del;
DROP PROCEDURE IF EXISTS sp_with_rowcount;
CREATE TABLE temp(f1 CHAR(20),f2 CHAR(25),f3 DATE,f4 INT,f5 CHAR(25),f6 INT);
INSERT INTO temp SELECT * FROM t10;
CREATE PROCEDURE sp_ins_1()
@ -203,49 +218,72 @@ END;
SELECT COUNT( f1 ), f1 FROM temp GROUP BY f1;
UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f1 ='qwe' AND temp.f2 = 'abc';
END//
CREATE PROCEDURE sp_del()
BEGIN
DELETE FROM temp WHERE temp.f1 ='qwe' OR temp.f1 = 'updated_2';
END//
CREATE PROCEDURE sp_with_rowcount()
BEGIN
BEGIN
INSERT INTO temp VALUES ('qwe', 'abc', '1989-11-09', 100, 'uvw', 1000),
('qwe', 'xyz', '1998-03-26', 100, 'uvw', 1000),
('qwe', 'abc', '2000-11-09', 100, 'uvw', 1000),
('qwe', 'xyz', '2005-11-07', 100, 'uvw', 1000);
END;
SELECT row_count() AS 'row_count() after insert';
SELECT row_count() AS 'row_count() after select row_count()';
SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3;
UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f2 = 'abc';
SELECT row_count() AS 'row_count() after update';
SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3;
DELETE FROM temp WHERE temp.f1 = 'updated_2';
SELECT row_count() AS 'row_count() after delete';
END//
CALL sp_ins_1();
SELECT row_count();
row_count()
1
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
abc abc 2005-10-03 100 uvw 1000
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
abc abc 2005-10-03 100 uvw 1000
CALL sp_ins_3();
SELECT row_count();
row_count()
1
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
abc abc 2005-10-03 100 uvw 1000
abc xyz 1949-05-23 100 uvw 1000
abc xyz 1989-11-09 100 uvw 1000
abc xyz 2005-10-24 100 uvw 1000
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
abc abc 2005-10-03 100 uvw 1000
abc xyz 1949-05-23 100 uvw 1000
abc xyz 1989-11-09 100 uvw 1000
abc xyz 2005-10-24 100 uvw 1000
CALL sp_upd();
SELECT row_count();
row_count()
4
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
@ -254,8 +292,6 @@ adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
@ -279,6 +315,8 @@ row_count()
3
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
@ -287,20 +325,67 @@ adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
qwe xyz 1998-03-26 100 uvw 1000
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
updated xyz 2005-10-24 100 uvw 1000
updated_2 abc 1989-11-09 100 uvw 1000
qwe xyz 1998-03-26 100 uvw 1000
updated_2 abc 2000-11-09 100 uvw 1000
updated_2 abc 2005-11-07 100 uvw 1000
CALL sp_del();
SELECT row_count();
row_count()
4
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
a^aaaaaaaa a^aaaaaaaa 1000-01-09 -4992 a^aaaaaaaa -4992
a_aaaaaaaaa a_aaaaaaaaa 1000-01-10 -4991 a_aaaaaaaaa -4991
a` a` 1000-01-01 -5000 a` -5000
aaa aaa 1000-01-02 -4999 aaa -4999
abaa abaa 1000-01-03 -4998 abaa -4998
acaaa acaaa 1000-01-04 -4997 acaaa -4997
adaaaa adaaaa 1000-01-05 -4996 adaaaa -4996
aeaaaaa aeaaaaa 1000-01-06 -4995 aeaaaaa -4995
afaaaaaa afaaaaaa 1000-01-07 -4994 afaaaaaa -4994
agaaaaaaa agaaaaaaa 1000-01-08 -4993 agaaaaaaa -4993
updated abc 2005-10-03 100 uvw 1000
updated xyz 1949-05-23 100 uvw 1000
updated xyz 1989-11-09 100 uvw 1000
updated xyz 2005-10-24 100 uvw 1000
DELETE FROM temp;
CALL sp_with_rowcount();
row_count() after insert
4
row_count() after select row_count()
-1
f1 f2 f3
qwe abc 1989-11-09
qwe abc 2000-11-09
qwe xyz 1998-03-26
qwe xyz 2005-11-07
row_count() after update
2
f1 f2 f3
qwe xyz 1998-03-26
qwe xyz 2005-11-07
updated_2 abc 1989-11-09
updated_2 abc 2000-11-09
row_count() after delete
2
SELECT row_count();
row_count()
-1
SELECT * FROM temp;
f1 f2 f3 f4 f5 f6
qwe xyz 1998-03-26 100 uvw 1000
qwe xyz 2005-11-07 100 uvw 1000
DROP PROCEDURE sp_ins_1;
DROP PROCEDURE sp_ins_3;
DROP PROCEDURE sp_upd;
DROP PROCEDURE sp_ins_upd;
DROP PROCEDURE sp_del;
DROP PROCEDURE sp_with_rowcount;
DROP TABLE temp;
Testcase 3.1.10.8:

View File

@ -64,7 +64,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb3.txt'
into table tb3;
Testcase: 3.5.1.1:
------------------
@ -206,7 +207,7 @@ update t1 set f2='update 3.5.1.7';
select * from t1;
f1 f2 f3
NULL update 3.5.1.7 42
select trigger_name from information_schema.triggers;
select trigger_name from information_schema.triggers order by trigger_name;
trigger_name
trg5_1
trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWX
@ -313,7 +314,7 @@ insert into trig_db3.t1 (f1,f2) values ('insert to db3 t1 from db1',4);
select @test_var1, @test_var2, @test_var3;
@test_var1 @test_var2 @test_var3
trig1 trig2 trig3
select * from t1;
select * from t1 order by f2;
f1 f2
trig1 1
trig1 2
@ -323,7 +324,7 @@ trig2 3
select * from trig_db3.t1;
f1 f2
trig3 4
select * from t1;
select * from t1 order by f2;
f1 f2
trig1 1
trig1 2
@ -348,10 +349,10 @@ for each row set @test_var2='trig1_a';
create trigger trig_db2.trig2 before insert on trig_db2.t1
for each row set @test_var3='trig2';
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers;
from information_schema.triggers order by trigger_name;
trigger_schema trigger_name event_object_table
trig_db1 trig1_b t1
trig_db1 trig1_a t1
trig_db1 trig1_b t1
trig_db2 trig2 t1
set @test_var1= '', @test_var2= '', @test_var3= '';
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);

View File

@ -64,7 +64,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb3.txt'
into table tb3;
Testcase 3.5.3:
---------------
@ -106,7 +107,7 @@ set new.f1 = 'trig 3.5.3.2_1-no';
ERROR 42000: Access denied; you need the SUPER privilege for this operation
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.2-no');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
select current_user;
@ -121,15 +122,12 @@ root@localhost
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.2-yes');
ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
note: once 15166 is fixed a similar case for SELECT needs to be added
---------------------------------------------------------------------
insert into t1 (f1) values ('insert 3.5.3.2-yes');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
@ -141,7 +139,7 @@ drop trigger trg1_2;
ERROR 42000: Access denied; you need the SUPER privilege for this operation
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-yes');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
@ -150,12 +148,12 @@ use priv_db;
drop trigger trg1_2;
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-no');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
drop trigger trg1_2;
Testcase 3.5.3.7a:
@ -180,23 +178,22 @@ use priv_db;
show grants;
Grants for test_noprivs@localhost
GRANT SELECT, INSERT, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
Trigger create disabled - should fail - Bug 8884
------------------------------------------------
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
create trigger trg4a_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1a';
insert into t1 (f1) values ('insert 3.5.3.7-1a');
select f1 from t1;
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
drop trigger trg4a_1;
use priv_db;
select current_user;
@ -207,18 +204,13 @@ Grants for test_yesprivs@localhost
GRANT UPDATE, SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
create trigger trg4a_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2a';
SELECT priv added to bypass bug 15166
-------------------------------------
grant SELECT on *.* to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.7-2b');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
drop trigger trg4a_2;
@ -245,30 +237,29 @@ Grants for test_noprivs@localhost
GRANT USAGE ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `priv_db`.* TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8884
------------------------------------------------
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
ERROR 42000: Access denied; you need the SUPER privilege for this operation
insert into t1 (f1) values ('insert 3.5.3.7-1b');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.7-2a
insert 3.5.3.7-1b
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update t1 set f1 = 'update 3.5.3.7-1b' where f1 = 'insert 3.5.3.7-1b';
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update 3.5.3.7-1b
drop trigger trg4b_1;
ERROR HY000: Trigger does not exist
show grants;
Grants for test_yesprivs@localhost
GRANT SUPER ON *.* TO 'test_yesprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
@ -276,32 +267,26 @@ GRANT UPDATE ON `priv_db`.* TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4b_2 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-2b';
SELECT priv added to bypass bug 15166
-------------------------------------
grant SELECT on priv_db.* to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.7-2b');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.7-2a
update 3.5.3.7-1b
insert 3.5.3.7-2b
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
select f1 from t1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.7-2a
update 3.5.3.7-1b
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
insert 3.5.3.6-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
trig 3.5.3.7-2b
update 3.5.3.7-1b
drop trigger trg4b_2;
Testcase 3.5.3.7c
@ -327,21 +312,19 @@ Grants for test_noprivs@localhost
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT, INSERT, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8884
------------------------------------------------
create trigger trg4c_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1c';
insert into t1 (f1) values ('insert 3.5.3.7-1c');
select f1 from t1;
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update 3.5.3.7-1b
trig 3.5.3.7-2b
insert 3.5.3.7-1c
update 3.5.3.7-1b
drop trigger trg4c_1;
show grants;
Grants for test_yesprivs@localhost
@ -350,23 +333,17 @@ GRANT UPDATE ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4c_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2c';
SELECT priv added to bypass bug 15166
-------------------------------------
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.7-2c');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update 3.5.3.7-1b
trig 3.5.3.7-2b
insert 3.5.3.7-1c
trig 3.5.3.7-2c
update 3.5.3.7-1b
drop trigger trg4c_2;
Testcase 3.5.3.7d:
@ -390,23 +367,20 @@ Grants for test_noprivs@localhost
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT SELECT (f1), INSERT (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8884
------------------------------------------------
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
insert into t1 (f1) values ('insert 3.5.3.7-1d');
select f1 from t1;
ERROR 42000: UPDATE command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update 3.5.3.7-1b
trig 3.5.3.7-2b
insert 3.5.3.7-1c
trig 3.5.3.7-2c
insert 3.5.3.7-1d
update 3.5.3.7-1b
drop trigger trg4d_1;
show grants;
Grants for test_yesprivs@localhost
@ -415,25 +389,18 @@ GRANT UPDATE (f1) ON `priv_db`.`t1` TO 'test_yesprivs'@'localhost'
use priv_db;
create trigger trg4d_2 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-2d';
SELECT priv added to bypass bug 15166
-------------------------------------
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.7-2d');
select f1 from t1;
select f1 from t1 order by f1;
f1
insert 3.5.3.2-no
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
insert 3.5.3.6-no
insert 3.5.3.7-1a
trig 3.5.3.2_2-yes
trig 3.5.3.2_2-yes
trig 3.5.3.7-2a
update 3.5.3.7-1b
trig 3.5.3.7-2b
insert 3.5.3.7-1c
trig 3.5.3.7-2c
insert 3.5.3.7-1d
trig 3.5.3.7-2d
update 3.5.3.7-1b
drop trigger trg4d_2;
Testcase 3.5.3.8a:
@ -458,14 +425,14 @@ use priv_db;
show grants;
Grants for test_noprivs@localhost
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, RELOAD, SHUTDOWN, PROCESS, FILE, REFERENCES, INDEX, ALTER, SHOW DATABASES, SUPER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, REPLICATION SLAVE, REPLICATION CLIENT, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE, CREATE USER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
set @test_var = 'before trig 3.5.3.8-1a';
select @test_var;
@test_var
before trig 3.5.3.8-1a
insert into t1 (f1) values ('insert 3.5.3.8-1a');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1a
@ -483,10 +450,6 @@ set @test_var= 'before trig 3.5.3.8-2a';
select @test_var;
@test_var
before trig 3.5.3.8-2a
UPDATE priv added to bypass bug 15166
-------------------------------------
grant UPDATE on *.* to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.8-2a');
select @test_var;
@test_var
@ -517,15 +480,15 @@ Grants for test_noprivs@localhost
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, EXECUTE, CREATE VIEW, SHOW VIEW, CREATE ROUTINE, ALTER ROUTINE ON `priv_db`.* TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
set @test_var= 'before trig 3.5.3.8-1b';
insert into t1 (f1) values ('insert 3.5.3.8-1b');
select @test_var;
@test_var
before trig 3.5.3.8-1b
update t1 set f1= 'update 3.5.3.8-1b' where f1 = 'insert 3.5.3.8-1b';
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1b
@ -542,10 +505,6 @@ insert into t1 (f1) values ('insert 3.5.3.8-2b');
select @test_var;
@test_var
before trig 3.5.3.8-2b
UPDATE priv added to bypass bug 15166
-------------------------------------
grant UPDATE on priv_db.* to test_yesprivs@localhost;
update t1 set f1= 'update 3.5.3.8-2b' where f1 = 'insert 3.5.3.8-2b';
select @test_var;
@test_var
@ -576,11 +535,11 @@ Grants for test_noprivs@localhost
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT, UPDATE, DELETE, CREATE, DROP, REFERENCES, INDEX, ALTER, CREATE VIEW, SHOW VIEW ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5c_1 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var= 'before trig 3.5.3.8-1c';
insert into t1 (f1) values ('insert 3.5.3.8-1c');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1c
@ -593,10 +552,6 @@ use priv_db;
create trigger trg5c_2 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var='before trig 3.5.3.8-2c';
UPDATE priv added to bypass bug 15166
-------------------------------------
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.8-2c');
select @test_var;
@test_var
@ -626,11 +581,11 @@ Grants for test_noprivs@localhost
GRANT SUPER ON *.* TO 'test_noprivs'@'localhost' IDENTIFIED BY PASSWORD '*C49735D016A099C0CF104EF9183F374A54CA2576'
GRANT INSERT (f1), UPDATE (f1) ON `priv_db`.`t1` TO 'test_noprivs'@'localhost'
use priv_db;
Trigger create disabled - should fail - Bug 8887
------------------------------------------------
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var='before trig 3.5.3.8-1d';
insert into t1 (f1) values ('insert 3.5.3.8-1d');
ERROR 42000: SELECT command denied to user 'test_noprivs'@'localhost' for column 'f1' in table 't1'
select @test_var;
@test_var
before trig 3.5.3.8-1d
@ -643,10 +598,6 @@ use priv_db;
create trigger trg5d_2 before INSERT on t1 for each row
set @test_var= new.f1;
set @test_var='before trig 3.5.3.8-2d';
UPDATE priv added to bypass bug 15166
-------------------------------------
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.8-2d');
select @test_var;
@test_var
@ -682,10 +633,10 @@ ERROR 42000: INSERT command denied to user 'test_yesprivs'@'localhost' for table
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
grant INSERT on priv_db.t2 to test_yesprivs@localhost;
insert into t1 (f1) values (4);
select f1 from t1;
select f1 from t1 order by f1;
f1
4
select f2 from t2;
select f2 from t2 order by f2;
f2
4
use priv_db;
@ -698,11 +649,11 @@ ERROR 42000: UPDATE command denied to user 'test_yesprivs'@'localhost' for table
revoke INSERT on priv_db.t2 from test_yesprivs@localhost;
grant UPDATE on priv_db.t2 to test_yesprivs@localhost;
insert into t1 (f1) values (2);
select f1 from t1;
select f1 from t1 order by f1;
f1
4
2
select f2 from t2;
4
select f2 from t2 order by f2;
f2
1
use priv_db;
@ -715,12 +666,12 @@ ERROR 42000: SELECT command denied to user 'test_yesprivs'@'localhost' for table
revoke UPDATE on priv_db.t2 from test_yesprivs@localhost;
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
insert into t1 (f1) values (1);
select f1 from t1;
select f1 from t1 order by f1;
f1
4
2
1
select f2 from t2;
2
4
select f2 from t2 order by f2;
f2
1
select @aaa;
@ -736,13 +687,13 @@ ERROR 42000: DELETE command denied to user 'test_yesprivs'@'localhost' for table
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
grant DELETE on priv_db.t2 to test_yesprivs@localhost;
insert into t1 (f1) values (1);
select f1 from t1;
select f1 from t1 order by f1;
f1
4
1
1
2
1
1
select f2 from t2;
4
select f2 from t2 order by f2;
f2
drop database if exists priv_db;
drop user test_yesprivs@localhost;

View File

@ -64,7 +64,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb3.txt'
into table tb3;
Testcase: 3.5:
--------------
@ -92,18 +93,18 @@ 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;
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;
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;
Select * from t1 order by f1;
f1
Trigger 3.5.4.1
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';
@ -257,7 +258,7 @@ 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;
Select * from dbtest_two.t2 order by f1;
f1
1st Insert 3.5.
2nd Insert 3.5.

View File

@ -64,7 +64,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb3.txt'
into table tb3;
Testcase: 3.5:
--------------
@ -161,14 +162,22 @@ select @test_var;
3.5.8.4 - single SQL - insert
-----------------------------
Create trigger trg2 BEFORE UPDATE on tb3 for each row
BEGIN
insert into db_test.t1_i
values (new.f120, new.f136, new.f144, new.f163);
END//
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
1 Test 3.5.8.4 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i order by i120;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
update tb3 set f120='I', f122='Test 3.5.8.4-Single Insert'
where f122='Test 3.5.8.4';
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
I Test 3.5.8.4-Single Insert 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_i;
select * from db_test.t1_i order by i120;
i120 i136 i144 i163
1 00222 0000023456 1.050000000000000000000000000000
I 00222 0000023456 1.050000000000000000000000000000
@ -185,14 +194,14 @@ update tb3 set f120='U', f122='Test 3.5.8.4-Single Update'
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
U Test 3.5.8.4-Single Update 00222 0000023456 1.050000000000000000000000000000
select * from db_test.t1_u;
select * from db_test.t1_u order by u120;
u120 u136 u144 u163
a 00111 0000099999 999.990000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
f 00333 0000099999 999.990000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
U 00222 0000023456 1.050000000000000000000000000000
3.5.8.3/4 - single SQL - delete
-------------------------------
@ -205,7 +214,7 @@ f122='Test 3.5.8.4-Single Delete'
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
f120 f122 f136 f144 f163
D Test 3.5.8.4-Single Delete 00444 0000023456 1.050000000000000000000000000000
select * from db_test.t1_d;
select * from db_test.t1_d order by d120;
d120 d136 d144 d163
a 00111 0000099999 999.990000000000000000000000000000
c 00333 0000099999 999.990000000000000000000000000000
@ -252,29 +261,29 @@ END//
set @test_var='Empty', @test_var2=0;
Insert into tb3 (f120, f122, f136) values ('1', 'Test 3.5.8.5-if', 101);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
D Test 3.5.8.5-if 00101 one 2nd else
Insert into tb3 (f120, f122, f136) values ('2', 'Test 3.5.8.5-if', 102);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
D Test 3.5.8.5-if 00101 two 2nd else
D Test 3.5.8.5-if 00102 two 2nd else
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 10);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
d Test 3.5.8.5-if 00010 three 2nd if
D Test 3.5.8.5-if 00101 three 2nd if
D Test 3.5.8.5-if 00102 three 2nd if
d Test 3.5.8.5-if 00010 three 2nd if
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 103);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
f120 f122 f136 @test_var @test_var2
d Test 3.5.8.5-if 00010 three 2nd else
D Test 3.5.8.5-if 00101 three 2nd else
D Test 3.5.8.5-if 00102 three 2nd else
d Test 3.5.8.5-if 00010 three 2nd else
D Test 3.5.8.5-if 00103 three 2nd else
create trigger trg3 before update on tb3 for each row
BEGIN
@ -334,20 +343,20 @@ set @test_var='Empty';
Insert into tb3 (f120, f122, f136, f144)
values ('a', 'Test 3.5.8.5-case', 5, 7);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 A*seven
Insert into tb3 (f120, f122, f136, f144)
values ('b', 'Test 3.5.8.5-case', 71,16);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 B*0000000016
B Test 3.5.8.5-case 00191 0000000016 B*0000000016
Insert into tb3 (f120, f122, f136, f144)
values ('c', 'Test 3.5.8.5-case', 80,1);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
A Test 3.5.8.5-case 00125 0000000007 C=one
B Test 3.5.8.5-case 00191 0000000016 C=one
@ -357,34 +366,34 @@ values ('d', 'Test 3.5.8.5-case', 152);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
A Test 3.5.8.5-case 00125 0000000007 1*0000099999
B Test 3.5.8.5-case 00191 0000000016 1*0000099999
C Test 3.5.8.5-case 00200 0000000001 1*0000099999
1 Test 3.5.8.5-case 00152 0000099999 1*0000099999
Insert into tb3 (f120, f122, f136, f144)
values ('e', 'Test 3.5.8.5-case', 200, 8);
Warnings:
Warning 1265 Data truncated for column 'f120' at row 1
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
A Test 3.5.8.5-case 00125 0000000007 1=eight
B Test 3.5.8.5-case 00191 0000000016 1=eight
C Test 3.5.8.5-case 00200 0000000001 1=eight
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
Insert into tb3 (f120, f122, f136, f144)
values ('f', 'Test 3.5.8.5-case', 100, 8);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
f120 f122 f136 f144 @test_var
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
A Test 3.5.8.5-case 00125 0000000007 1=eight
B Test 3.5.8.5-case 00191 0000000016 1=eight
C Test 3.5.8.5-case 00200 0000000001 1=eight
1 Test 3.5.8.5-case 00152 0000099999 1=eight
1 Test 3.5.8.5-case 00200 0000000008 1=eight
create trigger trg3a before update on tb3 for each row
BEGIN
CASE
@ -490,9 +499,38 @@ drop trigger trg7;
Testcase 3.5.8.6: (requirement void)
------------------------------------
CREATE PROCEDURE sp_01 () BEGIN set @v1=1; END//
CREATE TRIGGER trg8_1 BEFORE UPDATE ON tb3 FOR EACH ROW
BEGIN
CALL sp_01 ();
END//
Insert into tb3 (f120, f122, f136) values ('6', 'Test 3.5.8.6-insert', 101);
update tb3 set f120='S', f136=111,
f122='Test 3.5.8.6-tr8_1'
where f122='Test 3.5.8.6-insert';
select f120, f122
from tb3 where f122 like 'Test 3.5.8.6%' order by f120;
f120 f122
S Test 3.5.8.6-tr8_1
DROP TRIGGER trg8_1;
DROP PROCEDURE sp_01;
Testcase 3.5.8.7: (Disabled as a result of bug _____)
-----------------------------------------------------
Testcase 3.5.8.7
----------------
Create trigger trg9_1 before update on tb3 for each row
BEGIN
Start transaction;
Set new.f120='U';
Commit;
END//
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
Create trigger trg9_2 before delete on tb3 for each row
BEGIN
Start transaction;
Set @var2=old.f120;
Rollback;
END//
ERROR HY000: Explicit or implicit commit is not allowed in stored function or trigger.
drop user test_general@localhost;
drop user test_general;
drop user test_super@localhost;

View File

@ -64,7 +64,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb3.txt'
into table tb3;
Testcase 3.5.9.1/2:
-------------------
@ -119,7 +120,7 @@ set @tr_var_af_118=old.f118, @tr_var_af_121=old.f121,
Insert into tb3 (f122, f136, f163)
values ('Test 3.5.9.3', 7, 123.17);
Update tb3 Set f136=8 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
f118 f121 f122 f136 f163
a NULL Test 3.5.9.3 00008 123.170000000000000000000000000000
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@ -135,7 +136,7 @@ a NULL Test 3.5.9.3 7 123.170000000000000000000000000000
@tr_var_af_118 @tr_var_af_121 @tr_var_af_122 @tr_var_af_136 @tr_var_af_163
0 0 0 0 0
delete from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
f118 f121 f122 f136 f163
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_163;
@ -175,7 +176,7 @@ set @tr_var_af_118=new.f118, @tr_var_af_121=new.f121,
Insert into tb3 (f122, f136, f151, f163)
values ('Test 3.5.9.4', 7, DEFAULT, 995.24);
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4%';
where f122 like 'Test 3.5.9.4%' order by f163;
f118 f121 f122 f136 f151 f163
a NULL Test 3.5.9.4 00007 999 995.240000000000000000000000000000
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@ -195,7 +196,7 @@ where f122='Test 3.5.9.4';
Warnings:
Warning 1048 Column 'f136' cannot be null
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4-trig';
where f122 like 'Test 3.5.9.4-trig' order by f163;
f118 f121 f122 f136 f151 f163
a NULL Test 3.5.9.4-trig 00000 999 NULL
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@ -240,6 +241,7 @@ ERROR HY000: There is no NEW row in on DELETE trigger
create trigger trg5b after DELETE on tb3 for each row
set new.f122='test';
ERROR HY000: There is no NEW row in on DELETE trigger
drop trigger trg5a;
drop trigger trg5b;
Testcase 3.5.9.10: (implied in previous tests)

View File

@ -64,7 +64,8 @@ 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 'MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb3.txt' into table tb3 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb3.txt'
into table tb3;
Testcase 3.5.10.1/2/3:
----------------------
@ -86,7 +87,7 @@ Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 1);
Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 2);
Insert into vw11 (f122, f151) values ('Not in View', 3);
select f121, f122, f151, f163
from tb3 where f122 like 'Test 3.5.10.1/2/3%';
from tb3 where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
NULL Test 3.5.10.1/2/3 1 111.110000000000000000000000000000
NULL Test 3.5.10.1/2/3 2 111.110000000000000000000000000000
@ -100,7 +101,7 @@ f121 f122 f151 f163
NULL Not in View 3 111.110000000000000000000000000000
Update vw11 set f163=1;
select f121, f122, f151, f163 from tb3
where f122 like 'Test 3.5.10.1/2/3%';
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
Y Test 3.5.10.1/2/3-Update 1 1.000000000000000000000000000000
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
@ -114,7 +115,7 @@ before delete
0
delete from vw11 where f151=1;
select f121, f122, f151, f163 from tb3
where f122 like 'Test 3.5.10.1/2/3%';
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
f121 f122 f151 f163
Y Test 3.5.10.1/2/3-Update 2 1.000000000000000000000000000000
select f121, f122, f151, f163 from vw11;
@ -141,11 +142,11 @@ set @counter= 0;
select @counter as 'Rows Loaded Before';
Rows Loaded Before
0
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table tb_load;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/t9.txt' into table tb_load;
select @counter as 'Rows Loaded After';
Rows Loaded After
10
Select * from tb_load limit 10;
Select * from tb_load order by f1 limit 10;
f1 f2 f3
-5000 a` 1000
-4999 aaa 999
@ -240,7 +241,7 @@ insert into t3 (f1) values (new.f1+1000);
create trigger tr2_4 after insert on t2_4 for each row
insert into t3 (f1) values (new.f1+10000);
insert into t1 values (1);
select * from t3;
select * from t3 order by f1;
f1
12
102
@ -275,17 +276,17 @@ create trigger tr4 after insert on t4
for each row insert into t1 (f1) values (new.f4+1);
insert into t1 values (1);
ERROR HY000: Can't update table 't1' in stored function/trigger because it is already used by statement which invoked this stored function/trigger.
select * from t1;
select * from t1 order by f1;
f1
0
1
select * from t2;
select * from t2 order by f2;
f2
2
select * from t3;
select * from t3 order by f3;
f3
3
select * from t4;
select * from t4 order by f4;
f4
4
drop trigger tr1;
@ -297,8 +298,8 @@ drop table t2;
drop table t3;
drop table t4;
Testcase y.y.y.4: Recursive trigger/SP references (disabled bug 11889)
----------------------------------------------------------------------
Testcase y.y.y.4: Recursive trigger/SP references
-------------------------------------------------
set @sql_mode='traditional';
create table t1_sp (
count integer,
@ -386,14 +387,14 @@ start transaction;
insert into t1 values (1);
ERROR 22003: Out of range value adjusted for column 'f4' at row 1
commit;
select * from t1;
select * from t1 order by f1;
f1
1
1
select * from t2;
select * from t2 order by f2;
f2
2
select * from t3;
select * from t3 order by f3;
f3
3
drop trigger tr1;

View File

@ -61,7 +61,8 @@ f115 VARBINARY(27) null ,
f116 VARBINARY(64) null,
f117 VARBINARY(192) null
) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb2.txt' into table tb2 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb2.txt'
into table tb2;
DROP DATABASE IF EXISTS test1;
CREATE DATABASE test1;
USE test1;
@ -127,7 +128,8 @@ f115 VARBINARY(27) null ,
f116 VARBINARY(64) null,
f117 VARBINARY(192) null
) engine = myisam;
load data infile 'MYSQL_TEST_DIR/suite/funcs_1/data/myisam_tb2.txt' into table tb2 ;
load data infile '<MYSQLTEST_VARDIR>/std_data_ln/funcs_1/myisam_tb2.txt'
into table tb2;
USE test;
Attention: The nesting level @max_level in Testcase 3.3.1.A6

View File

@ -1,5 +1,6 @@
let $message= --source suite/funcs_1/storedproc/cleanup_sp_tb.inc;
--source include/show_msg80.inc
--echo
--echo --source suite/funcs_1/storedproc/cleanup_sp_tb.inc
--echo --------------------------------------------------------------------------------
# called both to cleanup possibly existing data before and after the SP tests

View File

@ -1,11 +1,12 @@
let $message= --source suite/funcs_1/storedproc/load_sp_tb.inc;
--source include/show_msg80.inc
--echo
--echo --source suite/funcs_1/storedproc/load_sp_tb.inc
--echo --------------------------------------------------------------------------------
# ==============================================================================
#
# this load script can be called multiple times inside a test script because it
# This load script can be called multiple times inside a test script because it
# first cleans up all objects that will be created.
# therefore the same script is used as it will be used at the end of a test.
# Therefore the same script is used as it will be used at the end of a test.
#
# ==============================================================================
@ -20,46 +21,84 @@ CREATE DATABASE db_storedproc_1;
USE db_storedproc;
eval create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = $engine_type;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t1;
--replace_result $engine_type <engine_to_be_tested>
eval
create table t1(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' into table t1;
eval create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = $engine_type;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t2;
--replace_result $engine_type <engine_to_be_tested>
eval
create table t2(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' into table t2;
eval create table t3(f1 char(20),f2 char(20),f3 integer) engine = $engine_type;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/t3.txt' into table t3;
--replace_result $engine_type <engine_to_be_tested>
eval
create table t3(f1 char(20),f2 char(20),f3 integer) engine = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t3.txt' into table t3;
eval create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = $engine_type;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t4;
--replace_result $engine_type <engine_to_be_tested>
eval
create table t4(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' into table t4;
USE db_storedproc_1;
eval create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = $engine_type;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t6;
--replace_result $engine_type <engine_to_be_tested>
eval
create table t6(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' into table t6;
USE db_storedproc;
eval create table t7 (f1 char(20), f2 char(25), f3 date, f4 int) engine = $engine_type;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t7;
--replace_result $engine_type <engine_to_be_tested>
eval
create table t7 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t7.txt' into table t7;
eval create table t8 (f1 char(20), f2 char(25), f3 date, f4 int) engine = $engine_type;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/t7.txt' into table t8;
--replace_result $engine_type <engine_to_be_tested>
eval
create table t8 (f1 char(20), f2 char(25), f3 date, f4 int)
engine = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t7.txt' into table t8;
eval create table t9(f1 int, f2 char(25), f3 int) engine = $engine_type;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table t9;
--replace_result $engine_type <engine_to_be_tested>
eval
create table t9(f1 int, f2 char(25), f3 int) engine = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t9.txt' into table t9;
eval create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = $engine_type;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t10;
--replace_result $engine_type <engine_to_be_tested>
eval
create table t10(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' into table t10;
eval create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int) engine = $engine_type;
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/t4.txt' into table t11;
--replace_result $engine_type <engine_to_be_tested>
eval
create table t11(f1 char(20),f2 char(25),f3 date,f4 int,f5 char(25),f6 int)
engine = $engine_type;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval
load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t4.txt' into table t11;

View File

@ -5,85 +5,192 @@
# ==============================================================================
# (numbering from requirement document TP v1.0, Last updated: 25 Jan 2005 01:00)
#
# 3.1.2 Syntax checks for the stored procedure-specific programming statements BEGIN/END, DECLARE, SET, SELECT/INTO, OPEN, FETCH, CLOSE:
# 3.1.2 Syntax checks for the stored procedure-specific programming statements
# BEGIN/END, DECLARE, SET, SELECT/INTO, OPEN, FETCH, CLOSE:
#
#- 1. Ensure that all subclauses that should be supported are supported.
#- 2. Ensure that all subclauses that should not be supported are disallowed with an appropriate error message.
#- 3. Ensure that all supported subclauses are supported only in the correct order.
#- 4. Ensure that an appropriate error message is returned if a subclause is out-of-order in a stored procedure definition.
#- 5. Ensure that all subclauses that are defined to be mandatory are indeed required to be mandatory by the MySQL server and tools.
#- 6. Ensure that any subclauses that are defined to be optional are indeed treated as optional by the MySQL server and tools.
#- 7. Ensure that every BEGIN statement is coupled with a terminating END statement.
## 8. Ensure that the scope of each BEGIN/END compound statement within a stored procedure definition is properly applied.
#- 9. Ensure that the labels enclosing each BEGIN/END compound statement must match.
#- 10. Ensure that it is possible to put a beginning label at the start of a BEGIN/END compound statement without also requiring an ending label at the end of the same statement.
#- 11. Ensure that it is not possible to put an ending label at the end of a BEGIN/END compound statement without also requiring a matching beginning label at the start of the same statement.
#- 2. Ensure that all subclauses that should not be supported are disallowed
# with an appropriate error message.
#- 3. Ensure that all supported subclauses are supported only in the
# correct order.
#- 4. Ensure that an appropriate error message is returned if a subclause is
# out-of-order in a stored procedure definition.
#- 5. Ensure that all subclauses that are defined to be mandatory are indeed
# required to be mandatory by the MySQL server and tools.
#- 6. Ensure that any subclauses that are defined to be optional are indeed
# treated as optional by the MySQL server and tools.
#- 7. Ensure that every BEGIN statement is coupled with a terminating
# END statement.
## 8. Ensure that the scope of each BEGIN/END compound statement within a
# stored procedure definition is properly applied.
#- 9. Ensure that the labels enclosing each BEGIN/END compound statement
# must match.
#- 10. Ensure that it is possible to put a beginning label at the start of
# a BEGIN/END compound statement without also requiring an ending label
# at the end of the same statement.
#- 11. Ensure that it is not possible to put an ending label at the end of
# a BEGIN/END compound statement without also requiring a matching
# beginning label at the start of the same statement.
#- 12. Ensure that every beginning label must end with a colon (:).
#- 13. Ensure that every beginning label with the same scope must be unique.
#- 14. Ensure that the variables, cursors, conditions, and handlers declared for a stored procedure (with the DECLARE statement) may only be properly defined.
#- 15. Ensure that the variables, cursors, conditions, and handlers declared for a stored procedure (with the DECLARE statement) may only be defined in the correct order.
#- 16. Ensure that every possible type of variable -- utilizing every data type definition supported by the MySQL server in combination with both no DEFAULT subclause and with DEFAULT subclauses that set the variables default value to a range of appropriate values -- may be declared for a stored procedure.
#- 17. Ensure that the DECLARE statement can declare multiple variables both separately and all at once from a variable list.
#- 18. Ensure that invalid variable declarations are rejected, with an appropriate error message.
#- 19. Ensure that every possible type of cursor may be declared for a stored procedure.
#- 20. Ensure that invalid cursor declarations are rejected, with an appropriate error message.
#- 21. Ensure that every possible type of condition may be declared for a stored procedure.
# -22. Ensure that invalid condition declarations are rejected, with an appropriate error message.
#- 23. Ensure that every possible type of handler may be declared for a stored procedure.
#- 24. Ensure that invalid handler declarations are rejected, with an appropriate error message.
#- 25. Ensure that the scope of every variable, cursor, condition, and handler declared for a stored procedure (with the DECLARE statement) is properly applied.
## 26. Ensure that the initial value of every variable declared for a stored procedure is either NULL or its DEFAULT value, as appropriate.
#- 27. Ensure that the SET statement can assign a value to every local variable declared within a stored procedures definition, as well as to every appropriate global server variable.
#- 28. Ensure that the SET statement can assign values to variables either separately or to multiple variables in a list.
#- 29. Ensure that the SET statement may assign only those values to a variable that are appropriate for that variables data type definition.
## 30. Ensure that, when a stored procedure is called/executed, every variable always uses the correct value: either the value with which it is initialized or the value to which it is subsequently SET or otherwise assigned, as appropriate.
## 31. Ensure that the SELECT ... INTO statement properly assigns values to the variables in its variable list.
## 32. Ensure that a SELECT ... INTO statement that retrieves multiple rows is rejected, with an appropriate error message.
## 33. Ensure that a SELECT ... INTO statement that retrieves too many columns for the number of variables in its variable list is rejected, with an appropriate error message.
## 34. Ensure that a SELECT ... INTO statement that retrieves too few columns for the number of variables in its variable list is rejected, with an appropriate error message.
#- 35. Ensure that a SELECT ... INTO statement that retrieves column values with inappropriate data types for the matching variables in its variable list is rejected, with an appropriate error message.
#- 36. Ensure that the DECLARE ... CONDITION FOR statement can declare a properly-named condition for every possible SQLSTATE and MySQL-specific error code.
#- 37. Ensure that no two conditions declared with the same scope may have the same condition name.
#- 14. Ensure that the variables, cursors, conditions, and handlers declared
# for a stored procedure (with the DECLARE statement) may only be
# properly defined.
#- 15. Ensure that the variables, cursors, conditions, and handlers declared for
# a stored procedure (with the DECLARE statement) may only be defined in
# the correct order.
#- 16. Ensure that every possible type of variable -- utilizing every data type
# definition supported by the MySQL server in combination with both no
# DEFAULT subclause and with DEFAULT subclauses that set the variable’s
# default value to a range of appropriate values -- may be declared for
# a stored procedure.
#- 17. Ensure that the DECLARE statement can declare multiple variables both
# separately and all at once from a variable list.
#- 18. Ensure that invalid variable declarations are rejected, with an
# appropriate error message.
#- 19. Ensure that every possible type of cursor may be declared for a
# stored procedure.
#- 20. Ensure that invalid cursor declarations are rejected, with an appropriate
# error message.
#- 21. Ensure that every possible type of condition may be declared for
# a stored procedure.
# -22. Ensure that invalid condition declarations are rejected, with an
# appropriate error message.
#- 23. Ensure that every possible type of handler may be declared for a
# stored procedure.
#- 24. Ensure that invalid handler declarations are rejected, with an
# appropriate error message.
#- 25. Ensure that the scope of every variable, cursor, condition, and handler
# declared for a stored procedure (with the DECLARE statement) is
# properly applied.
## 26. Ensure that the initial value of every variable declared for a stored
# procedure is either NULL or its DEFAULT value, as appropriate.
#- 27. Ensure that the SET statement can assign a value to every local variable
# declared within a stored procedure’s definition, as well as to every
# appropriate global server variable.
#- 28. Ensure that the SET statement can assign values to variables either
# separately or to multiple variables in a list.
#- 29. Ensure that the SET statement may assign only those values to a variable
# that are appropriate for that variable’s data type definition.
## 30. Ensure that, when a stored procedure is called/executed, every variable
# always uses the correct value: either the value with which it is
# initialized or the value to which it is subsequently SET or otherwise
# assigned, as appropriate.
## 31. Ensure that the SELECT ... INTO statement properly assigns values to the
# variables in its variable list.
## 32. Ensure that a SELECT ... INTO statement that retrieves multiple rows is
# rejected, with an appropriate error message.
## 33. Ensure that a SELECT ... INTO statement that retrieves too many columns
# for the number of variables in its variable list is rejected, with an
# appropriate error message.
## 34. Ensure that a SELECT ... INTO statement that retrieves too few columns
# for the number of variables in its variable list is rejected, with an
# appropriate error message.
#- 35. Ensure that a SELECT ... INTO statement that retrieves column values
# with inappropriate data types for the matching variables in its variable
# list is rejected, with an appropriate error message.
#- 36. Ensure that the DECLARE ... CONDITION FOR statement can declare a
# properly-named condition for every possible SQLSTATE and MySQL-specific
# error code.
#- 37. Ensure that no two conditions declared with the same scope may have the
# same condition name.
## 38. Ensure that the scope of every condition declared is properly applied.
#- 39. Ensure that every SQLSTATE value declared with a DECLARE ... CONDITION FOR statement is a character string that is 5 characters long.
#- 40. Ensure that the DECLARE ... CONDITION FOR statement cannot declare a condition for an invalid SQLSTATE.
#- 41. Ensure that the DECLARE ... CONDITION FOR statement cannot declare a condition for the “successful completion SQLSTATE: “00000“.
#- 42. Ensure that the DECLARE ... HANDLER FOR statement can declare a CONTINUE, EXIT, and UNDO handler for every condition declared (with a DECLARE ... CONDITION FOR statement), within the scope of the handler, for a stored procedure, as well as for every possible SQLSTATE and MySQL-specific error code, as well as for the predefined conditions SQLWARNING, NOT FOUND, and SQLEXCEPTION.
## 43. Ensure that the DECLARE ... HANDLER FOR statement can not declare any handler for a condition declared outside of the scope of the handler.
## 44. Ensure that the DECLARE ... HANDLER FOR statement cannot declare a handler for any invalid, or undeclared, condition.
#- 39. Ensure that every SQLSTATE value declared with a DECLARE ... CONDITION
# FOR statement is a character string that is 5 characters long.
#- 40. Ensure that the DECLARE ... CONDITION FOR statement cannot declare a
# condition for an invalid SQLSTATE.
#- 41. Ensure that the DECLARE ... CONDITION FOR statement cannot declare a
# condition for the “successful completion SQLSTATE: “00000“.
#- 42. Ensure that the DECLARE ... HANDLER FOR statement can declare a CONTINUE,
# EXIT, and UNDO handler for every condition declared (with a DECLARE ...
# CONDITION FOR statement), within the scope of the handler, for a stored
# procedure, as well as for every possible SQLSTATE and MySQL-specific
# error code, as well as for the predefined conditions SQLWARNING,
# NOT FOUND, and SQLEXCEPTION.
## 43. Ensure that the DECLARE ... HANDLER FOR statement can not declare any
# handler for a condition declared outside of the scope of the handler.
## 44. Ensure that the DECLARE ... HANDLER FOR statement cannot declare a
# handler for any invalid, or undeclared, condition.
## 45. Ensure that the scope of every handler declared is properly applied.
#- 46. Ensure that, within the same scope, no two handlers may be declared for the same condition.
#- 47. Ensure that every SQLSTATE value declared with a DECLARE ... HANDLER FOR statement is a character string that is 5 characters long.
#- 48. Ensure that the DECLARE ... HANDLER FOR statement cannot declare a condition for an invalid SQLSTATE.
#- 49. Ensure that the DECLARE ... HANDLER FOR statement cannot declare a condition for the “successful completion SQLSTATE: “00000“.
## 50. Ensure that a CONTINUE handler allows the execution of the stored procedure to continue once the handler statement has completed its own execution (that is, once the handler action statement has been executed).
## 51. Ensure that an EXIT handler causes the execution of the stored procedure to terminate, within its scope, once the handler action statement has been executed.
## 52. Ensure that an EXIT handler does not cause the execution of the stored procedure to terminate outside of its scope.
#- 53. Ensure that a handler condition of SQLWARNING takes the same action as a handler condition defined with an SQLSTATE that begins with “01“.
## 54. Ensure that a handler with a condition defined with an SQLSTATE that begins with “01“ is always exactly equivalent in action to a handler with an SQLWARNING condition.
#- 55. Ensure that a handler condition of NOT FOUND takes the same action as a handler condition defined with an SQLSTATE that begins with “02“.
## 56. Ensure that a handler with a condition defined with an SQLSTATE that begins with “02“ is always exactly equivalent in action to a handler with a NOT FOUND condition.
#- 57. Ensure that a handler condition of SQLEXCEPTION takes the same action as a handler condition defined with an SQLSTATE that begins with anything other that “01“ or “02“.
## 58. Ensure that a handler with a condition defined with an SQLSTATE that begins with anything other that “01“ or “02“ is always exactly equivalent in action to a handler with an SQLEXCEPTION condition.
#- 46. Ensure that, within the same scope, no two handlers may be declared for
# the same condition.
#- 47. Ensure that every SQLSTATE value declared with a DECLARE ... HANDLER FOR
# statement is a character string that is 5 characters long.
#- 48. Ensure that the DECLARE ... HANDLER FOR statement cannot declare a
# condition for an invalid SQLSTATE.
#- 49. Ensure that the DECLARE ... HANDLER FOR statement cannot declare a
# condition for the “successful completion SQLSTATE: “00000“.
## 50. Ensure that a CONTINUE handler allows the execution of the stored
# procedure to continue once the handler statement has completed its
# own execution (that is, once the handler action statement has been
# executed).
## 51. Ensure that an EXIT handler causes the execution of the stored procedure
# to terminate, within its scope, once the handler action statement has
# been executed.
## 52. Ensure that an EXIT handler does not cause the execution of the stored
# procedure to terminate outside of its scope.
#- 53. Ensure that a handler condition of SQLWARNING takes the same action as
# a handler condition defined with an SQLSTATE that begins with “01“.
## 54. Ensure that a handler with a condition defined with an SQLSTATE that
# begins with “01“ is always exactly equivalent in action to a
# handler with an SQLWARNING condition.
#- 55. Ensure that a handler condition of NOT FOUND takes the same action as a
# handler condition defined with an SQLSTATE that begins with “02“.
## 56. Ensure that a handler with a condition defined with an SQLSTATE that
# begins with “02“ is always exactly equivalent in action to a
# handler with a NOT FOUND condition.
#- 57. Ensure that a handler condition of SQLEXCEPTION takes the same action
# as a handler condition defined with an SQLSTATE that begins with
# anything other that “01“ or “02“.
## 58. Ensure that a handler with a condition defined with an SQLSTATE that
# begins with anything other that “01“ or “02“ is always
# exactly equivalent in action to a handler with an SQLEXCEPTION condition.
#- 59. Ensure that no two cursors in a stored procedure can have the same name.
#- 60. Ensure that a cursor declaration may not include a SELECT ... INTO statement.
#- 61. Ensure that a cursor declaration that includes an ORDER BY clause may not be an updatable cursor.
#- 62. Ensure that OPEN <cursor name> fails unless a cursor with the same name has already been declared.
#- 63. Ensure that OPEN <cursor name> fails if the same cursor is currently already open.
#- 64. Ensure that FETCH <cursor name> fails unless a cursor with the same name is already open.
## 65. Ensure that FETCH <cursor name> returns the first row of the cursors result set the first time FETCH is executed, that it returns each subsequent row of the cursors result set each of the subsequent times FETCH is executed, and that it returns a NOT FOUND warning if it is executed after the last row of the cursors result set has already been fetched.
#- 66. Ensure that FETCH <cursor name> fails with an appropriate error message if it is executed before the cursor has been opened.
#- 67. Ensure that FETCH <cursor name> fails with an appropriate error message if it is executed after the cursor has been closed.
## 68. Ensure that FETCH <cursor name> fails with an appropriate error message if the number of columns to be fetched does not match the number of variables specified by the FETCH statement.
#- 69. Ensure that FETCH <cursor name> fails with an appropriate error message if the data type of the column values being fetched are not appropriate for the matching FETCH variables to which the data is being assigned.
#- 70. Ensure that CLOSE <cursor name> fails unless a cursor with the same name is already open.
#- 71. Ensure that all cursors are closed when a transaction terminates with a COMMIT statement.
#- 72. Ensure that all cursors are closed when a transaction terminates with a ROLLBACK statement.
#- 73. Ensure that the result set of a cursor that has been closed is not longer available to the FETCH statement.
#- 74. Ensure that every cursor declared within a compound statement is closed when that compound statement ends.
## 75. Ensure that, for nested compound statements, a cursor that was declared and opened during an outer level of the statement is not closed when an inner level of a compound statement ends.
## 76. Ensure that all cursors operate asensitively, so that there is no concurrency conflict between cursors operating on the same, or similar, sets of results during execution of one or more stored procedures.
# 77. Ensure that multiple cursors, nested within multiple compound statements within a stored procedure, always act correctly and return the expected result.
#- 60. Ensure that a cursor declaration may not include a SELECT ... INTO
# statement.
#- 61. Ensure that a cursor declaration that includes an ORDER BY clause may
# not be an updatable cursor.
#- 62. Ensure that OPEN <cursor name> fails unless a cursor with the same name
# has already been declared.
#- 63. Ensure that OPEN <cursor name> fails if the same cursor is currently
# already open.
#- 64. Ensure that FETCH <cursor name> fails unless a cursor with the same name
# is already open.
## 65. Ensure that FETCH <cursor name> returns the first row of the cursor’s
# result set the first time FETCH is executed, that it returns each
# subsequent row of the cursor’s result set each of the subsequent
# times FETCH is executed, and that it returns a NOT FOUND warning if it
# is executed after the last row of the cursor’s result set has already
# been fetched.
#- 66. Ensure that FETCH <cursor name> fails with an appropriate error message
# if it is executed before the cursor has been opened.
#- 67. Ensure that FETCH <cursor name> fails with an appropriate error message
# if it is executed after the cursor has been closed.
## 68. Ensure that FETCH <cursor name> fails with an appropriate error message
# if the number of columns to be fetched does not match the number of
# variables specified by the FETCH statement.
#- 69. Ensure that FETCH <cursor name> fails with an appropriate error message
# if the data type of the column values being fetched are not appropriate
# for the matching FETCH variables to which the data is being assigned.
#- 70. Ensure that CLOSE <cursor name> fails unless a cursor with the same name
# is already open.
#- 71. Ensure that all cursors are closed when a transaction terminates with
# a COMMIT statement.
#- 72. Ensure that all cursors are closed when a transaction terminates with
# a ROLLBACK statement.
#- 73. Ensure that the result set of a cursor that has been closed is not
# longer available to the FETCH statement.
#- 74. Ensure that every cursor declared within a compound statement is closed
# when that compound statement ends.
## 75. Ensure that, for nested compound statements, a cursor that was declared
# and opened during an outer level of the statement is not closed when an
# inner level of a compound statement ends.
## 76. Ensure that all cursors operate asensitively, so that there is no
# concurrency conflict between cursors operating on the same, or similar,
# sets of results during execution of one or more stored procedures.
# 77. Ensure that multiple cursors, nested within multiple compound statements
# within a stored procedure, always act correctly and return the
# expected result.
#
# ==============================================================================
let $message= Section 3.1.2 - Syntax checks for the stored procedure-specific
@ -209,7 +316,7 @@ BEGIN
set @x = x;
set @y = y;
set @z = 234;
SELECT f1, f2 into @x, @y from t2 limit 1;
SELECT f1, f2 into @x, @y from t2 where f1='a`' and f2='a`' limit 1;
SELECT @x, @y, @z, invar;
BEGIN
set @x = 2;
@ -257,7 +364,7 @@ BEGIN
declare x integer; declare y integer;
set @x=x;
set @y=y;
SELECT f4, f3 into @x, @y from t2 limit 1;
SELECT f4, f3 into @x, @y from t2 where f4=-5000 and f3='1000-01-01' limit 1;
SELECT @x, @y;
END//
delimiter ;//
@ -290,8 +397,9 @@ BEGIN
END//
delimiter ;//
#Error: 1172 SQLSTATE: 42000 (ER_TOO_MANY_ROWS) Message: Result consisted of more than one row
--error 1172
# Error: SQLSTATE: 42000 (ER_TOO_MANY_ROWS)
# Message: Result consisted of more than one row
--error ER_TOO_MANY_ROWS
CALL sp1();
# cleanup 3.1.2.32
@ -321,7 +429,7 @@ BEGIN
END//
delimiter ;//
--error 1222
--error ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT
CALL sp1();
# cleanup 3.1.2.33
@ -352,7 +460,7 @@ BEGIN
END//
delimiter ;//
--error 1222
--error ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT
CALL sp1();
# cleanup 3.1.2.34
@ -375,8 +483,10 @@ create table res_t1(w char unique, x char);
insert into res_t1 values('a', 'b');
# Error: 1339 SQLSTATE: 20000 (ER_SP_CASE_NOT_FOUND) Message: Case not found for CASE statement
# Error: 1022 SQLSTATE: 23000 (ER_DUP_KEY) Message: Can't write; duplicate key in table '%s'
# Error: SQLSTATE: 20000 (ER_SP_CASE_NOT_FOUND)
# Message: Case not found for CASE statement
# Error: SQLSTATE: 23000 (ER_DUP_KEY)
# Message: Can't write; duplicate key in table '%s'
delimiter //;
CREATE PROCEDURE h1 ()
@ -472,7 +582,7 @@ create table res_t1(w char unique, x char);
insert into res_t1 values ('a', 'b');
delimiter //;
--error 1319
--error ER_SP_COND_MISMATCH
CREATE PROCEDURE h1 ()
BEGIN
declare x1, x2, x3, x4, x5, x6 int default 0;
@ -561,8 +671,9 @@ DROP PROCEDURE IF EXISTS h1;
--enable_warnings
delimiter //;
#Error: 1319 SQLSTATE: 42000 (ER_SP_COND_MISMATCH) Message: Undefined CONDITION: %s
--error 1319
# Error: SQLSTATE: 42000 (ER_SP_COND_MISMATCH)
# Message: Undefined CONDITION: %s
--error ER_SP_COND_MISMATCH
CREATE PROCEDURE h1 ()
BEGIN
declare x1, x2, x3, x4, x5, x6 int default 0;
@ -582,8 +693,9 @@ BEGIN
END;
END//
#Error: 1064 SQLSTATE: 42000 (ER_PARSE_ERROR) Message: %s near '%s' at line %d
--error 1064
# Error: SQLSTATE: 42000 (ER_PARSE_ERROR)
# Message: %s near '%s' at line %d
--error ER_PARSE_ERROR
CREATE PROCEDURE h1 ()
BEGIN
DECLARE x1 INT DEFAULT 0;
@ -593,8 +705,9 @@ BEGIN
DECLARE CONTINUE HANDLER FOR condname1 SET x1 = 1;
END//
#Error: 1407 SQLSTATE: 42000 (ER_SP_BAD_SQLSTATE) Message: Bad SQLSTATE: '%s'
--error 1407
# Error: SQLSTATE: 42000 (ER_SP_BAD_SQLSTATE)
# Message: Bad SQLSTATE: '%s'
--error ER_SP_BAD_SQLSTATE
CREATE PROCEDURE h1 ()
BEGIN
DECLARE x1 INT DEFAULT 0;
@ -632,7 +745,7 @@ drop table IF EXISTS res_t1;
--echo ==> 'UNDO' is still not supported.
delimiter //;
--error 1064
--error ER_PARSE_ERROR
create procedure p1undo ()
begin
declare undo handler for sqlexception select '1';
@ -723,7 +836,7 @@ DROP TABLE res_t1;
let $message= Testcase 3.1.2.50:;
--source include/show_msg.inc
# testcase: ensure that a continue handler allows the execution of the stored procedure
# Testcase: Ensure that a continue handler allows the execution of the stored procedure
# to continue once the handler statement has completed its own execution
# (that is, once the handler action statement has been executed).
@ -794,8 +907,9 @@ BEGIN
END//
delimiter ;//
# Error: 1318 SQLSTATE: 42000 (ER_SP_WRONG_NO_OF_ARGS) Message: Incorrect number of arguments for %s %s; expected %u, got %u
--error 1318
# Error: SQLSTATE: 42000 (ER_SP_WRONG_NO_OF_ARGS)
# Message: Incorrect number of arguments for %s %s; expected %u, got %u
--error ER_SP_WRONG_NO_OF_ARGS
CALL sp1(1);
CALL sp2();
SELECT '-3-', @x2, @x;
@ -858,7 +972,7 @@ let $message= Testcase 3.1.2.54:;
--source include/show_msg.inc
let $message=
Ensure that a handler with a condition defined with an SQLSTATE that begins with
“01“ is always exactly equivalent in action to a handler with an SQLWARNING
“01“ is always exactly equivalent in action to a handler with an SQLWARNING
condition.;
--source include/show_msg80.inc
@ -959,7 +1073,7 @@ let $message= Testcase 3.1.2.56:;
--source include/show_msg.inc
let $message=
Ensure that a handler with a condition defined with an SQLSTATE that begins with
“02“ is always exactly equivalent in action to a handler with a NOT FOUND
“02“ is always exactly equivalent in action to a handler with a NOT FOUND
condition.;
--source include/show_msg80.inc
@ -1052,7 +1166,7 @@ BEGIN
END//
delimiter ;//
--error 1329
--error ER_SP_FETCH_NO_DATA
CALL sp0();
SELECT @done, @x;
@ -1081,13 +1195,16 @@ let $message= Testcase 3.1.2.58:;
--source include/show_msg.inc
let $message=
Ensure that a handler with a condition defined with an SQLSTATE that begins with
anything other that “01“ or “02“ is always exactly equivalent in action to a
anything other that “01“ or “02“ is always exactly equivalent in action to a
handler with an SQLEXCEPTION condition.;
--source include/show_msg80.inc
# Error: 1339 SQLSTATE: 20000 (ER_SP_CASE_NOT_FOUND) Message: Case not found for CASE statement
# Error: 1222 SQLSTATE: 21000 (ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT) Message: The used SELECT statements have a different number of columns
# Error: 1326 SQLSTATE: 24000 (ER_SP_CURSOR_NOT_OPEN) Message: Cursor is not open
# Error: SQLSTATE: 20000 (ER_SP_CASE_NOT_FOUND)
# Message: Case not found for CASE statement
# Error: SQLSTATE: 21000 (ER_WRONG_NUMBER_OF_COLUMNS_IN_SELECT)
# Message: The used SELECT statements have a different number of columns
# Error: SQLSTATE: 24000 (ER_SP_CURSOR_NOT_OPEN)
# Message: Cursor is not open
--disable_warnings
DROP PROCEDURE IF EXISTS sp0;
@ -1271,7 +1388,8 @@ BEGIN
declare f5_value char(20);
declare f4_value integer;
declare f6_value integer;
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2 limit 3;
declare cur1 cursor for SELECT f1, f2, f4, f5, f6 from t2
where f4 >=-5000 order by f4 limit 3;
open cur1;
while proceed do
SELECT count AS 'loop';
@ -1282,7 +1400,7 @@ BEGIN
END//
delimiter ;//
--error 1329
--error ER_SP_FETCH_NO_DATA
CALL sp1();
SELECT * FROM temp;
@ -1338,11 +1456,11 @@ END//
delimiter ;//
--echo --> not enough columns in FETCH statement
--error 1328
--error ER_SP_WRONG_NO_OF_FETCH_ARGS
CALL sp1();
--echo --> too many columns in FETCH statement
--error 1328
--error ER_SP_WRONG_NO_OF_FETCH_ARGS
CALL sp2();
# cleanup 3.1.2.68
@ -1366,9 +1484,10 @@ DROP PROCEDURE IF EXISTS sp1;
create table temp1( f0 char(20), f1 char(20), f2 char(20), f3 int, f4 char(20) );
#Error: 1329 SQLSTATE: 02000 (ER_SP_FETCH_NO_DATA) Message: No data to FETCH
# Error: SQLSTATE: 02000 (ER_SP_FETCH_NO_DATA)
# Message: No data to FETCH
SELECT f1, f2, f4, f5 from t2;
SELECT f1, f2, f4, f5 from t2 order by f4;
delimiter //;
CREATE PROCEDURE sp1( )
@ -1379,8 +1498,8 @@ BEGIN
declare newf2 char(20);
declare newf5 char(20);
declare newf4 integer;
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 limit 5;
declare cur1 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
declare cur2 cursor for SELECT f1, f2, f4, f5 from t2 where f4 >= -5000 order by f4 limit 5;
open cur1;
open cur2;
BEGIN
@ -1453,8 +1572,10 @@ BEGIN
declare i_newf12 char(20);
declare i_newf13 date;
declare i_newf14 integer;
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2 limit 4;
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2 limit 3;
declare cur1 cursor for SELECT f1, f2, f3, f4 from t2
where f4>=-5000 order by f4 limit 4;
declare cur2 cursor for SELECT f1, f2, f3, f4 from t2
where f4>=-5000 order by f4 limit 3;
declare continue handler for sqlstate '02000' set proceed=0;
open cur1;
open cur2;
@ -1486,8 +1607,10 @@ BEGIN
DECLARE o_newf12 CHAR(20);
DECLARE o_newf13 DATE;
DECLARE o_newf14 INTEGER;
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2 LIMIT 5;
DECLARE cur1 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
DECLARE cur2 CURSOR FOR SELECT f1, f2, f3, f4 FROM t2
WHERE f4>=-5000 ORDER BY f4 LIMIT 5;
DECLARE CONTINUE HANDLER FOR SQLSTATE '02000' SET proceed=0;
OPEN cur1;
OPEN cur2;
@ -1526,6 +1649,7 @@ DROP TABLE temp2;
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
# ==============================================================================
let $message= . +++ END OF SCRIPT +++;
--source include/show_msg80.inc
--echo
--echo . +++ END OF SCRIPT +++
--echo --------------------------------------------------------------------------------
# ==============================================================================

View File

@ -5,38 +5,67 @@
# ==============================================================================
# (numbering from requirement document TP v1.0, Last updated: 25 Jan 2005 01:00)
#
# 3.1.3 Syntax checks for the stored procedure-specific flow control statements IF, CASE, LOOP, LEAVE, ITERATE, REPEAT, WHILE:
# 3.1.3 Syntax checks for the stored procedure-specific flow control statements
# IF, CASE, LOOP, LEAVE, ITERATE, REPEAT, WHILE:
#
#- 1. Ensure that all subclauses that should be supported are supported.
#- 2. Ensure that all subclauses that should not be supported are disallowed with an appropriate error message.
#- 3. Ensure that all supported subclauses are supported only in the correct order.
#- 4. Ensure that an appropriate error message is returned if a subclause is out-of-order in a stored procedure definition.
#- 5. Ensure that all subclauses that are defined to be mandatory are indeed required to be mandatory by the MySQL server and tools.
#- 6. Ensure that any subclauses that are defined to be optional are indeed treated as optional by the MySQL server and tools.
## 7. Ensure that the IF statement acts correctly for all variants, including cases where statements are nested.
## 8. Ensure that the CASE statement acts correctly for all variants, including cases where statements are nested.
## 9. Ensure that the LOOP statement acts correctly for all variants, including cases where statements are nested.
#- 2. Ensure that all subclauses that should not be supported are disallowed
# with an appropriate error message.
#- 3. Ensure that all supported subclauses are supported only in the
# correct order.
#- 4. Ensure that an appropriate error message is returned if a subclause is
# out-of-order in a stored procedure definition.
#- 5. Ensure that all subclauses that are defined to be mandatory are indeed
# required to be mandatory by the MySQL server and tools.
#- 6. Ensure that any subclauses that are defined to be optional are indeed
# treated as optional by the MySQL server and tools.
## 7. Ensure that the IF statement acts correctly for all variants, including
# cases where statements are nested.
## 8. Ensure that the CASE statement acts correctly for all variants,
# including cases where statements are nested.
## 9. Ensure that the LOOP statement acts correctly for all variants,
# including cases where statements are nested.
#- 10. Ensure that the labels enclosing each LOOP statement must match.
#- 11. Ensure that it is possible to put a beginning label at the start of a LOOP statement without also requiring an ending label at the end of the same statement.
#- 12. Ensure that it is not possible to put an ending label at the end of a LOOP statement without also requiring a matching beginning label at the start of the same statement.
#- 11. Ensure that it is possible to put a beginning label at the start of
# a LOOP statement without also requiring an ending label at the end of
# the same statement.
#- 12. Ensure that it is not possible to put an ending label at the end of
# a LOOP statement without also requiring a matching beginning label
# at the start of the same statement.
#- 13. Ensure that every beginning label must end with a colon (:).
#- 14. Ensure that every beginning label with the same scope must be unique.
## 15. Ensure that the LEAVE statement acts correctly for all variants, including cases where statements are nested.
## 16. Ensure that the ITERATE statement acts correctly for all variants, including cases where statements are nested.
#- 17. Ensure that the ITERATE statement fails, with an appropriate error message, if it appears in any context other than within LOOP, REPEAT, or WHILE statements.
## 18. Ensure that the REPEAT statement acts correctly for all variants, including cases where statements are nested.
## 15. Ensure that the LEAVE statement acts correctly for all variants,
# including cases where statements are nested.
## 16. Ensure that the ITERATE statement acts correctly for all variants,
# including cases where statements are nested.
#- 17. Ensure that the ITERATE statement fails, with an appropriate error
# message, if it appears in any context other than within LOOP, REPEAT,
# or WHILE statements.
## 18. Ensure that the REPEAT statement acts correctly for all variants,
# including cases where statements are nested.
#- 19. Ensure that the labels enclosing each REPEAT statement must match.
#- 20. Ensure that it is possible to put a beginning label at the start of a REPEAT statement without also requiring an ending label at the end of the same statement.
#- 21. Ensure that it is not possible to put an ending label at the end of a REPEAT statement without also requiring a matching beginning label at the start of the same statement.
#- 20. Ensure that it is possible to put a beginning label at the start of
# a REPEAT statement without also requiring an ending label at the end
# of the same statement.
#- 21. Ensure that it is not possible to put an ending label at the end of
# a REPEAT statement without also requiring a matching beginning label
# at the start of the same statement.
#- 22. Ensure that every beginning label must end with a colon (:).
#- 23. Ensure that every beginning label with the same scope must be unique.
## 24. Ensure that the WHILE statement acts correctly for all variants, including cases where statements are nested.
## 24. Ensure that the WHILE statement acts correctly for all variants,
# including cases where statements are nested.
#- 25. Ensure that the labels enclosing each WHILE statement must match.
#- 26. Ensure that it is possible to put a beginning label at the start of a WHILE statement without also requiring an ending label at the end of the same statement.
#- 27. Ensure that it is not possible to put an ending label at the end of a WHILE statement without also requiring a matching beginning label at the start of the same statement.
#- 26. Ensure that it is possible to put a beginning label at the start of
# a WHILE statement without also requiring an ending label at the end
# of the same statement.
#- 27. Ensure that it is not possible to put an ending label at the end of
# a WHILE statement without also requiring a matching beginning label
# at the start of the same statement.
#- 28. Ensure that every beginning label must end with a colon (:).
#- 29. Ensure that every beginning label with the same scope must be unique.
## 30. Ensure that multiple cases of all possible combinations of the control flow statements, nested within multiple compound statements within a stored procedure, always act correctly and return the expected result.
## 30. Ensure that multiple cases of all possible combinations of the control
# flow statements, nested within multiple compound statements within
# a stored procedure, always act correctly and return the expected result.
#
# ==============================================================================
let $message= Section 3.1.3 - Syntax checks for the stored procedure-specific flow
@ -237,8 +266,9 @@ DROP PROCEDURE IF EXISTS sp31316;
delimiter //;
# wrong label at iterate
#Error: 1308 SQLSTATE: 42000 (ER_SP_LILABEL_MISMATCH) Message: %s with no matching label: %s
--error 1308
# Error: SQLSTATE: 42000 (ER_SP_LILABEL_MISMATCH)
# Message: %s with no matching label: %s
--error ER_SP_LILABEL_MISMATCH
CREATE PROCEDURE sp31316( )
BEGIN
declare count1 integer default 1;
@ -436,8 +466,9 @@ BEGIN
END//
delimiter ;//
#Error: 1318 SQLSTATE: 42000 (ER_SP_WRONG_NO_OF_ARGS) Message: Incorrect number of arguments for %s %s; expected %u, got %u
--error 1318
# Error: SQLSTATE: 42000 (ER_SP_WRONG_NO_OF_ARGS)
# Message: Incorrect number of arguments for %s %s; expected %u, got %u
--error ER_SP_WRONG_NO_OF_ARGS
CALL sp31330();
CALL sp31330(1);
@ -459,6 +490,7 @@ drop table res_tbl;
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
# ==============================================================================
let $message= . +++ END OF SCRIPT +++;
--source include/show_msg80.inc
--echo
--echo . +++ END OF SCRIPT +++
--echo --------------------------------------------------------------------------------
# ==============================================================================

View File

@ -7,20 +7,29 @@
#
# 3.1.6 Privilege checks:
#
# 1. Ensure that no user may create a stored procedure without the GRANT CREATE ROUTINE privilege.
# 1. Ensure that no user may create a stored procedure without the
# GRANT CREATE ROUTINE privilege.
# 2. Ensure that root always has the GRANT CREATE ROUTINE privilege.
# 3. Ensure that a user with the GRANT CREATE ROUTINE privilege can always create both a procedure and a function, on any appropriate database.
# 4. Ensure that the default security provision of a stored procedure is SQL SECURITY DEFINER.
# 5. Ensure that a stored procedure defined with SQL SECURITY DEFINER can be called/executed by any user, using only the privileges (including database access privileges) associated with the user who created the stored procedure.
# 6. Ensure that a stored procedure defined with SQL SECURITY INVOKER can be called/executed by any user, using only the privileges (including database access privileges) associated with the user executing the stored procedure.
# 3. Ensure that a user with the GRANT CREATE ROUTINE privilege can always
# create both a procedure and a function, on any appropriate database.
# 4. Ensure that the default security provision of a stored procedure is
# SQL SECURITY DEFINER.
# 5. Ensure that a stored procedure defined with SQL SECURITY DEFINER can be
# called/executed by any user, using only the privileges (including
# database access privileges) associated with the user who created
# the stored procedure.
# 6. Ensure that a stored procedure defined with SQL SECURITY INVOKER can be
# called/executed by any user, using only the privileges (including
# database access privileges) associated with the user executing
# the stored procedure.
#
# ==============================================================================
let $message= Section 3.1.6 - Privilege Checks:;
--source include/show_msg80.inc
USE db_storedproc_1;
connection default;
USE db_storedproc_1;
--source suite/funcs_1/include/show_connection.inc
# ------------------------------------------------------------------------------
@ -47,7 +56,7 @@ connect (user1a, localhost, user_1, , db_storedproc_1);
USE db_storedproc_1;
delimiter //;
--error 1044
--error ER_DBACCESS_DENIED_ERROR
CREATE PROCEDURE sp1(v1 char(20))
BEGIN
SELECT * from db_storedproc_1.t6 where t6.f2= 'xyz';
@ -58,6 +67,7 @@ disconnect user1a;
# add privilege again and check
connection default;
USE db_storedproc_1;
--source suite/funcs_1/include/show_connection.inc
GRANT CREATE ROUTINE ON db_storedproc_1.* TO 'user_1'@'localhost';
@ -77,6 +87,7 @@ disconnect user1b;
# cleanup
connection default;
USE db_storedproc_1;
--source suite/funcs_1/include/show_connection.inc
DROP USER 'user_1'@'localhost';
@ -132,6 +143,7 @@ disconnect user2;
# cleanup
connection default;
USE db_storedproc_1;
--source suite/funcs_1/include/show_connection.inc
drop user 'user_1'@'localhost';
@ -242,33 +254,33 @@ disconnect user5_1;
connect (user5_2, localhost, user_2, , db_storedproc_1);
--source suite/funcs_1/include/show_connection.inc
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
CALL sp5_s_i();
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
CALL sp5_ins();
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
CALL sp5_sel();
# now 'add' INSERT to DEFINER
connection default;
--source suite/funcs_1/include/show_connection.inc
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
CALL sp5_sel();
grant insert on db_storedproc_1.* to 'user_1'@'localhost';
flush privileges;
connection user5_2;
--source suite/funcs_1/include/show_connection.inc
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
CALL sp5_s_i();
CALL sp5_ins();
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
CALL sp5_sel();
# now 'add' SELECT to DEFINER
connection default;
--source suite/funcs_1/include/show_connection.inc
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
CALL sp5_sel();
grant SELECT on db_storedproc_1.* to 'user_1'@'localhost';
#grant execute on db_storedproc_1.* to 'user_2'@'localhost';
@ -288,9 +300,9 @@ flush privileges;
connection user5_2;
--source suite/funcs_1/include/show_connection.inc
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
CALL sp5_s_i();
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
CALL sp5_ins();
CALL sp5_sel();
@ -302,11 +314,11 @@ flush privileges;
connection user5_2;
--source suite/funcs_1/include/show_connection.inc
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
CALL sp5_s_i();
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
CALL sp5_ins();
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
CALL sp5_sel();
# cleanup
@ -373,9 +385,9 @@ disconnect user6_1;
connect (user6_2, localhost, user_2, , db_storedproc_1);
--source suite/funcs_1/include/show_connection.inc
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
CALL sp3166_s_i();
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
CALL sp3166_ins();
CALL sp3166_sel();
@ -405,10 +417,10 @@ FLUSH PRIVILEGES;
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (user6_4, localhost, user_2, , db_storedproc_1);
--source suite/funcs_1/include/show_connection.inc
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
CALL sp3166_s_i();
CALL sp3166_ins();
--error 1142
--error ER_TABLEACCESS_DENIED_ERROR
CALL sp3166_sel();
disconnect user6_4;
@ -422,11 +434,11 @@ FLUSH PRIVILEGES;
--replace_result $MASTER_MYPORT MYSQL_PORT $MASTER_MYSOCK MYSQL_SOCK
connect (user6_5, localhost, user_2, , db_storedproc_1);
--source suite/funcs_1/include/show_connection.inc
--error 1370
--error ER_PROCACCESS_DENIED_ERROR
CALL sp3166_s_i();
--error 1370
--error ER_PROCACCESS_DENIED_ERROR
CALL sp3166_ins();
--error 1370
--error ER_PROCACCESS_DENIED_ERROR
CALL sp3166_sel();
disconnect user6_5;
@ -447,6 +459,7 @@ DROP USER 'user_2'@'localhost';
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
# ==============================================================================
let $message= . +++ END OF SCRIPT +++;
--source include/show_msg80.inc
--echo
--echo . +++ END OF SCRIPT +++
--echo --------------------------------------------------------------------------------
# ==============================================================================

View File

@ -7,14 +7,21 @@
#
# 3.1.10 CALL checks:
#
## 1. Ensure that a properly defined procedure can always be called, assuming the appropriate privileges exist.
#- 2. Ensure that a procedure cannot be called if the appropriate privileges do not exist.
## 1. Ensure that a properly defined procedure can always be called, assuming
# the appropriate privileges exist.
#- 2. Ensure that a procedure cannot be called if the appropriate privileges
# do not exist.
## 3. Ensure that a function can never be called.
## 4. Ensure that a properly defined function can always be executed, assuming the appropriate privileges exist.
#- 5. Ensure that a function cannot be executed if the appropriate privileges do not exist.
## 4. Ensure that a properly defined function can always be executed, assuming
# the appropriate privileges exist.
#- 5. Ensure that a function cannot be executed if the appropriate privileges
# do not exist.
## 6. Ensure that a procedure can never be executed.
## 7. Ensure that the ROW_COUNT() SQL function always returns the correct number of rows affected by the execution of a stored procedure.
## 8. Ensure that the mysql_affected_rows() C API function always returns the correct number of rows affected by the execution of a stored procedure.
## 7. Ensure that the ROW_COUNT() SQL function always returns the correct
# number of rows affected by the execution of a stored procedure.
## 8. Ensure that the mysql_affected_rows() C API function always returns
# the correct number of rows affected by the execution of a
# stored procedure.
#
# ==============================================================================
let $message= Section 3.1.10 - CALL checks:;
@ -54,7 +61,7 @@ connect (user2_1, localhost, user_1, , db_storedproc);
delimiter //;
CREATE PROCEDURE sp31102 () SQL SECURITY INVOKER
BEGIN
SELECT * FROM db_storedproc.t1 LIMIT 1;
SELECT * FROM db_storedproc.t1 WHERE f4=-5000 LIMIT 1;
END//
delimiter ;//
@ -74,12 +81,14 @@ connect (user2_2, localhost, user_2, , db_storedproc);
--source suite/funcs_1/include/show_connection.inc
# no privileges exist
--error 1370
--error ER_PROCACCESS_DENIED_ERROR
CALL sp31102();
SELECT fn31105( 9 );
# now 'add' EXECUTE to INVOKER
--echo connection default;
connection default;
USE db_storedproc;
--source suite/funcs_1/include/show_connection.inc
# root can execute ...
CALL sp31102();
@ -97,7 +106,9 @@ SELECT fn31105( 9 );
disconnect user2_3;
# now 'remove' SELECT from INVOKER
--echo connection default;
connection default;
USE db_storedproc;
--source suite/funcs_1/include/show_connection.inc
REVOKE EXECUTE ON db_storedproc.* FROM 'user_2'@'localhost';
FLUSH PRIVILEGES;
@ -115,6 +126,7 @@ disconnect user2_4;
# cleanup
connection default;
USE db_storedproc;
--source suite/funcs_1/include/show_connection.inc
DROP PROCEDURE sp31102;
@ -142,7 +154,7 @@ BEGIN
END//
delimiter ;//
--error 1305
--error ER_SP_DOES_NOT_EXIST
CALL fn1();
# cleanup
@ -168,7 +180,7 @@ BEGIN
END//
delimiter ;//
--error 1305
--error ER_SP_DOES_NOT_EXIST
SELECT sp1();
# cleanup
@ -182,26 +194,32 @@ let $message=
Ensure that the ROW_COUNT() SQL function always returns the correct number of
rows affected by the execution of a stored procedure.;
--source include/show_msg80.inc
# Note(mleich): Information taken from a comments in
# Bug#21818 Return value of ROW_COUNT() is incorrect for
# ALTER TABLE, LOAD DATA
# ROW_COUNT() is -1 following any statement which is not DELETE, INSERT
# or UPDATE.
# Also, after a CALL statement, ROW_COUNT() will return the value of the
# last statement in the stored procedure.
--disable_warnings
DROP PROCEDURE IF EXISTS sp_ins_1;
DROP PROCEDURE IF EXISTS sp_ins_3;
DROP PROCEDURE IF EXISTS sp_upd;
DROP PROCEDURE IF EXISTS sp_ins_upd;
DROP PROCEDURE IF EXISTS sp_del;
DROP PROCEDURE IF EXISTS sp_with_rowcount;
--enable_warnings
CREATE TABLE temp(f1 CHAR(20),f2 CHAR(25),f3 DATE,f4 INT,f5 CHAR(25),f6 INT);
INSERT INTO temp SELECT * FROM t10;
delimiter //;
#FIXME: add to proc: SELECT row_count() 'ins';
CREATE PROCEDURE sp_ins_1()
BEGIN
INSERT INTO temp VALUES ('abc', 'abc', '20051003', 100, 'uvw', 1000);
END//
#FIXME: add to proc: SELECT row_count() 'ins_3';
CREATE PROCEDURE sp_ins_3()
BEGIN
INSERT INTO temp VALUES ('abc', 'xyz', '19490523', 100, 'uvw', 1000);
@ -209,26 +227,11 @@ BEGIN
INSERT INTO temp VALUES ('abc', 'xyz', '2005-10-24', 100, 'uvw', 1000);
END//
# FIXME: add to proc: SELECT row_count() AS 'updated';
CREATE PROCEDURE sp_upd()
BEGIN
UPDATE temp SET temp.f1 = 'updated' WHERE temp.f1 ='abc';
END//
# FIXME: use commented proc
# CREATE PROCEDURE sp_ins_upd()
# BEGIN
# BEGIN
# INSERT INTO temp VALUES ('qwe', 'abc', '1989-11-09', 100, 'uvw', 1000);
# INSERT INTO temp VALUES ('qwe', 'xyz', '1998-03-26', 100, 'uvw', 1000);
# INSERT INTO temp VALUES ('qwe', 'abc', '2000-11-09', 100, 'uvw', 1000);
# INSERT INTO temp VALUES ('qwe', 'abc', '2005-11-07', 100, 'uvw', 1000);
# END;
# SELECT row_count() AS 'insert "qwe"';
# SELECT COUNT( f1 ), f1 FROM temp GROUP BY f1;
# UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f1 ='qwe' AND temp.f2 = 'abc';
# SELECT row_count() AS 'update "qwe" AND "abc"';
# END//
CREATE PROCEDURE sp_ins_upd()
BEGIN
BEGIN
@ -240,31 +243,70 @@ BEGIN
SELECT COUNT( f1 ), f1 FROM temp GROUP BY f1;
UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f1 ='qwe' AND temp.f2 = 'abc';
END//
CREATE PROCEDURE sp_del()
BEGIN
DELETE FROM temp WHERE temp.f1 ='qwe' OR temp.f1 = 'updated_2';
END//
CREATE PROCEDURE sp_with_rowcount()
BEGIN
BEGIN
INSERT INTO temp VALUES ('qwe', 'abc', '1989-11-09', 100, 'uvw', 1000),
('qwe', 'xyz', '1998-03-26', 100, 'uvw', 1000),
('qwe', 'abc', '2000-11-09', 100, 'uvw', 1000),
('qwe', 'xyz', '2005-11-07', 100, 'uvw', 1000);
END;
SELECT row_count() AS 'row_count() after insert';
SELECT row_count() AS 'row_count() after select row_count()';
SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3;
UPDATE temp SET temp.f1 = 'updated_2' WHERE temp.f2 = 'abc';
SELECT row_count() AS 'row_count() after update';
SELECT f1,f2,f3 FROM temp ORDER BY f1,f2,f3;
DELETE FROM temp WHERE temp.f1 = 'updated_2';
SELECT row_count() AS 'row_count() after delete';
END//
delimiter ;//
CALL sp_ins_1();
SELECT row_count();
--sorted_result
SELECT * FROM temp;
CALL sp_ins_3();
#FIXME: check is 1 correct here? I expect 3 for 3 inserted rows inside the procedure
SELECT row_count();
--sorted_result
SELECT * FROM temp;
CALL sp_upd();
SELECT row_count();
--sorted_result
SELECT * FROM temp;
#FIXME: check is 3 correct here? I expect 7 for 4 inserted and then 3 updated rows inside the procedure
CALL sp_ins_upd();
SELECT row_count();
--sorted_result
SELECT * FROM temp;
CALL sp_del();
SELECT row_count();
--sorted_result
SELECT * FROM temp;
DELETE FROM temp;
CALL sp_with_rowcount();
SELECT row_count();
--sorted_result
SELECT * FROM temp;
# cleanup
DROP PROCEDURE sp_ins_1;
DROP PROCEDURE sp_ins_3;
DROP PROCEDURE sp_upd;
DROP PROCEDURE sp_ins_upd;
DROP PROCEDURE sp_del;
DROP PROCEDURE sp_with_rowcount;
DROP TABLE temp;
@ -283,6 +325,7 @@ number of rows affected by the execution of a stored procedure.;
--source suite/funcs_1/storedproc/cleanup_sp_tb.inc
# ==============================================================================
let $message= . +++ END OF SCRIPT +++;
--source include/show_msg80.inc
--echo
--echo . +++ END OF SCRIPT +++
--echo --------------------------------------------------------------------------------
# ==============================================================================

View File

@ -174,7 +174,7 @@ WHERE table_schema = 'db_datadict' ORDER BY table_name LIMIT 1;
SELECT @table_name,@table_schema;
#
# SELECT INTO OUTFILE
let $OUTFILE = $MYSQL_TMP_DIR/datadict.out;
let $OUTFILE = $MYSQLTEST_VARDIR/tmp/datadict.out;
--error 0,1
remove_file $OUTFILE;
--replace_result $OUTFILE <OUTFILE>

View File

@ -79,17 +79,17 @@ use test;
#Cleanup
--disable_warnings
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg1_1;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg1_2;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg1_3;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg1_4;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg1_5;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg1_6;
--enable_warnings
delete from tb3 where f121='Test 3.5.1.1';
@ -101,13 +101,13 @@ use test;
let $message= Testcase: 3.5.1.2:;
--source include/show_msg.inc
--error 1064
--error ER_PARSE_ERROR
Create trigger trg_1 after insert
on tb3 for each statement set @x= 1;
#Cleanup
--disable_warnings
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg_1;
--enable_warnings
@ -116,19 +116,19 @@ let $message= Testcase: 3.5.1.2:;
# Testcase: Ensure that all supported clauses are supported only in the correct order.
let $message= Testcase 3.5.1.3:;
--source include/show_msg.inc
--error 1064
--error ER_PARSE_ERROR
CREATE TRIGGER trg3_1 on tb3 BEFORE INSERT for each row set new.f120 = 't';
--error 1064
--error ER_PARSE_ERROR
CREATE trg3_2 TRIGGER AFTER INSERT on tb3 for each row set new.f120 = 's';
--error 1064
--error ER_PARSE_ERROR
CREATE TRIGGER trg3_3 Before DELETE on tb3 set @ret1 = 'test' for each row;
--error 1064
--error ER_PARSE_ERROR
CREATE TRIGGER trg3_4 DELETE AFTER on tb3 set @ret1 = 'test' for each row;
--error 1064
--error ER_PARSE_ERROR
CREATE for each row TRIGGER trg3_5 AFTER UPDATE on tb3 set @ret1 = 'test';
#Cleanup
@ -136,15 +136,15 @@ let $message= Testcase 3.5.1.3:;
# since if they have been created, not dropping them will affect following
# tests.
--disable_warnings
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg3_1;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg3_2;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg3_3;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg3_4;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg3_5;
--enable_warnings
@ -160,22 +160,22 @@ let $message= Testcase 3.5.1.3:;
let $message= Testcase: 3.5.1.5:;
--source include/show_msg.inc
--error 1064
--error ER_PARSE_ERROR
CREATE TRIGGER trg4_1 AFTER on tb3 for each row set new.f120 = 'e';
--error 1064
--error ER_PARSE_ERROR
CREATE TRIGGER trg4_2 INSERT on tb3 for each set row new.f120 = 'f';
--error 1064
--error ER_PARSE_ERROR
CREATE TRIGGER trg4_3 BEFORE INSERT tb3 for each row set new.f120 = 'g';
--error 1064
--error ER_PARSE_ERROR
CREATE TRIGGER trg4_4 AFTER UPDATE on tb3 for each set new.f120 = 'g';
--error 1064
--error ER_PARSE_ERROR
CREATE trg4_5 AFTER DELETE on tb3 for each set new.f120 = 'g';
--error 1064
--error ER_PARSE_ERROR
CREATE TRIGGER trg4_6 BEFORE DELETE for each row set new.f120 = 'g';
#Cleanup
@ -183,17 +183,17 @@ let $message= Testcase: 3.5.1.5:;
# since if they have been created, not dropping them will affect following
# tests.
--disable_warnings
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg4_1;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg4_2;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg4_3;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg4_4;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg4_5;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg4_6;
--enable_warnings
@ -221,11 +221,11 @@ let $message= Testcase 3.5.1.7: - need to fix;
select * from t1;
update t1 set f2='update 3.5.1.7';
select * from t1;
select trigger_name from information_schema.triggers;
select trigger_name from information_schema.triggers order by trigger_name;
#Cleanup
--disable_warnings
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg5_1;
# The above trigger should be dropped since the name was trimmed.
drop trigger trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ;
@ -237,22 +237,22 @@ let $message= Testcase 3.5.1.7: - need to fix;
let $message= Testcase 3.5.1.8:;
--source include/show_msg.inc
--error 1064
--error ER_PARSE_ERROR
CREATE TRIGGER trg12* before insert on tb3 for each row set new.f120 = 't';
--error 1064
--error ER_PARSE_ERROR
CREATE TRIGGER trigger before insert on tb3 for each row set new.f120 = 't';
--error 1064
--error ER_PARSE_ERROR
CREATE TRIGGER 100 before insert on tb3 for each row set new.f120 = 't';
--error 1064
--error ER_PARSE_ERROR
CREATE TRIGGER @@view before insert on tb3 for each row set new.f120 = 't';
--error 1064
--error ER_PARSE_ERROR
CREATE TRIGGER @name before insert on tb3 for each row set new.f120 = 't';
--error 1435
--error ER_TRG_IN_WRONG_SCHEMA
CREATE TRIGGER tb3.trg6_1 BEFORE INSERT on test.tb3
for each row set new.f120 ='X';
@ -265,13 +265,13 @@ let $message= Testcase 3.5.1.8:;
# Can't create a trigger in a different database
use test;
--error 1146
--error ER_NO_SUCH_TABLE
CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3
for each row set @ret_trg6_2 = 5;
# Can't create a trigger refrencing a table in a different db
use trig_db;
--error 1435
--error ER_TRG_IN_WRONG_SCHEMA
CREATE TRIGGER trg6_3 AFTER INSERT on test.tb3
for each row set @ret_trg6_3 = 18;
@ -283,9 +283,9 @@ let $message= Testcase 3.5.1.8:;
# OBN - Although none of the above should have been created we should do a cleanup
# since if they have been created, not dropping them will affect following
# tests.
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg6_1;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg6_3;
--enable_warnings
@ -304,12 +304,12 @@ let $message= Testcase 3.5.1.10:;
CREATE TRIGGER trg7_1 BEFORE UPDATE on tb3 for each row set new.f120 ='X';
--error 1359
--error ER_TRG_ALREADY_EXISTS
CREATE TRIGGER trg7_1 AFTER INSERT on tb3 for each row set @x ='Y';
#Cleanup
--disable_warnings
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg7_1;
--enable_warnings
@ -330,7 +330,7 @@ let $message= Testcase 3.5.1.?:;
create trigger trig before insert on t1
for each row set new.f1 ='trig t1';
--error 1359
--error ER_TRG_ALREADY_EXISTS
create trigger trig before update on t2
for each row set new.f1 ='trig t2';
@ -346,7 +346,7 @@ let $message= Testcase 3.5.1.?:;
--disable_warnings
drop table t1;
drop table t2;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trig;
--enable_warnings
@ -385,10 +385,10 @@ let $message= Testcase 3.5.1.11:;
insert into trig_db2.t2 (f1,f2) values ('insert to db2 t2 from db1',3);
insert into trig_db3.t1 (f1,f2) values ('insert to db3 t1 from db1',4);
select @test_var1, @test_var2, @test_var3;
select * from t1;
select * from t1 order by f2;
select * from trig_db2.t2;
select * from trig_db3.t1;
select * from t1;
select * from t1 order by f2;
use test;
#Cleanup
@ -434,7 +434,7 @@ let $message= Testcase 3.5.2.1/2/3:;
create trigger trig_db2.trig2 before insert on trig_db2.t1
for each row set @test_var3='trig2';
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers;
from information_schema.triggers order by trigger_name;
set @test_var1= '', @test_var2= '', @test_var3= '';
insert into t1 (f1,f2) values ('insert to db1 t1 from db1',352);

View File

@ -63,14 +63,14 @@ let $message= Testcase 3.5.3.2:;
select current_user;
use priv_db;
--error 1227
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
create trigger trg1_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.2_1-no';
connection default;
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.2-no');
select f1 from t1;
select f1 from t1 order by f1;
connection yes_privs;
select current_user;
@ -83,29 +83,27 @@ let $message= Testcase 3.5.3.2:;
select current_user;
use priv_db;
# Added following the fix to bug 5861
--error 1143
--error ER_COLUMNACCESS_DENIED_ERROR
insert into t1 (f1) values ('insert 3.5.3.2-yes');
select f1 from t1;
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
let $message= note: once 15166 is fixed a similar case for SELECT needs to be added;
--source include/show_msg.inc
select f1 from t1 order by f1;
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.2-yes');
select f1 from t1;
select f1 from t1 order by f1;
let $message= Testcase 3.5.3.6:;
--source include/show_msg.inc
connection no_privs;
use priv_db;
--error 1227
--error ER_SPECIFIC_ACCESS_DENIED_ERROR
drop trigger trg1_2;
connection default;
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-yes');
select f1 from t1;
select f1 from t1 order by f1;
connection yes_privs;
use priv_db;
@ -115,12 +113,12 @@ let $message= Testcase 3.5.3.6:;
connection default;
use priv_db;
insert into t1 (f1) values ('insert 3.5.3.6-no');
select f1 from t1;
select f1 from t1 order by f1;
# Cleanup
--disable_warnings
connection default;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg1_2;
disconnect no_privs;
disconnect yes_privs;
@ -131,8 +129,6 @@ let $message= Testcase 3.5.3.6:;
# Test case: Ensure that use of the construct "SET NEW. <column name> = <value>"
# fails at CREATE TRIGGER time, if the current user does not have the
# UPDATE privilege on the column specified
# Note: As a result of bug 8884 the triggers are actually created.
# Disabled because of bug 8884
# --- 3.5.3.7a - Privs set on a global level
let $message=Testcase 3.5.3.7a:;
@ -156,18 +152,15 @@ let $message=Testcase 3.5.3.7a:;
select current_user;
use priv_db;
show grants;
select f1 from t1;
select f1 from t1 order by f1;
let $message= Trigger create disabled - should fail - Bug 8884;
--source include/show_msg.inc
# --error 1227
# create trigger trg4a_1 before INSERT on t1 for each row
# set new.f1 = 'trig 3.5.3.7-1a';
create trigger trg4a_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1a';
connection default;
--error ER_COLUMNACCESS_DENIED_ERROR
insert into t1 (f1) values ('insert 3.5.3.7-1a');
select f1 from t1;
--error 0, 1360
select f1 from t1 order by f1;
drop trigger trg4a_1;
connection yes_privs_424a;
@ -179,14 +172,8 @@ let $message= Trigger create disabled - should fail - Bug 8884;
connection default;
# Added to bypass bug 15166
let $message= SELECT priv added to bypass bug 15166;
--source include/show_msg.inc
grant SELECT on *.* to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.7-2b');
select f1 from t1;
select f1 from t1 order by f1;
# Cleanup
--disable_warnings
@ -220,18 +207,14 @@ let $message= Testcase 3.5.3.7b:;
show grants;
use priv_db;
let $message= Trigger create disabled - should fail - Bug 8884;
--source include/show_msg.inc
# --error 1227
# create trigger trg4b_1 before UPDATE on t1 for each row
# set new.f1 = 'trig 3.5.3.7-1b';
create trigger trg4b_1 before UPDATE on t1 for each row
set new.f1 = 'trig 3.5.3.7-1b';
connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1b');
select f1 from t1;
select f1 from t1 order by f1;
update t1 set f1 = 'update 3.5.3.7-1b' where f1 = 'insert 3.5.3.7-1b';
select f1 from t1;
--error 0, 1360
select f1 from t1 order by f1;
drop trigger trg4b_1;
connection yes_privs_424b;
@ -242,15 +225,10 @@ let $message= Trigger create disabled - should fail - Bug 8884;
connection default;
# Added to bypass bug 15166
let $message= SELECT priv added to bypass bug 15166;
--source include/show_msg.inc
grant SELECT on priv_db.* to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.7-2b');
select f1 from t1;
select f1 from t1 order by f1;
update t1 set f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
select f1 from t1;
select f1 from t1 order by f1;
# Cleanup
--disable_warnings
drop trigger trg4b_2;
@ -283,16 +261,12 @@ let $message= Testcase 3.5.3.7c;
show grants;
use priv_db;
let $message= Trigger create disabled - should fail - Bug 8884;
--source include/show_msg.inc
# --error 1227
# create trigger trg4c_1 before INSERT on t1 for each row
# set new.f1 = 'trig 3.5.3.7-1c';
create trigger trg4c_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1c';
connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1c');
select f1 from t1;
--error 0, 1360
select f1 from t1 order by f1;
drop trigger trg4c_1;
connection yes_privs_424c;
@ -303,13 +277,8 @@ let $message= Trigger create disabled - should fail - Bug 8884;
connection default;
# Added to bypass bug 15166
let $message= SELECT priv added to bypass bug 15166;
--source include/show_msg.inc
grant SELECT on priv_db.t1 to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.7-2c');
select f1 from t1;
select f1 from t1 order by f1;
# Cleanup
--disable_warnings
@ -344,16 +313,12 @@ let $message= Testcase 3.5.3.7d:;
connection no_privs_424d;
show grants;
use priv_db;
let $message= Trigger create disabled - should fail - Bug 8884;
--source include/show_msg.inc
# --error 1227
# create trigger trg4d_1 before INSERT on t1 for each row
# set new.f1 = 'trig 3.5.3.7-1d';
create trigger trg4d_1 before INSERT on t1 for each row
set new.f1 = 'trig 3.5.3.7-1d';
connection default;
insert into t1 (f1) values ('insert 3.5.3.7-1d');
select f1 from t1;
--error 0, 1360
select f1 from t1 order by f1;
drop trigger trg4d_1;
connection yes_privs_424d;
@ -364,13 +329,8 @@ let $message= Trigger create disabled - should fail - Bug 8884;
connection default;
# Added to bypass bug 15166
let $message= SELECT priv added to bypass bug 15166;
--source include/show_msg.inc
grant SELECT (f1) on priv_db.t1 to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.7-2d');
select f1 from t1;
select f1 from t1 order by f1;
# Cleanup
--disable_warnings
@ -408,18 +368,14 @@ let $message= Testcase 3.5.3.8a:;
use priv_db;
show grants;
let $message= Trigger create disabled - should fail - Bug 8887;
--source include/show_msg.inc
# --error 1227
# create trigger trg5a_1 before INSERT on t1 for each row
# set @test_var = new.f1;
create trigger trg5a_1 before INSERT on t1 for each row
set @test_var = new.f1;
connection default;
set @test_var = 'before trig 3.5.3.8-1a';
select @test_var;
insert into t1 (f1) values ('insert 3.5.3.8-1a');
select @test_var;
--error 0, 1360
drop trigger trg5a_1;
connection yes_privs_425a;
@ -433,11 +389,6 @@ let $message= Trigger create disabled - should fail - Bug 8887;
set @test_var= 'before trig 3.5.3.8-2a';
select @test_var;
# Added to bypass bug 15166
let $message= UPDATE priv added to bypass bug 15166;
--source include/show_msg.inc
grant UPDATE on *.* to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.8-2a');
select @test_var;
@ -473,11 +424,8 @@ let $message= Testcase: 3.5.3.8b;
show grants;
use priv_db;
let $message= Trigger create disabled - should fail - Bug 8887;
--source include/show_msg.inc
# --error 1227
# create trigger trg5b_1 before UPDATE on t1 for each row
# set @test_var= new.f1;
create trigger trg5b_1 before UPDATE on t1 for each row
set @test_var= new.f1;
connection default;
set @test_var= 'before trig 3.5.3.8-1b';
@ -485,7 +433,6 @@ let $message= Trigger create disabled - should fail - Bug 8887;
select @test_var;
update t1 set f1= 'update 3.5.3.8-1b' where f1 = 'insert 3.5.3.8-1b';
select @test_var;
--error 0, 1360
drop trigger trg5b_1;
connection yes_privs_425b;
@ -499,11 +446,6 @@ let $message= Trigger create disabled - should fail - Bug 8887;
insert into t1 (f1) values ('insert 3.5.3.8-2b');
select @test_var;
# Added to bypass bug 15166
let $message= UPDATE priv added to bypass bug 15166;
--source include/show_msg.inc
grant UPDATE on priv_db.* to test_yesprivs@localhost;
update t1 set f1= 'update 3.5.3.8-2b' where f1 = 'insert 3.5.3.8-2b';
select @test_var;
# Cleanup
@ -538,17 +480,13 @@ let $message= Testcase 3.5.3.8c:;
show grants;
use priv_db;
let $message= Trigger create disabled - should fail - Bug 8887;
--source include/show_msg.inc
# --error 1227
# create trigger trg5c_1 before INSERT on t1 for each row
# set @test_var= new.f1;
create trigger trg5c_1 before INSERT on t1 for each row
set @test_var= new.f1;
connection default;
set @test_var= 'before trig 3.5.3.8-1c';
insert into t1 (f1) values ('insert 3.5.3.8-1c');
select @test_var;
--error 0, 1360
drop trigger trg5c_1;
connection yes_privs_425c;
@ -560,11 +498,6 @@ let $message= Trigger create disabled - should fail - Bug 8887;
connection default;
set @test_var='before trig 3.5.3.8-2c';
# Added to bypass bug 15166
let $message= UPDATE priv added to bypass bug 15166;
--source include/show_msg.inc
grant UPDATE on priv_db.t1 to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.8-2c');
select @test_var;
# Cleanup
@ -598,17 +531,13 @@ let $message=Testcase: 3.5.3.8d:;
connection no_privs_425d;
show grants;
use priv_db;
let $message= Trigger create disabled - should fail - Bug 8887;
--source include/show_msg.inc
# --error 1227
# create trigger trg5d_1 before INSERT on t1 for each row
# set @test_var= new.f1;
create trigger trg5d_1 before INSERT on t1 for each row
set @test_var= new.f1;
connection default;
set @test_var='before trig 3.5.3.8-1d';
insert into t1 (f1) values ('insert 3.5.3.8-1d');
select @test_var;
--error 0, 1360
drop trigger trg5d_1;
connection yes_privs_425d;
@ -620,11 +549,6 @@ let $message= Trigger create disabled - should fail - Bug 8887;
connection default;
set @test_var='before trig 3.5.3.8-2d';
# Added to bypass bug 15166
let $message= UPDATE priv added to bypass bug 15166;
--source include/show_msg.inc
grant UPDATE (f1) on priv_db.t1 to test_yesprivs@localhost;
insert into t1 (f1) values ('insert 3.5.3.8-2d');
select @test_var;
@ -633,8 +557,7 @@ let $message= UPDATE priv added to bypass bug 15166;
drop trigger trg5d_2;
--enable_warnings
# --- 3.5.3.x - additional tests following the fix to bug 5861 / WL 2818
# to test for trigger definer privs in the case of trigger
# --- 3.5.3.x to test for trigger definer privs in the case of trigger
# actions (insert/update/delete/select) performed on other
# tables.
let $message=Testcase: 3.5.3.x:;
@ -671,8 +594,8 @@ let $message=Testcase: 3.5.3.x:;
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
grant INSERT on priv_db.t2 to test_yesprivs@localhost;
insert into t1 (f1) values (4);
select f1 from t1;
select f2 from t2;
select f1 from t1 order by f1;
select f2 from t2 order by f2;
connection yes_353x;
use priv_db;
@ -687,8 +610,8 @@ let $message=Testcase: 3.5.3.x:;
revoke INSERT on priv_db.t2 from test_yesprivs@localhost;
grant UPDATE on priv_db.t2 to test_yesprivs@localhost;
insert into t1 (f1) values (2);
select f1 from t1;
select f2 from t2;
select f1 from t1 order by f1;
select f2 from t2 order by f2;
connection yes_353x;
use priv_db;
@ -703,8 +626,8 @@ let $message=Testcase: 3.5.3.x:;
revoke UPDATE on priv_db.t2 from test_yesprivs@localhost;
grant SELECT on priv_db.t2 to test_yesprivs@localhost;
insert into t1 (f1) values (1);
select f1 from t1;
select f2 from t2;
select f1 from t1 order by f1;
select f2 from t2 order by f2;
select @aaa;
connection yes_353x;
@ -720,8 +643,8 @@ let $message=Testcase: 3.5.3.x:;
revoke SELECT on priv_db.t2 from test_yesprivs@localhost;
grant DELETE on priv_db.t2 to test_yesprivs@localhost;
insert into t1 (f1) values (1);
select f1 from t1;
select f2 from t2;
select f1 from t1 order by f1;
select f2 from t2 order by f2;

View File

@ -51,20 +51,20 @@ let $message= Testcase 3.5.4.1:;
connection con1_general;
Use db_drop;
Insert into t1 values ('Insert error 3.5.4.1');
Select * from t1;
Select * from t1 order by f1;
connection con1_super;
drop trigger trg1;
select trigger_schema, trigger_name, event_object_table
from information_schema.triggers;
from information_schema.triggers order by trigger_name;
connection con1_general;
Insert into t1 values ('Insert no trigger 3.5.4.1');
Select * from t1;
Select * from t1 order by f1;
#Cleanup
--disable_warnings
connection con1_super;
--disable_warnings
--error 0,1360
--error 0,ER_TRG_DOES_NOT_EXIST
drop trigger trg1;
drop database if exists db_drop;
revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
@ -83,7 +83,7 @@ let $message= Testcase 3.5.4.2:;
drop table if exists t1_432 ;
--enable_warnings
eval create table t1_432 (f1 char (30)) engine=$engine_type;
--error 1360
--error ER_TRG_DOES_NOT_EXIST
Drop trigger tr_does_not_exit;
#cleanup
--disable_warnings
@ -111,19 +111,19 @@ let $message= Testcase 3.5.4.3:;
set new.f1 = 'Trigger 3.5.4.3';
# Using table
--error 1064
--error ER_PARSE_ERROR
Drop trigger t1.433.trg3;
# Using database.table
--error 1064
--error ER_PARSE_ERROR
Drop trigger db_drop3.t1.433.trg3;
# wrong database
--error 1360
--error ER_TRG_DOES_NOT_EXIST
Drop trigger mysql.trg3;
# database does not exist
--error 1360
--error ER_TRG_DOES_NOT_EXIST
Drop trigger tbx.trg3;
#cleanup
@ -166,7 +166,7 @@ let $message= Testcase 3.5.4.4:;
#Cleanup
connection con1_super;
--disable_warnings
--error 1360
--error ER_TRG_DOES_NOT_EXIST
drop trigger trg4;
drop database if exists db_drop4;
--enable_warnings
@ -204,7 +204,7 @@ let $message= Testcase 3.5.4.5:;
#Cleanup
connection con1_super;
--disable_warnings
--error 1360
--error ER_TRG_DOES_NOT_EXIST
drop trigger trg5;
drop database if exists db_drop5;
--enable_warnings
@ -228,7 +228,7 @@ let $message= Testcase 3.5.5:;
let $message= Testcase 3.5.5.1:;
--source include/show_msg.inc
--error 1146
--error ER_NO_SUCH_TABLE
Create trigger trg1 before INSERT on t100 for each row set new.f2=1000;
@ -240,7 +240,7 @@ let $message= Testcase 3.5.5.2:;
Create temporary table t1_temp (f1 bigint signed, f2 bigint unsigned);
--error 1361
--error ER_TRG_ON_VIEW_OR_TEMP_TABLE
Create trigger trg2 before INSERT
on t1_temp for each row set new.f2=9999;
@ -258,8 +258,8 @@ let $message= Testcase 3.5.5.3:;
Create view vw3 as select f118 from tb3;
# OBN Not sure why the server is returning error 1347
--error 1347
# OBN Not sure why the server is returning error ER_WRONG_OBJECT
--error ER_WRONG_OBJECT
Create trigger trg3 before INSERT
on vw3 for each row set new.f118='s';
@ -283,7 +283,7 @@ let $message= Testcase 3.5.5.4:;
use dbtest_two;
eval create table t2 (f1 char(15)) engine=$engine_type;
use dbtest_one;
--error 1435
--error ER_TRG_IN_WRONG_SCHEMA
create trigger trg4 before INSERT
on dbtest_two.t2 for each row set new.f1='trig 3.5.5.4';
grant INSERT, SELECT on dbtest_two.t2 to test_general;
@ -294,7 +294,7 @@ let $message= Testcase 3.5.5.4:;
Select * from t2;
use dbtest_one;
Insert into dbtest_two.t2 values ('2nd Insert 3.5.5.4');
Select * from dbtest_two.t2;
Select * from dbtest_two.t2 order by f1;
#Cleanup
connection con1_super;
@ -334,9 +334,9 @@ let $message= Testcase 3.5.6.2 (see Testcase 3.5.1.1);
let $message= Testcase 3.5.6.3:;
--source include/show_msg.inc
--error 1064
--error ER_PARSE_ERROR
Create trigger trg3_1 DURING UPDATE on tb3 for each row set new.f132=25;
--error 1064
--error ER_PARSE_ERROR
Create trigger trg3_2 TIME INSERT on tb3 for each row set new.f132=15;
#Cleanup
@ -344,9 +344,9 @@ let $message= Testcase 3.5.6.3:;
# since if they have been created, not dropping them will affect following
# tests.
--disable_warnings
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger tb3.trg3_1;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger tb3.trg3_2;
--enable_warnings
@ -390,9 +390,9 @@ let $message= Testcase 3.5.7.3 (see Testcase 3.5.1.1);
let $message= Testcase 3.5.7.4:;
--source include/show_msg.inc
--error 1064
--error ER_PARSE_ERROR
Create trigger trg4_1 BEFORE SELECT on tb3 for each row set new.f132=5;
--error 1064
--error ER_PARSE_ERROR
Create trigger trg4_2 AFTER VALUE on tb3 for each row set new.f132=1;
#Cleanup
@ -400,9 +400,9 @@ let $message= Testcase 3.5.7.4:;
# since if they have been created, not dropping them will affect following
# tests.
--disable_warnings
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger tb3.trg4_1;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger tb3.trg4_2;
--enable_warnings
@ -428,7 +428,7 @@ let $message= Testcase 3.5.7.5 / 3.5.7.6:;
#Cleanup
--disable_warnings
drop trigger trg5_1;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg5_2;
delete from tb3 where f121='Test 3.5.7.5/6';
--enable_warnings
@ -460,7 +460,7 @@ let $message= Testcase 3.5.7.7 / 3.5.7.8:;
#Cleanup
--disable_warnings
drop trigger trg6_1;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg6_2;
delete from tb3 where f121='Test 3.5.7.7/8';
--enable_warnings
@ -488,7 +488,7 @@ let $message= Testcase 3.5.7.9/10:;
#Cleanup
--disable_warnings
drop trigger trg7_1;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg7_2;
delete from tb3 where f121='Test 3.5.7.9/10';
@ -520,7 +520,7 @@ let $message= Testcase 3.5.7.11/12:;
#Cleanup
--disable_warnings
drop trigger trg8_1;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg8_2;
delete from tb3 where f121='Test 3.5.7.11/12';
@ -552,7 +552,7 @@ let $message= Testcase 3.5.7.13/14:;
#Cleanup
--disable_warnings
drop trigger trg9_1;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg9_2;
delete from tb3 where f121='Test 3.5.7.13/14';
@ -571,7 +571,7 @@ let $message= Testcase 3.5.7.15/16:;
Create trigger trg_3_406010_2 AFTER DELETE
on tb3 for each row set @test_var=@test_var+50;
--error 1359
--error ER_TRG_ALREADY_EXISTS
Create trigger trg_3_406010_1 AFTER INSERT
on tb3 for each row set @test_var=@test_var+1;
@ -588,7 +588,7 @@ let $message= Testcase 3.5.7.15/16:;
#Cleanup
--disable_warnings
drop trigger trg_3_406010_1;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg_3_406010_2;
delete from tb3 where f121='Test 3.5.7.15/16';
--enable_warnings

View File

@ -34,8 +34,6 @@ let $message= Testcase: 3.5:;
let $message= Testcase 3.5.8.1: (implied in previous tests);
--source include/show_msg.inc
# OBN - FIXME - Missing 3.5.8.1 need to add
#Section 3.5.8.2
# Testcase: Ensure that the triggered actions of every trigger never results
# in an unexpected change made to the database.
@ -111,8 +109,11 @@ let $message= 3.5.8.4 - multiple SQL;
Insert into tb3 (f120, f122, f136, f144, f163)
values ('1', 'Test 3.5.8.4', 222, 23456, 1.05);
Select f120, f122, f136, f144, f163 from tb3 where f122= 'Test 3.5.8.4';
--sorted_result
select * from db_test.t1_i;
--sorted_result
select * from db_test.t1_u;
--sorted_result
select * from db_test.t1_d;
select @test_var;
@ -121,16 +122,22 @@ let $message= 3.5.8.4 - single SQL - insert;
--source include/show_msg.inc
# Trigger definition - single SQL Insert
connection con2_super;
delimiter //;
Create trigger trg2 BEFORE UPDATE on tb3 for each row
BEGIN
insert into db_test.t1_i
values (new.f120, new.f136, new.f144, new.f163);
END//
delimiter ;//
# Trigger exeution - single SQL Insert
connection con2_general;
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
select * from db_test.t1_i order by i120;
update tb3 set f120='I', f122='Test 3.5.8.4-Single Insert'
where f122='Test 3.5.8.4';
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
select * from db_test.t1_i;
select * from db_test.t1_i order by i120;
let $message= 3.5.8.4 - single SQL - update;
@ -148,7 +155,7 @@ let $message= 3.5.8.4 - single SQL - update;
update tb3 set f120='U', f122='Test 3.5.8.4-Single Update'
where f122='Test 3.5.8.4-Single Insert';
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
select * from db_test.t1_u;
select * from db_test.t1_u order by u120;
let $message= 3.5.8.3/4 - single SQL - delete;
@ -167,7 +174,7 @@ let $message= 3.5.8.3/4 - single SQL - delete;
where f122='Test 3.5.8.4-Single Update';
#unlock tables;
Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
select * from db_test.t1_d;
select * from db_test.t1_d order by d120;
let $message= 3.5.8.3/4 - single SQL - select;
@ -228,28 +235,28 @@ let $message= Testcase 3.5.8.5 (IF):;
set @test_var='Empty', @test_var2=0;
Insert into tb3 (f120, f122, f136) values ('1', 'Test 3.5.8.5-if', 101);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
Insert into tb3 (f120, f122, f136) values ('2', 'Test 3.5.8.5-if', 102);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 10);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 103);
select f120, f122, f136, @test_var, @test_var2
from tb3 where f122 = 'Test 3.5.8.5-if';
from tb3 where f122 = 'Test 3.5.8.5-if' order by f136;
delimiter //;
--error 1064
--error ER_PARSE_ERROR
create trigger trg3 before update on tb3 for each row
BEGIN
ELSEIF new.f120='2' then
END IF;
END//
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg3//
--error 1064
--error ER_PARSE_ERROR
create trigger trg4 before update on tb3 for each row
BEGIN
IF (new.f120='4') and (new.f136=10) then
@ -258,7 +265,7 @@ let $message= Testcase 3.5.8.5 (IF):;
set @test_var2='2nd else', new.f120='D';
END//
delimiter ;//
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg4;
#Cleanup
@ -313,31 +320,31 @@ let $message= Testcase 3.5.8.5-case:;
Insert into tb3 (f120, f122, f136, f144)
values ('a', 'Test 3.5.8.5-case', 5, 7);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
Insert into tb3 (f120, f122, f136, f144)
values ('b', 'Test 3.5.8.5-case', 71,16);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
Insert into tb3 (f120, f122, f136, f144)
values ('c', 'Test 3.5.8.5-case', 80,1);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
Insert into tb3 (f120, f122, f136)
values ('d', 'Test 3.5.8.5-case', 152);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
Insert into tb3 (f120, f122, f136, f144)
values ('e', 'Test 3.5.8.5-case', 200, 8);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
--error 0, 1339
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
--error 0, ER_SP_CASE_NOT_FOUND
Insert into tb3 (f120, f122, f136, f144)
values ('f', 'Test 3.5.8.5-case', 100, 8);
select f120, f122, f136, f144, @test_var
from tb3 where f122 = 'Test 3.5.8.5-case';
from tb3 where f122 = 'Test 3.5.8.5-case' order by f120,f136;
delimiter //;
--error 1064
--error ER_PARSE_ERROR
create trigger trg3a before update on tb3 for each row
BEGIN
CASE
@ -345,7 +352,7 @@ let $message= Testcase 3.5.8.5-case:;
END//
delimiter ;//
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg3a;
#Cleanup
@ -391,7 +398,7 @@ let $message= Testcase 3.5.8.5-loop/leave:;
delimiter //;
--error 1064
--error ER_PARSE_ERROR
Create trigger trg4_2 after update on tb3 for each row
BEGIN
Label1: loop
@ -399,7 +406,7 @@ let $message= Testcase 3.5.8.5-loop/leave:;
END;
END//
delimiter ;//
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg4_2;
#Cleanup
@ -434,7 +441,7 @@ let $message= Testcase 3.5.8.5-repeat:;
delimiter //;
--error 1064
--error ER_PARSE_ERROR
Create trigger trg6_2 after update on tb3 for each row
BEGIN
REPEAT
@ -471,7 +478,7 @@ let $message= Testcase 3.5.8.5-while:;
values ('Test 3.5.8.5-while', 7);
select @counter1, @counter2;
delimiter //;
--error 1064
--error ER_PARSE_ERROR
Create trigger trg7_2 after update on tb3 for each row
BEGIN
WHILE @counter1 < new.f136
@ -488,12 +495,25 @@ let $message= Testcase 3.5.8.5-while:;
#Section 3.5.8.6
# Test case: Ensure that a trigger definition that includes a CALL to a stored
# procedure fails, at CREATE TRIGGER time, with an appropriate error
# message
# OBN - requirement void since allowed
# Fails due to Bug 9909 the bug allows the trigger to be created
# and fails in execution time
# message. Not more valid requirement.
let $message= Testcase 3.5.8.6: (requirement void);
--source include/show_msg.inc
delimiter //;
CREATE PROCEDURE sp_01 () BEGIN set @v1=1; END//
CREATE TRIGGER trg8_1 BEFORE UPDATE ON tb3 FOR EACH ROW
BEGIN
CALL sp_01 ();
END//
delimiter ;//
Insert into tb3 (f120, f122, f136) values ('6', 'Test 3.5.8.6-insert', 101);
update tb3 set f120='S', f136=111,
f122='Test 3.5.8.6-tr8_1'
where f122='Test 3.5.8.6-insert';
select f120, f122
from tb3 where f122 like 'Test 3.5.8.6%' order by f120;
DROP TRIGGER trg8_1;
DROP PROCEDURE sp_01;
#Section 3.5.8.7
@ -501,25 +521,26 @@ let $message= Testcase 3.5.8.6: (requirement void);
# transaction-delimiting statement (e.g. COMMIT,
# ROLLBACK, START TRANSACTION) fails, at CREATE TRIGGER
# time, with an appropriate error message.
# OBN - Fails due to Bug ____
let $message= Testcase 3.5.8.7: (Disabled as a result of bug _____);
let $message= Testcase 3.5.8.7;
--source include/show_msg.inc
# --error 1314
# Create trigger trg9_1 before update on tb3 for each row
# BEGIN
# Start transaction;
# Set new.f120='U';
# Commit;
# END;
delimiter //;
--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
Create trigger trg9_1 before update on tb3 for each row
BEGIN
Start transaction;
Set new.f120='U';
Commit;
END//
# --error 1314
# Create trigger trg9_2 before delete on tb3 for each row
# BEGIN
# Start transaction;
# Set @var2=old.f120;
# Rollback;
# END;
--error ER_COMMIT_NOT_ALLOWED_IN_SF_OR_TRG
Create trigger trg9_2 before delete on tb3 for each row
BEGIN
Start transaction;
Set @var2=old.f120;
Rollback;
END//
delimiter ;//
# Cleanup section 3.5

View File

@ -85,7 +85,7 @@ let $message= Testcase 3.5.9.3:;
values ('Test 3.5.9.3', 7, 123.17);
Update tb3 Set f136=8 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_163;
select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
@ -104,7 +104,7 @@ let $message= Testcase 3.5.9.3:;
delete from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3';
select f118, f121, f122, f136, f163 from tb3 where f122='Test 3.5.9.3' order by f136;
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_163;
select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
@ -159,7 +159,7 @@ let $message= Testcase 3.5.9.4:;
values ('Test 3.5.9.4', 7, DEFAULT, 995.24);
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4%';
where f122 like 'Test 3.5.9.4%' order by f163;
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_151, @tr_var_b4_163;
select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
@ -180,7 +180,7 @@ let $message= Testcase 3.5.9.4:;
where f122='Test 3.5.9.4';
select f118, f121, f122, f136, f151, f163 from tb3
where f122 like 'Test 3.5.9.4-trig';
where f122 like 'Test 3.5.9.4-trig' order by f163;
select @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122,
@tr_var_b4_136, @tr_var_b4_151, @tr_var_b4_163;
select @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
@ -207,18 +207,18 @@ let $message= Testcase 3.5.9.5: (implied in previous tests);
let $message= Testcase 3.5.9.6:;
--source include/show_msg.inc
--error 1363
--error ER_TRG_NO_SUCH_ROW_IN_TRG
create trigger trg4a before insert on tb3 for each row
set @temp1= old.f120;
--error 1362
--error ER_TRG_CANT_CHANGE_ROW
create trigger trg4b after insert on tb3 for each row
set old.f120= 'test';
#Cleanup
--disable_warnings
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg4a;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg4b;
--enable_warnings
@ -241,20 +241,18 @@ let $message= Testcase 3.5.9.8: (implied in previous tests);
let $message= Testcase 3.5.9.9:;
--source include/show_msg.inc
--error 1363
--error ER_TRG_NO_SUCH_ROW_IN_TRG
create trigger trg5a before DELETE on tb3 for each row
set @temp1=new.f122;
--error 1363
--error ER_TRG_NO_SUCH_ROW_IN_TRG
create trigger trg5b after DELETE on tb3 for each row
set new.f122='test';
let $message= The above returns the wrong error, should be error 1362 (Bug 11648)
--source include/show_msg.inc
#Cleanup
--disable_warnings
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg5a;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg5b;
--enable_warnings
@ -288,23 +286,23 @@ let $message= Testcase 3.5.9.12: covered by 3.5.9.6;
let $message= Testcase 3.5.9.13:;
--source include/show_msg.inc
--error 1362
--error ER_TRG_CANT_CHANGE_ROW
create trigger trg6a before UPDATE on tb3 for each row
set old.f118='C', new.f118='U';
--error 1362
--error ER_TRG_CANT_CHANGE_ROW
create trigger trg6b after INSERT on tb3 for each row
set old.f136=163, new.f118='U';
--error 1362
--error ER_TRG_CANT_CHANGE_ROW
create trigger trg6c after UPDATE on tb3 for each row
set old.f136=NULL;
#Cleanup
--disable_warnings
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg6a;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg6b;
--error 0, 1360
--error 0, ER_TRG_DOES_NOT_EXIST
drop trigger trg6c;
--enable_warnings

View File

@ -48,7 +48,7 @@ let $message= Testcase 3.5.10.1/2/3:;
Insert into vw11 (f122, f151) values ('Test 3.5.10.1/2/3', 2);
Insert into vw11 (f122, f151) values ('Not in View', 3);
select f121, f122, f151, f163
from tb3 where f122 like 'Test 3.5.10.1/2/3%';
from tb3 where f122 like 'Test 3.5.10.1/2/3%' order by f151;
select f121, f122, f151, f163 from vw11;
select f121, f122, f151, f163
from tb3 where f122 like 'Not in View';
@ -56,7 +56,7 @@ let $message= Testcase 3.5.10.1/2/3:;
#Section 3.5.10.2
Update vw11 set f163=1;
select f121, f122, f151, f163 from tb3
where f122 like 'Test 3.5.10.1/2/3%';
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
select f121, f122, f151, f163 from vw11;
#Section 3.5.10.3
@ -64,7 +64,7 @@ let $message= Testcase 3.5.10.1/2/3:;
Select @test_var as 'before delete';
delete from vw11 where f151=1;
select f121, f122, f151, f163 from tb3
where f122 like 'Test 3.5.10.1/2/3%';
where f122 like 'Test 3.5.10.1/2/3%' order by f151;
select f121, f122, f151, f163 from vw11;
Select @test_var as 'after delete';
@ -94,11 +94,11 @@ let $message= Testcase 3.5.10.4:;
set @counter= 0;
select @counter as 'Rows Loaded Before';
--replace_result $MYSQL_TEST_DIR MYSQL_TEST_DIR
eval load data infile '$MYSQL_TEST_DIR/suite/funcs_1/data/t9.txt' into table tb_load;
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval load data infile '$MYSQLTEST_VARDIR/std_data_ln/funcs_1/t9.txt' into table tb_load;
select @counter as 'Rows Loaded After';
Select * from tb_load limit 10;
Select * from tb_load order by f1 limit 10;
#Cleanup
--disable_warnings
@ -157,7 +157,7 @@ let $message= Testcase 3.5.10.extra:;
set @counter=0;
select @counter;
--error 1329
--error ER_SP_FETCH_NO_DATA
call trig_sp();
select @counter;
select count(*) from tb3;
@ -233,7 +233,7 @@ let $message= Testcase y.y.y.2: Check for triggers starting triggers;
#lock tables t1 write, t2_1 write, t2_2 write, t2_3 write, t2_4 write, t3 write;
insert into t1 values (1);
#unlock tables;
select * from t3;
select * from t3 order by f1;
#Cleanup
--disable_warnings
@ -271,13 +271,13 @@ let $message= Testcase y.y.y.3: Circular trigger reference;
create trigger tr4 after insert on t4
for each row insert into t1 (f1) values (new.f4+1);
# OBN See bug 11896
--error 1442
# Bug#11896 Partial locking in case of recursive trigger definittions
--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
insert into t1 values (1);
select * from t1;
select * from t2;
select * from t3;
select * from t4;
select * from t1 order by f1;
select * from t2 order by f2;
select * from t3 order by f3;
select * from t4 order by f4;
#Cleanup
--disable_warnings
@ -294,7 +294,7 @@ let $message= Testcase y.y.y.3: Circular trigger reference;
#Section y.y.y.4
# Testcase: create recursive trigger/storedprocedures conditions
let $message= Testcase y.y.y.4: Recursive trigger/SP references (disabled bug 11889);
let $message= Testcase y.y.y.4: Recursive trigger/SP references;
--source include/show_msg.inc
set @sql_mode='traditional';
@ -327,7 +327,7 @@ set @sql_mode='traditional';
set @counter=0;
select @counter;
--error 1456
--error ER_SP_RECURSION_LIMIT
call trig_sp();
select @counter;
select count(*) from tb3;
@ -337,7 +337,7 @@ set @sql_mode='traditional';
set @@max_sp_recursion_depth= 10;
set @counter=0;
select @counter;
--error 1442
--error ER_CANT_UPDATE_USED_TABLE_IN_SF_OR_TRG
call trig_sp();
select @counter;
select count(*) from tb3;
@ -381,12 +381,12 @@ let $message= Testcase y.y.y.5: Roleback of nested trigger references;
set autocommit=0;
start transaction;
--error 1264
--error ER_WARN_DATA_OUT_OF_RANGE
insert into t1 values (1);
commit;
select * from t1;
select * from t2;
select * from t3;
select * from t1 order by f1;
select * from t2 order by f2;
select * from t3 order by f3;
#unlock tables;
#Cleanup
--disable_warnings

File diff suppressed because it is too large Load Diff

View File

@ -3,11 +3,8 @@
# Functions within VIEWs #
# #
###################################################
# 14.09.2005 ML
# Created 2005-09-14 mleich
let $message= ! Attention: The file with the expected results suffers from
Bug#10713: mysqldump includes database in create view and referenced tables;
--source include/show_msg80.inc
#
# 0. Some notes about this test:
# #################################################################
@ -42,14 +39,7 @@ Bug#10713: mysqldump includes database in create view and referenced tables;
# which was valid during VIEW creation time. This means some variations
# of the SQL mode are needed.
# 0.1.3 There are much more functions to be tested.
# 0.1.4 There are problems with the option "--ps-protocol".
# Double values with 15 digit mantissa are printed with 14 digit
# mantissa (Bug#11589).
# I altered the Minimum/Maximum double values to 14 digit mantissa
# to avoid these problems. But there are some other unsolved problems
# with "--ps-protocol".
--disable_ps_protocol
# 0.1.5 The result sets of some CAST sub testcases with ugly function parameter
# 0.1.4 The result sets of some CAST sub testcases with ugly function parameter
# column data type combinations must be discussed.
#
#
@ -68,7 +58,7 @@ Bug#10713: mysqldump includes database in create view and referenced tables;
# But there will be a special messages within the protocol files.
# Example:
# "Attention: CAST --> SIGNED INTEGER
# The file with expected results suffers from Bug 5083 5913 9809";
# The file with expected results suffers from Bug 5913";
# means, the file with expected results contains result sets which
# are known to be wrong.
# "Attention: The last <whatever> failed"
@ -187,6 +177,7 @@ CREATE TABLE t1_modes
--enable_query_log
# The table to be used in the FROM parts of the SELECTs
--replace_result $type <engine_to_be_tested>
eval CREATE TABLE t1_values
(
id BIGINT AUTO_INCREMENT,
@ -255,10 +246,8 @@ INSERT INTO t1_values SET
my_bigint = -9223372036854775808,
my_decimal = -9999999999999999999999999999999999.999999999999999999999999999999 ,
my_double = -1.7976931348623E+308;
# Note(ML): Values like
# - my_timestamp = '19700101030000' do not work
# - my_double = -1.7976931348623157E+308 cause problems with
# --ps-protocol (Bug#11589)
# shortened due to bug#32285
# my_double = -1.7976931348623157E+308;
#
# 2.3 record -- everything to "maximum"
# numbers, date/time types -> maximum of range
@ -279,10 +268,8 @@ INSERT INTO t1_values SET
my_bigint = 9223372036854775807,
my_decimal = +9999999999999999999999999999999999.999999999999999999999999999999 ,
my_double = 1.7976931348623E+308;
# Note(ML): Values like
# - my_timestamp = '20380101030000' do not work
# - my_double = 1.7976931348623157E+308 cause problems with
# --ps-protocol (Bug#11589)
# shortened due to bug#32285
# my_double = -1.7976931348623157E+308;
#
# 2.4 record -- everything to "magic" value if available or
# other interesting value
@ -417,7 +404,7 @@ eval INSERT INTO t1_values SET select_id = @select_id,
# SELECT * FROM t1_values;
# 1. Cast Functions and Operators
# 1.1. CAST
# 1.1 CAST
#
# Note(ML): I guess the CAST routines are used in many other functions.
# Therefore check also nearly all "ugly" variants like
@ -428,6 +415,7 @@ eval INSERT INTO t1_values SET select_id = @select_id,
#
#
# 1.1.1. CAST --> BINARY
--echo ##### 1.1.1. CAST --> BINARY
let $target_type= BINARY;
#
let $col_type= my_char_30;
@ -457,6 +445,7 @@ let $col_type= my_year;
# 1.1.2. CAST --> CHAR
--echo ##### 1.1.2. CAST --> CHAR
let $target_type= CHAR;
#
let $col_type= my_char_30;
@ -486,6 +475,7 @@ let $col_type= my_year;
# 1.1.3. CAST --> DATE
--echo ##### 1.1.3. CAST --> DATE
let $target_type= DATE;
#
let $col_type= my_char_30;
@ -525,6 +515,7 @@ let $col_type= my_year;
# 1.1.4. CAST --> DATETIME
--echo ##### 1.1.4. CAST --> DATETIME
let $target_type= DATETIME;
#
let $col_type= my_char_30;
@ -564,6 +555,7 @@ let $col_type= my_year;
# 1.1.5. CAST --> TIME
--echo ##### 1.1.5. CAST --> TIME
let $target_type= TIME;
#
let $col_type= my_char_30;
@ -587,15 +579,10 @@ let $col_type= my_bigint;
eval INSERT INTO t1_values SET select_id = @select_id,
$col_type = 1758;
let $col_type= my_double;
let $message= some statements disabled because of
Bug#12440: CAST(data type DOUBLE AS TIME) strange results;
--source include/show_msg80.inc
if (0)
{
# Bug#12440: CAST(data type DOUBLE AS TIME) strange results;
--source suite/funcs_1/views/fv_cast.inc
eval INSERT INTO t1_values SET select_id = @select_id,
$col_type = +1.758E+3;
}
let $col_type= my_datetime;
--source suite/funcs_1/views/fv_cast.inc
let $col_type= my_date;
@ -609,6 +596,7 @@ let $col_type= my_year;
# 1.1.6. CAST --> DECIMAL
--echo ##### 1.1.6. CAST --> DECIMAL
# Set the following to (37,2) since the default was changed to (10,0) - OBN
let $target_type= DECIMAL(37,2);
#
@ -632,16 +620,11 @@ let $col_type= my_bigint;
--source suite/funcs_1/views/fv_cast.inc
let $col_type= my_decimal;
--source suite/funcs_1/views/fv_cast.inc
let $message= some statements disabled because of
Bug#13349: CAST(1.0E+300 TO DECIMAL) returns wrong result + diff little/big endian;
--source include/show_msg80.inc
if (0)
{
# Bug#13349: CAST(1.0E+300 TO DECIMAL) returns wrong result + diff little/big endian;
let $col_type= my_double;
--source suite/funcs_1/views/fv_cast.inc
eval INSERT INTO t1_values SET select_id = @select_id,
$col_type = -0.33333333E+4;
}
let $col_type= my_datetime;
--source suite/funcs_1/views/fv_cast.inc
let $col_type= my_date;
@ -655,15 +638,13 @@ let $col_type= my_year;
# 1.1.7. CAST --> SIGNED INTEGER
--echo ##### 1.1.7. CAST --> SIGNED INTEGER
let $target_type= SIGNED INTEGER;
#
let $message=
"Attention: CAST --> SIGNED INTEGER
The file with expected results suffers from
Bug#5083 Big integer values are inserted as negative into
decimal/string columns
Bug#5913 Traditional mode: BIGINT range not correctly delimited
Both have the status: To be fixed later";
Status: To be fixed later";
--source include/show_msg80.inc
let $col_type= my_char_30;
--source suite/funcs_1/views/fv_cast.inc
@ -677,14 +658,9 @@ let $col_type= my_bigint;
--source suite/funcs_1/views/fv_cast.inc
let $col_type= my_decimal;
--source suite/funcs_1/views/fv_cast.inc
let $message= some statements disabled because of
Bug #13344: CAST(1E+300 TO signed int) on little endian CPU, wrong result;
--source include/show_msg80.inc
if (0)
{
# Bug #13344: CAST(1E+300 TO signed int) on little endian CPU, wrong result;
let $col_type= my_double;
--source suite/funcs_1/views/fv_cast.inc
}
let $col_type= my_datetime;
--source suite/funcs_1/views/fv_cast.inc
let $col_type= my_date;
@ -698,11 +674,12 @@ let $col_type= my_year;
# 1.1.8. CAST --> UNSIGNED INTEGER
--echo ##### 1.1.8. CAST --> UNSIGNED INTEGER
let $target_type= UNSIGNED INTEGER;
#
let $message=
"Attention: CAST --> UNSIGNED INTEGER
The file with expected results suffers from Bug 5083 5913 9809";
The file with expected results suffers from Bug 5913";
--source include/show_msg80.inc
let $col_type= my_char_30;
--source suite/funcs_1/views/fv_cast.inc
@ -717,13 +694,11 @@ let $col_type= my_bigint;
let $col_type= my_decimal;
--source suite/funcs_1/views/fv_cast.inc
let $message= some statements disabled because of
Bugs#8663: cant use bgint unsigned as input to cast;
Bug#5913 Traditional mode: BIGINT range not correctly delimited;
--source include/show_msg80.inc
if (0)
{
# Bug#8663 cant use bgint unsigned as input to cast
let $col_type= my_double;
--source suite/funcs_1/views/fv_cast.inc
}
let $col_type= my_datetime;
--source suite/funcs_1/views/fv_cast.inc
let $col_type= my_date;
@ -848,11 +823,6 @@ let $col_type= my_year;
# select if(isnull(`test`.`t1`.`f1`),_latin1'IS NULL',
# _latin1'IS NOT NULL'),...
#
let $message=
"Attention: IF($col_type IS NULL, ...
The file with expected results suffers from
Bug#11689. successful CREATE VIEW but SELECT on view fails.";
--source include/show_msg80.inc
# Bug#11689 success on Create view .. IF(col1 IS NULL,...), col2 ; but SELECT fails
let $col_type= my_char_30;
--source suite/funcs_1/views/fv_if2.inc
@ -1028,38 +998,21 @@ let $col_type= my_varbinary_1000;
eval SET @my_select =
'SELECT LEFT($col_type, 2), $col_type, id FROM t1_values';
--source suite/funcs_1/views/fv1.inc
#
let $message=
"Attention: LEFT(''AaBbCcDdEeFfGgHhIiJjÄäÜüÖö'', <numeric column>)
The file with expected results suffers from Bug 10963 11728"
and the testcases with length = BIGINT or DOUBLE column are deactivated,
because there are 32/64 Bit differences;
--source include/show_msg80.inc
# Bug#11728 string function LEFT, strange undocumented behaviour, strict mode
# Bug#10963 LEFT string function returns wrong result with large length
let $col_type= my_bigint;
if (0)
{
# Bug#10963 LEFT string function returns wrong result with large length
eval SET @my_select =
'SELECT LEFT(''AaBbCcDdEeFfGgHhIiJjÄäÜüÖö'', $col_type), $col_type, id FROM t1_values';
--source suite/funcs_1/views/fv1.inc
}
#
let $col_type= my_decimal;
eval SET @my_select =
'SELECT LEFT(''AaBbCcDdEeFfGgHhIiJjÄäÜüÖö'', $col_type), $col_type, id FROM t1_values';
--source suite/funcs_1/views/fv1.inc
#
if (0)
{
# Bug#10963 LEFT string function returns wrong result with large length
let $col_type= my_double;
eval SET @my_select =
'SELECT LEFT(''AaBbCcDdEeFfGgHhIiJjÄäÜüÖö'', $col_type), $col_type, id FROM t1_values';
--source suite/funcs_1/views/fv1.inc
}
# 3.20. LENGTH(str)
let $col_type= my_char_30;
@ -1085,8 +1038,11 @@ $col_type, id FROM t1_values';
# If the file doesn't exist or cannot be read ... ,
# the function returns NULL.
# SELECT LOADFILE
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval SET @my_select =
'SELECT LOAD_FILE(''../log/current_test''), id FROM t1_values';
'SELECT LOAD_FILE(''$MYSQLTEST_VARDIR/std_data_ln/funcs_1/load_file.txt'')
AS my_col,
id FROM t1_values';
--source suite/funcs_1/views/fv1.inc
@ -1278,6 +1234,7 @@ SET sql_mode = ''; #
let $message= "# The basic preparations end and the main test starts here";
--source include/show_msg80.inc
--disable_ps_protocol
##### The tests start here #####################################################
@ -1306,18 +1263,18 @@ while ($select_id)
if ($view_select_result)
{
# Create the VIEW
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval CREATE VIEW v1 AS $my_select;
--disable_query_log
eval set @got_errno= $mysql_errno ;
let $run0= `SELECT @got_errno = 0`;
let $print_warning= `SELECT @got_errno`;
if ($print_warning)
{
SELECT 'Attention: The last CREATE VIEW failed ' AS ""
UNION
SELECT '' ;
}
--enable_query_log
if (!$run0)
{
--echo
--echo Attention: The last CREATE VIEW failed
--echo
}
}
# FIXME The loop over the modes will start here.
@ -1330,22 +1287,19 @@ while ($select_id)
{
--disable_result_log
}
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
eval $my_select
WHERE select_id = $select_id OR select_id IS NULL;
WHERE select_id = $select_id OR select_id IS NULL order by id;
if ($run_no_result)
{
--enable_result_log
}
--disable_query_log
eval set @got_errno= $mysql_errno ;
let $print_warning= `SELECT @got_errno`;
if ($print_warning)
if ($mysql_errno)
{
SELECT 'Attention: The last SELECT on the base table failed' AS ""
UNION
SELECT '' ;
--echo
--echo Attention: The last SELECT on the base table failed
--echo
}
--enable_query_log
}
# $run0 is 1, if CREATE VIEW was successful.
@ -1353,17 +1307,14 @@ while ($select_id)
if ($run0)
{
# Check the CREATE VIEW statement
--replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR>
SHOW CREATE VIEW v1;
--disable_query_log
eval set @got_errno= $mysql_errno ;
let $print_warning= `SELECT @got_errno`;
if ($print_warning)
if ($mysql_errno)
{
SELECT 'Attention: The last SHOW CREATE VIEW failed' AS ""
UNION
SELECT '' ;
--echo
--echo Attention: The last SHOW CREATE VIEW failed
--echo
}
--enable_query_log
# Maybe a Join is faster
if ($run_no_result)
@ -1372,21 +1323,17 @@ while ($select_id)
}
eval SELECT v1.* FROM v1
WHERE v1.id IN (SELECT id FROM t1_values
WHERE select_id = $select_id OR select_id IS NULL);
WHERE select_id = $select_id OR select_id IS NULL) order by id;
if ($run_no_result)
{
--enable_result_log
}
--disable_query_log
eval set @got_errno= $mysql_errno ;
let $print_warning= `SELECT @got_errno`;
if ($print_warning)
if ($mysql_errno)
{
SELECT 'Attention: The last SELECT from VIEW failed' AS ""
UNION
SELECT '' ;
--echo
--echo Attention: The last SELECT from VIEW failed
--echo
}
--enable_query_log
DROP VIEW v1;
}
@ -1395,11 +1342,12 @@ while ($select_id)
# Produce two empty lines as separator between different SELECTS
# to be tested.
--disable_query_log
SELECT '' AS "";
--enable_query_log
--echo
--echo
dec $select_id ;
}
--enable_ps_protocol
DROP TABLE t1_selects, t1_modes, t1_values;