List:Commits« Previous MessageNext Message »
From:horst Date:December 20 2007 7:06pm
Subject:bk commit into 5.1 tree (hhunger:1.2622)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of hhunger. When hhunger does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2007-12-20 19:06:41+01:00, hhunger@stripped +60 -0
  Inserted results of review to WL#4084.

  BitKeeper/etc/ignore@stripped, 2007-12-20 19:06:38+01:00, hhunger@stripped +2 -0
    Added mysql-test/suite/funcs_1-5.1-2.tar.gz mysql-test/suite/shell to the ignore list

  BitKeeper/etc/ignore@stripped, 2007-12-20 19:06:36+01:00, hhunger@stripped +11 -0
    Added mysql-test/home/mleich/to_horst/datadict_master.inc
mysql-test/home/mleich/to_horst/func_view.inc
mysql-test/home/mleich/to_horst/storedproc_10.inc
mysql-test/home/mleich/to_horst/triggers_03.inc
mysql-test/home/mleich/to_horst/triggers_08.inc
mysql-test/home/mleich/to_horst/triggers_1011ext.inc
mysql-test/home/mleich/to_horst/triggers_master.test
mysql-test/home/mleich/to_horst/views_master.inc mysql-test/suite/funcs_1-5.1.tar.gz
mysql-test/suite/funcs_1.txt mysql-test/suite/my_archive.tar to the ignore list

  mysql-test/suite/funcs_1/r/innodb_storedproc_10.result@stripped, 2007-12-20 19:06:36+01:00,
hhunger@stripped +85 -16
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/r/innodb_trig_08.result@stripped, 2007-12-20 19:06:36+01:00,
hhunger@stripped +3 -3
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/r/innodb_views.result@stripped, 2007-12-20 19:06:36+01:00,
hhunger@stripped +3 -3
    Inserted results of review to WL#4084.

  mysql-test/suite/funcs_1/r/memory_storedproc_10.result@stripped, 2007-12-20 19:06:36+01:00,
hhunger@stripped +85 -16
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/r/memory_trig_08.result@stripped, 2007-12-20 19:06:36+01:00,
hhunger@stripped +3 -3
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/r/memory_views.result@stripped, 2007-12-20 19:06:36+01:00,
hhunger@stripped +3 -3
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/r/myisam_storedproc_10.result@stripped, 2007-12-20 19:06:36+01:00,
hhunger@stripped +85 -16
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/r/myisam_trig_08.result@stripped, 2007-12-20 19:06:36+01:00,
hhunger@stripped +3 -3
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/r/myisam_views.result@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +7743 -7745
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/r/ndb_storedproc_10.result@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +85 -16
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/r/ndb_trig_08.result@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +3 -3
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/r/ndb_views.result@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +3 -3
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/storedproc/storedproc_10.inc@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +58 -14
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/storedproc/storedproc_master.inc@stripped, 2007-12-20
19:06:37+01:00, hhunger@stripped +10 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/innodb__load.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/innodb_bitdata.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/innodb_cursors.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/innodb_trig_0102.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/innodb_trig_03.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/innodb_trig_03e.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/innodb_trig_0407.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/innodb_trig_08.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/innodb_trig_09.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/innodb_trig_1011ext.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/innodb_trig_frkey.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/memory__load.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/memory_bitdata.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/memory_cursors.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/memory_trig_0102.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/memory_trig_03.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/memory_trig_03e.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/memory_trig_08.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/memory_trig_09.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/memory_trig_1011ext.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/myisam__load.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/myisam_bitdata.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/myisam_cursors.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/myisam_trig_0102.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/myisam_trig_03.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/myisam_trig_03e.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/myisam_trig_08.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/myisam_trig_09.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/myisam_trig_1011ext.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/ndb__load.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/ndb_bitdata.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/ndb_cursors.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/ndb_trig_0102.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/ndb_trig_03.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/ndb_trig_03e.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/ndb_trig_0407.test@stripped, 2007-12-20 19:06:37+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/ndb_trig_08.test@stripped, 2007-12-20 19:06:38+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/ndb_trig_09.test@stripped, 2007-12-20 19:06:38+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/t/ndb_trig_1011ext.test@stripped, 2007-12-20 19:06:38+01:00,
hhunger@stripped +1 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/triggers/triggers_03.inc@stripped, 2007-12-20 19:06:38+01:00,
hhunger@stripped +2 -10
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/triggers/triggers_08.inc@stripped, 2007-12-20 19:06:38+01:00,
hhunger@stripped +5 -3
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc@stripped, 2007-12-20 19:06:38+01:00,
hhunger@stripped +2 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/triggers/triggers_master.test@stripped, 2007-12-20 19:06:38+01:00,
hhunger@stripped +518 -518
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/views/func_view.inc@stripped, 2007-12-20 19:06:38+01:00,
hhunger@stripped +8 -1
    Inserted results of review for WL4084.

  mysql-test/suite/funcs_1/views/views_master.inc@stripped, 2007-12-20 19:06:38+01:00,
hhunger@stripped +9 -5
    Inserted results of review for WL4084.

diff -Nrup a/BitKeeper/etc/ignore b/BitKeeper/etc/ignore
--- a/BitKeeper/etc/ignore	2007-11-27 17:40:14 +01:00
+++ b/BitKeeper/etc/ignore	2007-12-20 19:06:38 +01:00
@@ -3012,3 +3012,16 @@ win/vs8cache.txt
 zlib/*.ds?
 zlib/*.vcproj
 mysql-test/funcs_1.log
+mysql-test/home/mleich/to_horst/datadict_master.inc
+mysql-test/home/mleich/to_horst/func_view.inc
+mysql-test/home/mleich/to_horst/storedproc_10.inc
+mysql-test/home/mleich/to_horst/triggers_03.inc
+mysql-test/home/mleich/to_horst/triggers_08.inc
+mysql-test/home/mleich/to_horst/triggers_1011ext.inc
+mysql-test/home/mleich/to_horst/triggers_master.test
+mysql-test/home/mleich/to_horst/views_master.inc
+mysql-test/suite/funcs_1-5.1.tar.gz
+mysql-test/suite/funcs_1.txt
+mysql-test/suite/my_archive.tar
+mysql-test/suite/funcs_1-5.1-2.tar.gz
+mysql-test/suite/shell
diff -Nrup a/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result
b/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result
--- a/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result	2007-11-27 17:40:06 +01:00
+++ b/mysql-test/suite/funcs_1/r/innodb_storedproc_10.result	2007-12-20 19:06:36 +01:00
@@ -116,7 +116,7 @@ a`	a`	1000-01-01	-5000	a`	-5000
 SELECT fn31105( 9 );
 fn31105( 9 )
 81
-
+connection default;
 USE db_storedproc;
 	
 root@localhost	db_storedproc
@@ -183,24 +183,23 @@ 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()
 BEGIN
 INSERT INTO temp VALUES ('abc', 'abc', '20051003', 100, 'uvw', 1000);
-SELECT row_count() 'ins';
 END//
 CREATE PROCEDURE sp_ins_3()
 BEGIN
 INSERT INTO temp VALUES  ('abc', 'xyz', '19490523',   100, 'uvw', 1000);
 INSERT INTO temp VALUES  ('abc', 'xyz', '1989-11-09', 100, 'uvw', 1000);
 INSERT INTO temp VALUES  ('abc', 'xyz', '2005-10-24', 100, 'uvw', 1000);
-SELECT row_count() 'ins_3';
 END//
 CREATE PROCEDURE sp_upd()
 BEGIN
 UPDATE temp SET temp.f1 = 'updated' WHERE temp.f1 ='abc';
-SELECT row_count() AS 'updated';
 END//
 CREATE PROCEDURE sp_ins_upd()
 BEGIN
@@ -210,15 +209,35 @@ INSERT INTO temp VALUES  ('qwe', 'xyz', 
 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_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();
-ins
+SELECT row_count();
+row_count()
 1
-SELECT * FROM temp ORDER BY f4;
+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
@@ -232,9 +251,10 @@ aeaaaaa	aeaaaaa	1000-01-06	-4995	aeaaaaa
 afaaaaaa	afaaaaaa	1000-01-07	-4994	afaaaaaa	-4994
 agaaaaaaa	agaaaaaaa	1000-01-08	-4993	agaaaaaaa	-4993
 CALL sp_ins_3();
-ins_3
+SELECT row_count();
+row_count()
 1
-SELECT * FROM temp ORDER BY f4;
+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
@@ -251,9 +271,10 @@ aeaaaaa	aeaaaaa	1000-01-06	-4995	aeaaaaa
 afaaaaaa	afaaaaaa	1000-01-07	-4994	afaaaaaa	-4994
 agaaaaaaa	agaaaaaaa	1000-01-08	-4993	agaaaaaaa	-4993
 CALL sp_upd();
-updated
+SELECT row_count();
+row_count()
 4
-SELECT * FROM temp ORDER BY f4;
+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
@@ -270,8 +291,6 @@ updated	xyz	1949-05-23	100	uvw	1000
 updated	xyz	1989-11-09	100	uvw	1000
 updated	xyz	2005-10-24	100	uvw	1000
 CALL sp_ins_upd();
-insert "qwe"
-1
 COUNT( f1 )	f1
 1	aaa
 1	abaa
@@ -285,9 +304,10 @@ COUNT( f1 )	f1
 1	a`
 4	qwe
 4	updated
-update "qwe" AND "abc"
+SELECT row_count();
+row_count()
 3
-SELECT * FROM temp ORDER BY f4;
+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
@@ -307,10 +327,59 @@ updated	xyz	2005-10-24	100	uvw	1000
 updated_2	abc	1989-11-09	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:
diff -Nrup a/mysql-test/suite/funcs_1/r/innodb_trig_08.result
b/mysql-test/suite/funcs_1/r/innodb_trig_08.result
--- a/mysql-test/suite/funcs_1/r/innodb_trig_08.result	2007-11-27 17:40:06 +01:00
+++ b/mysql-test/suite/funcs_1/r/innodb_trig_08.result	2007-12-20 19:06:36 +01:00
@@ -139,10 +139,10 @@ values ('1', 'Test 3.5.8.4', 222, 23456,
 Select f120, f122, f136, f144, f163 from tb3 where f122= '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;
+select * from db_test.t1_i;
 i120	i136	i144	i163
 1	00222	0000023456	1.050000000000000000000000000000
-select * from db_test.t1_u order by u120;
+select * from db_test.t1_u;
 u120	u136	u144	u163
 a	00111	0000099999	999.990000000000000000000000000000
 b	00222	0000023456	1.050000000000000000000000000000
@@ -150,7 +150,7 @@ c	00333	0000099999	999.99000000000000000
 d	00222	0000023456	1.050000000000000000000000000000
 e	00222	0000023456	1.050000000000000000000000000000
 f	00333	0000099999	999.990000000000000000000000000000
-select * from db_test.t1_d order by d120;
+select * from db_test.t1_d;
 d120	d136	d144	d163
 a	00111	0000099999	999.990000000000000000000000000000
 c	00333	0000099999	999.990000000000000000000000000000
diff -Nrup a/mysql-test/suite/funcs_1/r/innodb_views.result
b/mysql-test/suite/funcs_1/r/innodb_views.result
--- a/mysql-test/suite/funcs_1/r/innodb_views.result	2007-11-28 17:56:50 +01:00
+++ b/mysql-test/suite/funcs_1/r/innodb_views.result	2007-12-20 19:06:36 +01:00
@@ -4281,7 +4281,7 @@ Drop view if exists test.v1 ;
 Testcase 3.3.1.22 
 --------------------------------------------------------------------------------
 DROP VIEW  IF EXISTS v1;
-CREATE VIEW test.v1( product ) AS SELECT f59*f60 From tb2 WHERE f59 < 3 LIMIT 2;
+CREATE VIEW test.v1( product ) AS SELECT f59*f60 From tb2 WHERE f59 < 3;
 SELECT * FROM test.v1;
 product
 1
@@ -21586,14 +21586,14 @@ CAST(f2 AS CHAR) AS f2 FROM test1.v27;
 EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
 CAST(f2 AS CHAR) AS f2 FROM test1.v27;
 CREATE OR REPLACE VIEW test3.v0 AS
-SELECT f1 ,
CONVERT('ßÄäÖöÜü§'
USING UCS2) as f2 FROM test1.t1;
+SELECT f1 , CONVERT('ßÄäÖöÜü§' USING UCS2) as f2
FROM test1.t1;
 SHOW CREATE VIEW test1.v27;
 SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
 CAST(f2 AS CHAR) AS f2 FROM test1.v27;
 EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
 CAST(f2 AS CHAR) AS f2 FROM test1.v27;
 CREATE OR REPLACE VIEW test3.v0 AS
-SELECT
CONVERT('ßÄäÖöÜü§'
USING UCS2) as f1, f2 FROM test1.t1;
+SELECT CONVERT('ßÄäÖöÜü§' USING UCS2) as f1, f2
FROM test1.t1;
 SHOW CREATE VIEW test1.v27;
 SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
 CAST(f2 AS CHAR) AS f2 FROM test1.v27;
diff -Nrup a/mysql-test/suite/funcs_1/r/memory_storedproc_10.result
b/mysql-test/suite/funcs_1/r/memory_storedproc_10.result
--- a/mysql-test/suite/funcs_1/r/memory_storedproc_10.result	2007-11-27 17:40:08 +01:00
+++ b/mysql-test/suite/funcs_1/r/memory_storedproc_10.result	2007-12-20 19:06:36 +01:00
@@ -116,7 +116,7 @@ a`	a`	1000-01-01	-5000	a`	-5000
 SELECT fn31105( 9 );
 fn31105( 9 )
 81
-
+connection default;
 USE db_storedproc;
 	
 root@localhost	db_storedproc
@@ -183,24 +183,23 @@ 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()
 BEGIN
 INSERT INTO temp VALUES ('abc', 'abc', '20051003', 100, 'uvw', 1000);
-SELECT row_count() 'ins';
 END//
 CREATE PROCEDURE sp_ins_3()
 BEGIN
 INSERT INTO temp VALUES  ('abc', 'xyz', '19490523',   100, 'uvw', 1000);
 INSERT INTO temp VALUES  ('abc', 'xyz', '1989-11-09', 100, 'uvw', 1000);
 INSERT INTO temp VALUES  ('abc', 'xyz', '2005-10-24', 100, 'uvw', 1000);
-SELECT row_count() 'ins_3';
 END//
 CREATE PROCEDURE sp_upd()
 BEGIN
 UPDATE temp SET temp.f1 = 'updated' WHERE temp.f1 ='abc';
-SELECT row_count() AS 'updated';
 END//
 CREATE PROCEDURE sp_ins_upd()
 BEGIN
@@ -210,15 +209,35 @@ INSERT INTO temp VALUES  ('qwe', 'xyz', 
 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_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();
-ins
+SELECT row_count();
+row_count()
 1
-SELECT * FROM temp ORDER BY f4;
+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
@@ -232,9 +251,10 @@ aeaaaaa	aeaaaaa	1000-01-06	-4995	aeaaaaa
 afaaaaaa	afaaaaaa	1000-01-07	-4994	afaaaaaa	-4994
 agaaaaaaa	agaaaaaaa	1000-01-08	-4993	agaaaaaaa	-4993
 CALL sp_ins_3();
-ins_3
+SELECT row_count();
+row_count()
 1
-SELECT * FROM temp ORDER BY f4;
+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
@@ -251,9 +271,10 @@ aeaaaaa	aeaaaaa	1000-01-06	-4995	aeaaaaa
 afaaaaaa	afaaaaaa	1000-01-07	-4994	afaaaaaa	-4994
 agaaaaaaa	agaaaaaaa	1000-01-08	-4993	agaaaaaaa	-4993
 CALL sp_upd();
-updated
+SELECT row_count();
+row_count()
 4
-SELECT * FROM temp ORDER BY f4;
+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
@@ -270,8 +291,6 @@ updated	xyz	1949-05-23	100	uvw	1000
 updated	xyz	1989-11-09	100	uvw	1000
 updated	xyz	2005-10-24	100	uvw	1000
 CALL sp_ins_upd();
-insert "qwe"
-1
 COUNT( f1 )	f1
 1	aaa
 1	abaa
@@ -285,9 +304,10 @@ COUNT( f1 )	f1
 1	a`
 4	qwe
 4	updated
-update "qwe" AND "abc"
+SELECT row_count();
+row_count()
 3
-SELECT * FROM temp ORDER BY f4;
+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
@@ -307,10 +327,59 @@ updated	xyz	2005-10-24	100	uvw	1000
 updated_2	abc	1989-11-09	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:
diff -Nrup a/mysql-test/suite/funcs_1/r/memory_trig_08.result
b/mysql-test/suite/funcs_1/r/memory_trig_08.result
--- a/mysql-test/suite/funcs_1/r/memory_trig_08.result	2007-11-27 17:40:08 +01:00
+++ b/mysql-test/suite/funcs_1/r/memory_trig_08.result	2007-12-20 19:06:36 +01:00
@@ -135,10 +135,10 @@ values ('1', 'Test 3.5.8.4', 222, 23456,
 Select f120, f122, f136, f144, f163 from tb3 where f122= '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;
+select * from db_test.t1_i;
 i120	i136	i144	i163
 1	00222	0000023456	1.050000000000000000000000000000
-select * from db_test.t1_u order by u120;
+select * from db_test.t1_u;
 u120	u136	u144	u163
 a	00111	0000099999	999.990000000000000000000000000000
 b	00222	0000023456	1.050000000000000000000000000000
@@ -146,7 +146,7 @@ c	00333	0000099999	999.99000000000000000
 d	00222	0000023456	1.050000000000000000000000000000
 e	00222	0000023456	1.050000000000000000000000000000
 f	00333	0000099999	999.990000000000000000000000000000
-select * from db_test.t1_d order by d120;
+select * from db_test.t1_d;
 d120	d136	d144	d163
 a	00111	0000099999	999.990000000000000000000000000000
 c	00333	0000099999	999.990000000000000000000000000000
diff -Nrup a/mysql-test/suite/funcs_1/r/memory_views.result
b/mysql-test/suite/funcs_1/r/memory_views.result
--- a/mysql-test/suite/funcs_1/r/memory_views.result	2007-11-28 17:56:51 +01:00
+++ b/mysql-test/suite/funcs_1/r/memory_views.result	2007-12-20 19:06:36 +01:00
@@ -4285,7 +4285,7 @@ Drop view if exists test.v1 ;
 Testcase 3.3.1.22 
 --------------------------------------------------------------------------------
 DROP VIEW  IF EXISTS v1;
-CREATE VIEW test.v1( product ) AS SELECT f59*f60 From tb2 WHERE f59 < 3 LIMIT 2;
+CREATE VIEW test.v1( product ) AS SELECT f59*f60 From tb2 WHERE f59 < 3;
 SELECT * FROM test.v1;
 product
 1
@@ -21591,14 +21591,14 @@ CAST(f2 AS CHAR) AS f2 FROM test1.v27;
 EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
 CAST(f2 AS CHAR) AS f2 FROM test1.v27;
 CREATE OR REPLACE VIEW test3.v0 AS
-SELECT f1 ,
CONVERT('ßÄäÖöÜü§'
USING UCS2) as f2 FROM test1.t1;
+SELECT f1 , CONVERT('ßÄäÖöÜü§' USING UCS2) as f2
FROM test1.t1;
 SHOW CREATE VIEW test1.v27;
 SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
 CAST(f2 AS CHAR) AS f2 FROM test1.v27;
 EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
 CAST(f2 AS CHAR) AS f2 FROM test1.v27;
 CREATE OR REPLACE VIEW test3.v0 AS
-SELECT
CONVERT('ßÄäÖöÜü§'
USING UCS2) as f1, f2 FROM test1.t1;
+SELECT CONVERT('ßÄäÖöÜü§' USING UCS2) as f1, f2
FROM test1.t1;
 SHOW CREATE VIEW test1.v27;
 SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
 CAST(f2 AS CHAR) AS f2 FROM test1.v27;
diff -Nrup a/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result
b/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result
--- a/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result	2007-11-27 17:40:10 +01:00
+++ b/mysql-test/suite/funcs_1/r/myisam_storedproc_10.result	2007-12-20 19:06:36 +01:00
@@ -116,7 +116,7 @@ a`	a`	1000-01-01	-5000	a`	-5000
 SELECT fn31105( 9 );
 fn31105( 9 )
 81
-
+connection default;
 USE db_storedproc;
 	
 root@localhost	db_storedproc
@@ -183,24 +183,23 @@ 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()
 BEGIN
 INSERT INTO temp VALUES ('abc', 'abc', '20051003', 100, 'uvw', 1000);
-SELECT row_count() 'ins';
 END//
 CREATE PROCEDURE sp_ins_3()
 BEGIN
 INSERT INTO temp VALUES  ('abc', 'xyz', '19490523',   100, 'uvw', 1000);
 INSERT INTO temp VALUES  ('abc', 'xyz', '1989-11-09', 100, 'uvw', 1000);
 INSERT INTO temp VALUES  ('abc', 'xyz', '2005-10-24', 100, 'uvw', 1000);
-SELECT row_count() 'ins_3';
 END//
 CREATE PROCEDURE sp_upd()
 BEGIN
 UPDATE temp SET temp.f1 = 'updated' WHERE temp.f1 ='abc';
-SELECT row_count() AS 'updated';
 END//
 CREATE PROCEDURE sp_ins_upd()
 BEGIN
@@ -210,15 +209,35 @@ INSERT INTO temp VALUES  ('qwe', 'xyz', 
 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_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();
-ins
+SELECT row_count();
+row_count()
 1
-SELECT * FROM temp ORDER BY f4;
+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
@@ -232,9 +251,10 @@ aeaaaaa	aeaaaaa	1000-01-06	-4995	aeaaaaa
 afaaaaaa	afaaaaaa	1000-01-07	-4994	afaaaaaa	-4994
 agaaaaaaa	agaaaaaaa	1000-01-08	-4993	agaaaaaaa	-4993
 CALL sp_ins_3();
-ins_3
+SELECT row_count();
+row_count()
 1
-SELECT * FROM temp ORDER BY f4;
+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
@@ -251,9 +271,10 @@ aeaaaaa	aeaaaaa	1000-01-06	-4995	aeaaaaa
 afaaaaaa	afaaaaaa	1000-01-07	-4994	afaaaaaa	-4994
 agaaaaaaa	agaaaaaaa	1000-01-08	-4993	agaaaaaaa	-4993
 CALL sp_upd();
-updated
+SELECT row_count();
+row_count()
 4
-SELECT * FROM temp ORDER BY f4;
+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
@@ -270,8 +291,6 @@ updated	xyz	1949-05-23	100	uvw	1000
 updated	xyz	1989-11-09	100	uvw	1000
 updated	xyz	2005-10-24	100	uvw	1000
 CALL sp_ins_upd();
-insert "qwe"
-1
 COUNT( f1 )	f1
 1	aaa
 1	abaa
@@ -285,9 +304,10 @@ COUNT( f1 )	f1
 1	a`
 4	qwe
 4	updated
-update "qwe" AND "abc"
+SELECT row_count();
+row_count()
 3
-SELECT * FROM temp ORDER BY f4;
+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
@@ -307,10 +327,59 @@ updated	xyz	2005-10-24	100	uvw	1000
 updated_2	abc	1989-11-09	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:
diff -Nrup a/mysql-test/suite/funcs_1/r/myisam_trig_08.result
b/mysql-test/suite/funcs_1/r/myisam_trig_08.result
--- a/mysql-test/suite/funcs_1/r/myisam_trig_08.result	2007-11-27 17:40:10 +01:00
+++ b/mysql-test/suite/funcs_1/r/myisam_trig_08.result	2007-12-20 19:06:36 +01:00
@@ -139,10 +139,10 @@ values ('1', 'Test 3.5.8.4', 222, 23456,
 Select f120, f122, f136, f144, f163 from tb3 where f122= '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;
+select * from db_test.t1_i;
 i120	i136	i144	i163
 1	00222	0000023456	1.050000000000000000000000000000
-select * from db_test.t1_u order by u120;
+select * from db_test.t1_u;
 u120	u136	u144	u163
 a	00111	0000099999	999.990000000000000000000000000000
 b	00222	0000023456	1.050000000000000000000000000000
@@ -150,7 +150,7 @@ c	00333	0000099999	999.99000000000000000
 d	00222	0000023456	1.050000000000000000000000000000
 e	00222	0000023456	1.050000000000000000000000000000
 f	00333	0000099999	999.990000000000000000000000000000
-select * from db_test.t1_d order by d120;
+select * from db_test.t1_d;
 d120	d136	d144	d163
 a	00111	0000099999	999.990000000000000000000000000000
 c	00333	0000099999	999.990000000000000000000000000000
diff -Nrup a/mysql-test/suite/funcs_1/r/myisam_views.result
b/mysql-test/suite/funcs_1/r/myisam_views.result
--- a/mysql-test/suite/funcs_1/r/myisam_views.result	2007-11-28 17:56:51 +01:00
+++ b/mysql-test/suite/funcs_1/r/myisam_views.result	2007-12-20 19:06:37 +01:00
@@ -4750,7 +4750,7 @@ Drop view if exists test.v1 ;
 Testcase 3.3.1.22 
 --------------------------------------------------------------------------------
 DROP VIEW  IF EXISTS v1;
-CREATE VIEW test.v1( product ) AS SELECT f59*f60 From tb2 WHERE f59 < 3 LIMIT 2;
+CREATE VIEW test.v1( product ) AS SELECT f59*f60 From tb2 WHERE f59 < 3;
 SELECT * FROM test.v1;
 product
 1
@@ -23248,14 +23248,14 @@ CAST(f2 AS CHAR) AS f2 FROM test1.v20;
 EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
 CAST(f2 AS CHAR) AS f2 FROM test1.v20;
 CREATE OR REPLACE VIEW test3.v0 AS
-SELECT f1 ,
CONVERT('ßÄäÖöÜü§'
USING UCS2) as f2 FROM test1.t1;
+SELECT f1 , CONVERT('ßÄäÖöÜü§' USING UCS2) as f2
FROM test1.t1;
 SHOW CREATE VIEW test1.v20;
 SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
 CAST(f2 AS CHAR) AS f2 FROM test1.v20;
 EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
 CAST(f2 AS CHAR) AS f2 FROM test1.v20;
 CREATE OR REPLACE VIEW test3.v0 AS
-SELECT
CONVERT('ßÄäÖöÜü§'
USING UCS2) as f1, f2 FROM test1.t1;
+SELECT CONVERT('ßÄäÖöÜü§' USING UCS2) as f1, f2
FROM test1.t1;
 SHOW CREATE VIEW test1.v20;
 SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
 CAST(f2 AS CHAR) AS f2 FROM test1.v20;
diff -Nrup a/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result
b/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result
--- a/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result	2007-11-27 17:40:12 +01:00
+++ b/mysql-test/suite/funcs_1/r/ndb_storedproc_10.result	2007-12-20 19:06:37 +01:00
@@ -116,7 +116,7 @@ a`	a`	1000-01-01	-5000	a`	-5000
 SELECT fn31105( 9 );
 fn31105( 9 )
 81
-
+connection default;
 USE db_storedproc;
 	
 root@localhost	db_storedproc
@@ -183,24 +183,23 @@ 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()
 BEGIN
 INSERT INTO temp VALUES ('abc', 'abc', '20051003', 100, 'uvw', 1000);
-SELECT row_count() 'ins';
 END//
 CREATE PROCEDURE sp_ins_3()
 BEGIN
 INSERT INTO temp VALUES  ('abc', 'xyz', '19490523',   100, 'uvw', 1000);
 INSERT INTO temp VALUES  ('abc', 'xyz', '1989-11-09', 100, 'uvw', 1000);
 INSERT INTO temp VALUES  ('abc', 'xyz', '2005-10-24', 100, 'uvw', 1000);
-SELECT row_count() 'ins_3';
 END//
 CREATE PROCEDURE sp_upd()
 BEGIN
 UPDATE temp SET temp.f1 = 'updated' WHERE temp.f1 ='abc';
-SELECT row_count() AS 'updated';
 END//
 CREATE PROCEDURE sp_ins_upd()
 BEGIN
@@ -210,15 +209,35 @@ INSERT INTO temp VALUES  ('qwe', 'xyz', 
 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_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();
-ins
+SELECT row_count();
+row_count()
 1
-SELECT * FROM temp ORDER BY f4;
+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
@@ -232,9 +251,10 @@ aeaaaaa	aeaaaaa	1000-01-06	-4995	aeaaaaa
 afaaaaaa	afaaaaaa	1000-01-07	-4994	afaaaaaa	-4994
 agaaaaaaa	agaaaaaaa	1000-01-08	-4993	agaaaaaaa	-4993
 CALL sp_ins_3();
-ins_3
+SELECT row_count();
+row_count()
 1
-SELECT * FROM temp ORDER BY f4;
+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
@@ -251,9 +271,10 @@ aeaaaaa	aeaaaaa	1000-01-06	-4995	aeaaaaa
 afaaaaaa	afaaaaaa	1000-01-07	-4994	afaaaaaa	-4994
 agaaaaaaa	agaaaaaaa	1000-01-08	-4993	agaaaaaaa	-4993
 CALL sp_upd();
-updated
+SELECT row_count();
+row_count()
 4
-SELECT * FROM temp ORDER BY f4;
+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
@@ -270,8 +291,6 @@ updated	xyz	1949-05-23	100	uvw	1000
 updated	xyz	1989-11-09	100	uvw	1000
 updated	xyz	2005-10-24	100	uvw	1000
 CALL sp_ins_upd();
-insert "qwe"
-1
 COUNT( f1 )	f1
 1	aaa
 1	abaa
@@ -285,9 +304,10 @@ COUNT( f1 )	f1
 1	a`
 4	qwe
 4	updated
-update "qwe" AND "abc"
+SELECT row_count();
+row_count()
 3
-SELECT * FROM temp ORDER BY f4;
+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
@@ -307,10 +327,59 @@ updated	xyz	2005-10-24	100	uvw	1000
 updated_2	abc	1989-11-09	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:
diff -Nrup a/mysql-test/suite/funcs_1/r/ndb_trig_08.result
b/mysql-test/suite/funcs_1/r/ndb_trig_08.result
--- a/mysql-test/suite/funcs_1/r/ndb_trig_08.result	2007-11-27 17:40:12 +01:00
+++ b/mysql-test/suite/funcs_1/r/ndb_trig_08.result	2007-12-20 19:06:37 +01:00
@@ -140,10 +140,10 @@ values ('1', 'Test 3.5.8.4', 222, 23456,
 Select f120, f122, f136, f144, f163 from tb3 where f122= '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;
+select * from db_test.t1_i;
 i120	i136	i144	i163
 1	00222	0000023456	1.050000000000000000000000000000
-select * from db_test.t1_u order by u120;
+select * from db_test.t1_u;
 u120	u136	u144	u163
 a	00111	0000099999	999.990000000000000000000000000000
 b	00222	0000023456	1.050000000000000000000000000000
@@ -151,7 +151,7 @@ c	00333	0000099999	999.99000000000000000
 d	00222	0000023456	1.050000000000000000000000000000
 e	00222	0000023456	1.050000000000000000000000000000
 f	00333	0000099999	999.990000000000000000000000000000
-select * from db_test.t1_d order by d120;
+select * from db_test.t1_d;
 d120	d136	d144	d163
 a	00111	0000099999	999.990000000000000000000000000000
 c	00333	0000099999	999.990000000000000000000000000000
diff -Nrup a/mysql-test/suite/funcs_1/r/ndb_views.result
b/mysql-test/suite/funcs_1/r/ndb_views.result
--- a/mysql-test/suite/funcs_1/r/ndb_views.result	2007-11-28 17:56:51 +01:00
+++ b/mysql-test/suite/funcs_1/r/ndb_views.result	2007-12-20 19:06:37 +01:00
@@ -4281,7 +4281,7 @@ Drop view if exists test.v1 ;
 Testcase 3.3.1.22 
 --------------------------------------------------------------------------------
 DROP VIEW  IF EXISTS v1;
-CREATE VIEW test.v1( product ) AS SELECT f59*f60 From tb2 WHERE f59 < 3 LIMIT 2;
+CREATE VIEW test.v1( product ) AS SELECT f59*f60 From tb2 WHERE f59 < 3;
 SELECT * FROM test.v1;
 product
 1
@@ -21585,14 +21585,14 @@ CAST(f2 AS CHAR) AS f2 FROM test1.v27;
 EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
 CAST(f2 AS CHAR) AS f2 FROM test1.v27;
 CREATE OR REPLACE VIEW test3.v0 AS
-SELECT f1 ,
CONVERT('ßÄäÖöÜü§'
USING UCS2) as f2 FROM test1.t1;
+SELECT f1 , CONVERT('ßÄäÖöÜü§' USING UCS2) as f2
FROM test1.t1;
 SHOW CREATE VIEW test1.v27;
 SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
 CAST(f2 AS CHAR) AS f2 FROM test1.v27;
 EXPLAIN SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
 CAST(f2 AS CHAR) AS f2 FROM test1.v27;
 CREATE OR REPLACE VIEW test3.v0 AS
-SELECT
CONVERT('ßÄäÖöÜü§'
USING UCS2) as f1, f2 FROM test1.t1;
+SELECT CONVERT('ßÄäÖöÜü§' USING UCS2) as f1, f2
FROM test1.t1;
 SHOW CREATE VIEW test1.v27;
 SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
 CAST(f2 AS CHAR) AS f2 FROM test1.v27;
diff -Nrup a/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc
b/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc
--- a/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc	2007-11-27 17:40:12 +01:00
+++ b/mysql-test/suite/funcs_1/storedproc/storedproc_10.inc	2007-12-20 19:06:37 +01:00
@@ -74,7 +74,7 @@ connect (user2_2, localhost, user_2, , d
 --source suite/funcs_1/include/show_connection.inc
 
 # no privileges exist
---error 1370
+--error ER_PROCACCESS_DENIED_ERROR
 CALL sp31102();
 SELECT fn31105( 9 );
 
@@ -99,7 +99,7 @@ SELECT fn31105( 9 );
 disconnect user2_3;
 
 # now 'remove' SELECT from INVOKER
---echo 
+--echo connection default;
 connection default;
 USE db_storedproc;
 --source suite/funcs_1/include/show_connection.inc
@@ -147,7 +147,7 @@ BEGIN
 END//
 delimiter ;//
 
---error 1305
+--error ER_SP_DOES_NOT_EXIST
 CALL fn1();
 
 # cleanup
@@ -173,7 +173,7 @@ BEGIN
 END//
 delimiter ;//
 
---error 1305
+--error ER_SP_DOES_NOT_EXIST
   SELECT sp1();
 
 # cleanup
@@ -187,12 +187,21 @@ 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);
@@ -202,22 +211,18 @@ delimiter //;
 CREATE PROCEDURE sp_ins_1()
 BEGIN
   INSERT INTO temp VALUES ('abc', 'abc', '20051003', 100, 'uvw', 1000);
-  SELECT row_count() 'ins';
 END//
 
-
 CREATE PROCEDURE sp_ins_3()
 BEGIN
   INSERT INTO temp VALUES  ('abc', 'xyz', '19490523',   100, 'uvw', 1000);
   INSERT INTO temp VALUES  ('abc', 'xyz', '1989-11-09', 100, 'uvw', 1000);
   INSERT INTO temp VALUES  ('abc', 'xyz', '2005-10-24', 100, 'uvw', 1000);
-  SELECT row_count() 'ins_3';
 END//
 
 CREATE PROCEDURE sp_upd()
 BEGIN
   UPDATE temp SET temp.f1 = 'updated' WHERE temp.f1 ='abc';
-  SELECT row_count() AS 'updated';
 END//
 
 CREATE PROCEDURE sp_ins_upd()
@@ -228,34 +233,73 @@ BEGIN
       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_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 ORDER BY f4;
+SELECT * FROM temp;
 
 CALL sp_ins_3();
+SELECT row_count();
 --sorted_result
-SELECT * FROM temp ORDER BY f4;
+SELECT * FROM temp;
 
 CALL sp_upd();
+SELECT row_count();
 --sorted_result
-SELECT * FROM temp ORDER BY f4;
+SELECT * FROM temp;
 
 CALL sp_ins_upd();
+SELECT row_count();
+--sorted_result
+SELECT * FROM temp;
+
+CALL sp_del();
+SELECT row_count();
 --sorted_result
-SELECT * FROM temp ORDER BY f4;
+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;
 
 
diff -Nrup a/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc
b/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc
--- a/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc	2007-11-29 11:02:47 +01:00
+++ b/mysql-test/suite/funcs_1/storedproc/storedproc_master.inc	2007-12-20 19:06:37 +01:00
@@ -365,6 +365,11 @@ CREATE FUNCTION fn1( f1 enum("value1", "
 END//
 delimiter ;//
 
+# warnings for this select disabled due to diffs with/without --ps-protocol:
+# without ps-protocol the following warning is shown:
+# +Note   1291    Column '' has duplicated value 'value1' in SET
+# +Warning        1265    Data truncated for column 'f1' at row 1
+# Reported as BUG#33396
 --disable_warnings
 SELECT fn1( "value1" );
 --enable_warnings
@@ -383,6 +388,11 @@ CREATE FUNCTION fn1( f1 set("value1", "v
 END//
 delimiter ;//
 
+# warnings for this select disabled due to diffs with/without --ps-protocol:
+# without ps-protocol the following warning is shown:
+# +Note   1291    Column '' has duplicated value 'value1' in SET
+# +Warning        1265    Data truncated for column 'f1' at row 1
+# Reported as BUG#33396
 --disable_warnings
 SELECT fn1( "value1, value1" );
 --enable_warnings
@@ -851,7 +861,6 @@ DROP PROCEDURE sp1;
 CREATE PROCEDURE !_sp1( f1 char(20) )
 SELECT * from t1 where f2 = f1;
 
---error 0,1064
 CREATE PROCEDURE function()
    SELECT * from t1 where f2=f1;
 DROP PROCEDURE function;
diff -Nrup a/mysql-test/suite/funcs_1/t/innodb__load.test
b/mysql-test/suite/funcs_1/t/innodb__load.test
--- a/mysql-test/suite/funcs_1/t/innodb__load.test	2007-11-27 17:40:12 +01:00
+++ b/mysql-test/suite/funcs_1/t/innodb__load.test	2007-12-20 19:06:37 +01:00
@@ -19,7 +19,7 @@ let $engine_type= innodb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/innodb_bitdata.test
b/mysql-test/suite/funcs_1/t/innodb_bitdata.test
--- a/mysql-test/suite/funcs_1/t/innodb_bitdata.test	2007-11-27 17:40:12 +01:00
+++ b/mysql-test/suite/funcs_1/t/innodb_bitdata.test	2007-12-20 19:06:37 +01:00
@@ -19,7 +19,7 @@ let $engine_type= innodb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/innodb_cursors.test
b/mysql-test/suite/funcs_1/t/innodb_cursors.test
--- a/mysql-test/suite/funcs_1/t/innodb_cursors.test	2007-11-27 17:40:12 +01:00
+++ b/mysql-test/suite/funcs_1/t/innodb_cursors.test	2007-12-20 19:06:37 +01:00
@@ -19,7 +19,7 @@ let $engine_type= innodb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/innodb_trig_0102.test
b/mysql-test/suite/funcs_1/t/innodb_trig_0102.test
--- a/mysql-test/suite/funcs_1/t/innodb_trig_0102.test	2007-11-27 17:40:12 +01:00
+++ b/mysql-test/suite/funcs_1/t/innodb_trig_0102.test	2007-12-20 19:06:37 +01:00
@@ -19,7 +19,7 @@ let $engine_type= innodb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/innodb_trig_03.test
b/mysql-test/suite/funcs_1/t/innodb_trig_03.test
--- a/mysql-test/suite/funcs_1/t/innodb_trig_03.test	2007-11-27 17:40:12 +01:00
+++ b/mysql-test/suite/funcs_1/t/innodb_trig_03.test	2007-12-20 19:06:37 +01:00
@@ -19,7 +19,7 @@ let $engine_type= innodb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/innodb_trig_03e.test
b/mysql-test/suite/funcs_1/t/innodb_trig_03e.test
--- a/mysql-test/suite/funcs_1/t/innodb_trig_03e.test	2007-11-27 17:40:12 +01:00
+++ b/mysql-test/suite/funcs_1/t/innodb_trig_03e.test	2007-12-20 19:06:37 +01:00
@@ -19,7 +19,7 @@ let $engine_type= innodb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/innodb_trig_0407.test
b/mysql-test/suite/funcs_1/t/innodb_trig_0407.test
--- a/mysql-test/suite/funcs_1/t/innodb_trig_0407.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/innodb_trig_0407.test	2007-12-20 19:06:37 +01:00
@@ -19,7 +19,7 @@ let $engine_type= innodb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/innodb_trig_08.test
b/mysql-test/suite/funcs_1/t/innodb_trig_08.test
--- a/mysql-test/suite/funcs_1/t/innodb_trig_08.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/innodb_trig_08.test	2007-12-20 19:06:37 +01:00
@@ -19,7 +19,7 @@ let $engine_type= innodb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/innodb_trig_09.test
b/mysql-test/suite/funcs_1/t/innodb_trig_09.test
--- a/mysql-test/suite/funcs_1/t/innodb_trig_09.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/innodb_trig_09.test	2007-12-20 19:06:37 +01:00
@@ -19,7 +19,7 @@ let $engine_type= innodb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/innodb_trig_1011ext.test
b/mysql-test/suite/funcs_1/t/innodb_trig_1011ext.test
--- a/mysql-test/suite/funcs_1/t/innodb_trig_1011ext.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/innodb_trig_1011ext.test	2007-12-20 19:06:37 +01:00
@@ -19,7 +19,7 @@ let $engine_type= innodb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/innodb_trig_frkey.test
b/mysql-test/suite/funcs_1/t/innodb_trig_frkey.test
--- a/mysql-test/suite/funcs_1/t/innodb_trig_frkey.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/innodb_trig_frkey.test	2007-12-20 19:06:37 +01:00
@@ -19,7 +19,7 @@ let $engine_type= innodb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/memory__load.test
b/mysql-test/suite/funcs_1/t/memory__load.test
--- a/mysql-test/suite/funcs_1/t/memory__load.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/memory__load.test	2007-12-20 19:06:37 +01:00
@@ -17,7 +17,7 @@ let $engine_type= memory;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/memory_bitdata.test
b/mysql-test/suite/funcs_1/t/memory_bitdata.test
--- a/mysql-test/suite/funcs_1/t/memory_bitdata.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/memory_bitdata.test	2007-12-20 19:06:37 +01:00
@@ -17,7 +17,7 @@ let $engine_type= memory;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/memory_cursors.test
b/mysql-test/suite/funcs_1/t/memory_cursors.test
--- a/mysql-test/suite/funcs_1/t/memory_cursors.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/memory_cursors.test	2007-12-20 19:06:37 +01:00
@@ -17,7 +17,7 @@ let $engine_type= memory;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF($run)
+if($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/memory_trig_0102.test
b/mysql-test/suite/funcs_1/t/memory_trig_0102.test
--- a/mysql-test/suite/funcs_1/t/memory_trig_0102.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/memory_trig_0102.test	2007-12-20 19:06:37 +01:00
@@ -17,7 +17,7 @@ let $engine_type= memory;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF($run)
+if($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/memory_trig_03.test
b/mysql-test/suite/funcs_1/t/memory_trig_03.test
--- a/mysql-test/suite/funcs_1/t/memory_trig_03.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/memory_trig_03.test	2007-12-20 19:06:37 +01:00
@@ -17,7 +17,7 @@ let $engine_type= memory;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF($run)
+if($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/memory_trig_03e.test
b/mysql-test/suite/funcs_1/t/memory_trig_03e.test
--- a/mysql-test/suite/funcs_1/t/memory_trig_03e.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/memory_trig_03e.test	2007-12-20 19:06:37 +01:00
@@ -17,7 +17,7 @@ let $engine_type= memory;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/memory_trig_08.test
b/mysql-test/suite/funcs_1/t/memory_trig_08.test
--- a/mysql-test/suite/funcs_1/t/memory_trig_08.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/memory_trig_08.test	2007-12-20 19:06:37 +01:00
@@ -17,7 +17,7 @@ let $engine_type= memory;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/memory_trig_09.test
b/mysql-test/suite/funcs_1/t/memory_trig_09.test
--- a/mysql-test/suite/funcs_1/t/memory_trig_09.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/memory_trig_09.test	2007-12-20 19:06:37 +01:00
@@ -17,7 +17,7 @@ let $engine_type= memory;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/memory_trig_1011ext.test
b/mysql-test/suite/funcs_1/t/memory_trig_1011ext.test
--- a/mysql-test/suite/funcs_1/t/memory_trig_1011ext.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/memory_trig_1011ext.test	2007-12-20 19:06:37 +01:00
@@ -17,7 +17,7 @@ let $engine_type= memory;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/myisam__load.test
b/mysql-test/suite/funcs_1/t/myisam__load.test
--- a/mysql-test/suite/funcs_1/t/myisam__load.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/myisam__load.test	2007-12-20 19:06:37 +01:00
@@ -17,7 +17,7 @@ let $engine_type= myisam;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/myisam_bitdata.test
b/mysql-test/suite/funcs_1/t/myisam_bitdata.test
--- a/mysql-test/suite/funcs_1/t/myisam_bitdata.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/myisam_bitdata.test	2007-12-20 19:06:37 +01:00
@@ -17,7 +17,7 @@ let $engine_type= myisam;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/myisam_cursors.test
b/mysql-test/suite/funcs_1/t/myisam_cursors.test
--- a/mysql-test/suite/funcs_1/t/myisam_cursors.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/myisam_cursors.test	2007-12-20 19:06:37 +01:00
@@ -17,7 +17,7 @@ let $engine_type= myisam;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
 
     # Create some objects needed in many testcases
diff -Nrup a/mysql-test/suite/funcs_1/t/myisam_trig_0102.test
b/mysql-test/suite/funcs_1/t/myisam_trig_0102.test
--- a/mysql-test/suite/funcs_1/t/myisam_trig_0102.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/myisam_trig_0102.test	2007-12-20 19:06:37 +01:00
@@ -17,7 +17,7 @@ let $engine_type= myisam;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/myisam_trig_03.test
b/mysql-test/suite/funcs_1/t/myisam_trig_03.test
--- a/mysql-test/suite/funcs_1/t/myisam_trig_03.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/myisam_trig_03.test	2007-12-20 19:06:37 +01:00
@@ -17,7 +17,7 @@ let $engine_type= myisam;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/myisam_trig_03e.test
b/mysql-test/suite/funcs_1/t/myisam_trig_03e.test
--- a/mysql-test/suite/funcs_1/t/myisam_trig_03e.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/myisam_trig_03e.test	2007-12-20 19:06:37 +01:00
@@ -17,7 +17,7 @@ let $engine_type= myisam;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/myisam_trig_08.test
b/mysql-test/suite/funcs_1/t/myisam_trig_08.test
--- a/mysql-test/suite/funcs_1/t/myisam_trig_08.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/myisam_trig_08.test	2007-12-20 19:06:37 +01:00
@@ -17,7 +17,7 @@ let $engine_type= myisam;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF($run)
+if($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/myisam_trig_09.test
b/mysql-test/suite/funcs_1/t/myisam_trig_09.test
--- a/mysql-test/suite/funcs_1/t/myisam_trig_09.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/myisam_trig_09.test	2007-12-20 19:06:37 +01:00
@@ -17,7 +17,7 @@ let $engine_type= myisam;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/myisam_trig_1011ext.test
b/mysql-test/suite/funcs_1/t/myisam_trig_1011ext.test
--- a/mysql-test/suite/funcs_1/t/myisam_trig_1011ext.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/myisam_trig_1011ext.test	2007-12-20 19:06:37 +01:00
@@ -17,7 +17,7 @@ let $engine_type= myisam;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/ndb__load.test
b/mysql-test/suite/funcs_1/t/ndb__load.test
--- a/mysql-test/suite/funcs_1/t/ndb__load.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/ndb__load.test	2007-12-20 19:06:37 +01:00
@@ -19,7 +19,7 @@ let $engine_type= ndb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/ndb_bitdata.test
b/mysql-test/suite/funcs_1/t/ndb_bitdata.test
--- a/mysql-test/suite/funcs_1/t/ndb_bitdata.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/ndb_bitdata.test	2007-12-20 19:06:37 +01:00
@@ -19,7 +19,7 @@ let $engine_type= ndb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/ndb_cursors.test
b/mysql-test/suite/funcs_1/t/ndb_cursors.test
--- a/mysql-test/suite/funcs_1/t/ndb_cursors.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/ndb_cursors.test	2007-12-20 19:06:37 +01:00
@@ -19,7 +19,7 @@ let $engine_type= ndb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/ndb_trig_0102.test
b/mysql-test/suite/funcs_1/t/ndb_trig_0102.test
--- a/mysql-test/suite/funcs_1/t/ndb_trig_0102.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/ndb_trig_0102.test	2007-12-20 19:06:37 +01:00
@@ -19,7 +19,7 @@ let $engine_type= ndb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/ndb_trig_03.test
b/mysql-test/suite/funcs_1/t/ndb_trig_03.test
--- a/mysql-test/suite/funcs_1/t/ndb_trig_03.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/ndb_trig_03.test	2007-12-20 19:06:37 +01:00
@@ -19,7 +19,7 @@ let $engine_type= ndb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/ndb_trig_03e.test
b/mysql-test/suite/funcs_1/t/ndb_trig_03e.test
--- a/mysql-test/suite/funcs_1/t/ndb_trig_03e.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/ndb_trig_03e.test	2007-12-20 19:06:37 +01:00
@@ -19,7 +19,7 @@ let $engine_type= ndb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/ndb_trig_0407.test
b/mysql-test/suite/funcs_1/t/ndb_trig_0407.test
--- a/mysql-test/suite/funcs_1/t/ndb_trig_0407.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/ndb_trig_0407.test	2007-12-20 19:06:37 +01:00
@@ -19,7 +19,7 @@ let $engine_type= ndb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/ndb_trig_08.test
b/mysql-test/suite/funcs_1/t/ndb_trig_08.test
--- a/mysql-test/suite/funcs_1/t/ndb_trig_08.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/ndb_trig_08.test	2007-12-20 19:06:38 +01:00
@@ -19,7 +19,7 @@ let $engine_type= ndb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/ndb_trig_09.test
b/mysql-test/suite/funcs_1/t/ndb_trig_09.test
--- a/mysql-test/suite/funcs_1/t/ndb_trig_09.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/ndb_trig_09.test	2007-12-20 19:06:38 +01:00
@@ -19,7 +19,7 @@ let $engine_type= ndb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/t/ndb_trig_1011ext.test
b/mysql-test/suite/funcs_1/t/ndb_trig_1011ext.test
--- a/mysql-test/suite/funcs_1/t/ndb_trig_1011ext.test	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/t/ndb_trig_1011ext.test	2007-12-20 19:06:38 +01:00
@@ -19,7 +19,7 @@ let $engine_type= ndb;
 eval SET @NO_REFRESH = IF( '$NO_REFRESH' = '', 0, 1);
 
 let $run= `SELECT @NO_REFRESH = 0`;
-IF ($run)
+if ($run)
 {
     # Create some objects needed in many testcases
     USE test;
diff -Nrup a/mysql-test/suite/funcs_1/triggers/triggers_03.inc
b/mysql-test/suite/funcs_1/triggers/triggers_03.inc
--- a/mysql-test/suite/funcs_1/triggers/triggers_03.inc	2007-11-28 17:56:51 +01:00
+++ b/mysql-test/suite/funcs_1/triggers/triggers_03.inc	2007-12-20 19:06:38 +01:00
@@ -3,7 +3,7 @@
 # Trigger Tests
 # (test case numbering refer to requirement document TP v1.1)
 #======================================================================
-# WL#4084: enable dsiabled parts. 2007-11-15, hhunger
+# WL#4084: enable disabled parts. 2007-11-15, hhunger
 
 --disable_abort_on_error
 
@@ -162,10 +162,9 @@ let $message=Testcase 3.5.3.7a:;
 		set new.f1 = 'trig 3.5.3.7-1a';
 
 	connection default;
-	--error ER_COLUMNACCESS_DENIED_ERROR 
+	--error ER_COLUMNACCESS_DENIED_ERROR
 	insert into t1 (f1) values ('insert 3.5.3.7-1a');
 	select f1 from t1 order by f1;
-#	--error 0, 1360
 	drop trigger trg4a_1;
 
 	connection yes_privs_424a;
@@ -220,7 +219,6 @@ let $message= Testcase 3.5.3.7b:;
 	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 order by f1;
-#	--error 0, 1360
 	drop trigger trg4b_1;
 
 	connection yes_privs_424b;
@@ -273,7 +271,6 @@ let $message= Testcase 3.5.3.7c;
 	connection default;
 	insert into t1 (f1) values ('insert 3.5.3.7-1c');
 	select f1 from t1 order by f1;
-#	--error 0, 1360
 	drop trigger trg4c_1;
 
 	connection yes_privs_424c;
@@ -326,7 +323,6 @@ let $message= Testcase 3.5.3.7d:;
 	connection default;
 	insert into t1 (f1) values ('insert 3.5.3.7-1d');
 	select f1 from t1 order by f1;
-#	--error 0, 1360
 	drop trigger trg4d_1;
 
 	connection yes_privs_424d;
@@ -384,7 +380,6 @@ let $message= Testcase 3.5.3.8a:;
 	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;
@@ -442,7 +437,6 @@ let $message= Testcase: 3.5.3.8b;
 	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;
@@ -497,7 +491,6 @@ let $message= Testcase 3.5.3.8c:;
         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;
@@ -549,7 +542,6 @@ let $message=Testcase: 3.5.3.8d:;
         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;
diff -Nrup a/mysql-test/suite/funcs_1/triggers/triggers_08.inc
b/mysql-test/suite/funcs_1/triggers/triggers_08.inc
--- a/mysql-test/suite/funcs_1/triggers/triggers_08.inc	2007-11-28 17:56:51 +01:00
+++ b/mysql-test/suite/funcs_1/triggers/triggers_08.inc	2007-12-20 19:06:38 +01:00
@@ -111,9 +111,11 @@ let $message= 3.5.8.4 - multiple SQL;
 		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 order by i120;
-	select * from db_test.t1_u order by u120;
-	select * from db_test.t1_d order by d120;
+	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;
 
 
diff -Nrup a/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc
b/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc
--- a/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc	2007-11-28 17:56:51 +01:00
+++ b/mysql-test/suite/funcs_1/triggers/triggers_1011ext.inc	2007-12-20 19:06:38 +01:00
@@ -272,7 +272,8 @@ let $message= Testcase y.y.y.3: Circular
 	create trigger tr4 after insert on t4
 		for each row insert into t1 (f1) values (new.f4+1);
 
-	--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 order by f1;
 	select * from t2 order by f2;
diff -Nrup a/mysql-test/suite/funcs_1/triggers/triggers_master.test
b/mysql-test/suite/funcs_1/triggers/triggers_master.test
--- a/mysql-test/suite/funcs_1/triggers/triggers_master.test	2007-11-28 17:56:51 +01:00
+++ b/mysql-test/suite/funcs_1/triggers/triggers_master.test	2007-12-20 19:06:38 +01:00
@@ -1,7 +1,7 @@
 #======================================================================
 #
-# Trigger Tests 
-# (test case numbering refer to requirement document TP v1.1) 
+# Trigger Tests
+# (test case numbering refer to requirement document TP v1.1)
 #======================================================================
 # WL#4084: enable disabled parts, 2007-11-15, hhunger
 
@@ -40,37 +40,37 @@ let $message= Testcase: 3.5:;
 # Testcase: Ensure that all clauses that should be supported are supported.
 let $message= Testcase: 3.5.1.1:;
 --source include/show_msg.inc
-# OBN - This test case tests basic trigger definition and execution 
+# OBN - This test case tests basic trigger definition and execution
 #       of INSERT/UPDATE/DELETE actions and BEFORE/AFTER timings.
-#       As such it covers the equirements in sections 3.5.6.1, 3.5.6.2, 
+#       As such it covers the equirements in sections 3.5.6.1, 3.5.6.2,
 #       3.5.6.4, 3.5.6.5, 3.5.7.1, 3.5.7.2, 3.5.7.3, 3.5.7.17 below.
-#     - Note currently as a result of limitations with locking tables in 
+#     - Note currently as a result of limitations with locking tables in
 #       triggers, a specifc lockingof the tables is done.
 #       Once fixed, the locking and alias referances should be removed
 
 use test;
 # Trigger Definition
-	Create trigger trg1_1 BEFORE INSERT 
+	Create trigger trg1_1 BEFORE INSERT
 		on tb3 for each row set @test_before = 2, new.f142 = @test_before;
-	Create trigger trg1_2 AFTER INSERT 
+	Create trigger trg1_2 AFTER INSERT
 		on tb3 for each row set @test_after = 6;
-	Create trigger trg1_4 BEFORE UPDATE 
-		on tb3 for each row set @test_before = 27, 
-					new.f142 = @test_before, 
+	Create trigger trg1_4 BEFORE UPDATE
+		on tb3 for each row set @test_before = 27,
+					new.f142 = @test_before,
 					new.f122 = 'Before Update Trigger';
-	Create trigger trg1_3 AFTER UPDATE 
+	Create trigger trg1_3 AFTER UPDATE
 		on tb3 for each row set @test_after = '15';
-	Create trigger trg1_5 BEFORE DELETE on tb3 for each row  
-		select count(*) into @test_before from tb3 as tr_tb3 
+	Create trigger trg1_5 BEFORE DELETE on tb3 for each row
+		select count(*) into @test_before from tb3 as tr_tb3
 			where f121 = 'Test 3.5.1.1';
-	Create trigger trg1_6 AFTER DELETE on tb3 for each row  
-		select count(*) into @test_after from tb3 as tr_tb3 
+	Create trigger trg1_6 AFTER DELETE on tb3 for each row
+		select count(*) into @test_after from tb3 as tr_tb3
 			where f121 = 'Test 3.5.1.1';
 # Trigger Execution Insert (before and after)
 	set @test_before = 1;
 	set @test_after = 5;
         select @test_before, @test_after;
-	Insert into tb3 (f121, f122, f142, f144, f134) 
+	Insert into tb3 (f121, f122, f142, f144, f134)
 		values ('Test 3.5.1.1', 'First Row', @test_before, @test_after, 1);
 	select f121, f122, f142, f144, f134 from tb3 where f121 = 'Test 3.5.1.1';
         select @test_before, @test_after;
@@ -79,15 +79,15 @@ use test;
 	set @test_before = 18;
 	set @test_after = 8;
         select @test_before, @test_after;
-	Update tb3 set  tb3.f122 = 'Update', 
-			tb3.f142 = @test_before, 
-			tb3.f144 = @test_after 
+	Update tb3 set  tb3.f122 = 'Update',
+			tb3.f142 = @test_before,
+			tb3.f144 = @test_after
 		where tb3.f121 = 'Test 3.5.1.1';
 	select f121, f122, f142, f144, f134 from tb3 where f121 = 'Test 3.5.1.1';
         select @test_before, @test_after;
 
 # Trigger Execution Delete (before and after)
-	Insert into tb3 (f121, f122, f142, f144, f134) 
+	Insert into tb3 (f121, f122, f142, f144, f134)
 		values ('Test 3.5.1.1', 'Second Row', 5, 6, 2);
 	set @test_before = 0;
 	set @test_after = 0;
@@ -99,35 +99,35 @@ 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';
 	--enable_warnings
 
 #Section 3.5.1.2
-# Testcase: Ensure that all clauses that should not be supported are disallowed 
-#           with an appropriate error message. 
+# Testcase: Ensure that all clauses that should not be supported are disallowed
+#           with an appropriate error message.
 let $message= Testcase: 3.5.1.2:;
 --source include/show_msg.inc
 	
-	--error 1064
-	Create trigger trg_1 after insert 
+	--error ER_PARSE_ERROR
+	Create trigger trg_1 after insert
 		on tb3 for each statement set @x= 1;
 
-#Cleanup 
-	--disable_warnings 
-	--error 0, 1360
+#Cleanup
+	--disable_warnings
+	--error 0, ER_TRG_DOES_NOT_EXIST
 	drop trigger trg_1;
 	--enable_warnings
 	
@@ -136,66 +136,66 @@ 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 
-	CREATE for each row TRIGGER trg3_5 AFTER UPDATE on tb3 set @ret1 = 'test'; 
+	--error ER_PARSE_ERROR
+	CREATE for each row TRIGGER trg3_5 AFTER UPDATE on tb3 set @ret1 = 'test';
 	
 #Cleanup
 # 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.
 	--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
 
 
 #Section 3.5.1.4
-# Testcase: Ensure that an appropriate error message is returned if a clause 
+# Testcase: Ensure that an appropriate error message is returned if a clause
 #           is out-of-order in an SQL statement.
 # OBN - FIXME - Missing 3.5.1.4 need to add
 
 #Section 3.5.1.5
-# Testcase: Ensure that all clauses that are defined to be mandatory are indeed 
+# Testcase: Ensure that all clauses that are defined to be mandatory are indeed
 #           required to be mandatory by the MySQL server and tools
 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
@@ -203,19 +203,19 @@ 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 
+	--enable_warnings
 
 #Section 3.5.1.6
 # Testcase: Ensure that any clauses that are defined to be optional are indeed
@@ -224,15 +224,15 @@ let $message= Testcase 3.5.1.6: - Need t
 --source include/show_msg.inc
 # OBN - FIXME - Missing 3.5.1.6 need to add
 
-#Section 3.5.1.7 
-# Testcase: Ensure that all valid, fully-qualified, and non-qualified, 
+#Section 3.5.1.7
+# Testcase: Ensure that all valid, fully-qualified, and non-qualified,
 #           trigger names are accepted, at creation time.
 let $message= Testcase 3.5.1.7: - need to fix;
 --source include/show_msg.inc
 
 	drop table if exists t1;
 	eval create table t1 (f1 int, f2 char(25),f3 int) engine=$engine_type;
-	CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1 
+	CREATE TRIGGER trg5_1 BEFORE INSERT on test.t1
 		for each row set new.f3 = '14';
 	CREATE TRIGGER trg_abcdefghijklmnopqrstuvwxyz1234567890ABCDEFGHIJKLMNOPQRSTUVWXYZ
 		BEFORE UPDATE on test.t1 for each row set new.f3 = '42';
@@ -244,36 +244,36 @@ let $message= Testcase 3.5.1.7: - need t
 	select trigger_name from information_schema.triggers;
 
 #Cleanup
-	--disable_warnings 
-	--error 0, 1360
+	--disable_warnings
+	--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;
 	drop table t1;
 
 #Section 3.5.1.8
-# Testcase: Ensure that any invalid trigger name is never accepted, and that an 
+# Testcase: Ensure that any invalid trigger name is never accepted, and that an
 #            appropriate error message is returned when the name is rejected.
 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	
-	CREATE TRIGGER tb3.trg6_1 BEFORE INSERT on test.tb3 
+	--error ER_TRG_IN_WRONG_SCHEMA	
+	CREATE TRIGGER tb3.trg6_1 BEFORE INSERT on test.tb3
 		for each row set new.f120 ='X';
 	
 	--disable_warnings
@@ -285,29 +285,29 @@ let $message= Testcase 3.5.1.8:;
 
 	# Can't create a trigger in a different database
 	use test;
-	--error 1435
-	CREATE TRIGGER trig_db.trg6_2 AFTER INSERT on tb3 
+	--error ER_TRG_IN_WRONG_SCHEMA
+	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
-	CREATE TRIGGER trg6_3 AFTER INSERT on test.tb3 
+	--error ER_TRG_IN_WRONG_SCHEMA
+	CREATE TRIGGER trg6_3 AFTER INSERT on test.tb3
 		for each row set @ret_trg6_3 = 18;
 
 	use test;
 
 #Cleanup
-	--disable_warnings 
+	--disable_warnings
 	drop database trig_db;
 # 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 
+	--enable_warnings
 
 #Section 3.5.1.9
 #Testcase:  Ensure that a reference to a non-existent trigger is rejected with
@@ -317,41 +317,41 @@ let $message= Testcase 3.5.1.9:(cannot b
 
 
 #Section 3.5.1.10
-#Testcase: Ensure that it is not possible to create two triggers with the same name on 
+#Testcase: Ensure that it is not possible to create two triggers with the same name on
 #          the same table
 let $message= Testcase 3.5.1.10:;
 --source include/show_msg.inc
 
 	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
+	--disable_warnings
+	--error 0, ER_TRG_DOES_NOT_EXIST
 	drop trigger trg7_1;
 	--enable_warnings
 
 
-#Section 3.5.1.? 
-# Testcase: Ensure that it is not possible to create two or more triggers with 
+#Section 3.5.1.?
+# Testcase: Ensure that it is not possible to create two or more triggers with
 #           the same name, provided each is associated with a different table.
 let $message= Testcase 3.5.1.?:;
 --source include/show_msg.inc
 
-	--disable_warnings 
+	--disable_warnings
 	drop table if exists t1;
 	drop table if exists t2;
 	--enable_warnings
 	eval create table t1 (f1 char(50), f2 integer) engine = $engine_type;
 	eval create table t2 (f1 char(50), f2 integer) engine = $engine_type;
 
-	create trigger trig before insert on t1 
+	create trigger trig before insert on t1
 		for each row set new.f1 ='trig t1';
 
-	--error 1359
-	create trigger trig before update on t2 
+	--error ER_TRG_ALREADY_EXISTS
+	create trigger trig before update on t2
 		for each row set new.f1 ='trig t2';
 
 	insert into t1 value ('insert to t1',1);
@@ -363,16 +363,16 @@ let $message= Testcase 3.5.1.?:;
 	select * from t2;
 
 #Cleanup
-	--disable_warnings 
+	--disable_warnings
 	drop table t1;
 	drop table t2;
-	--error 0, 1360
+	--error 0, ER_TRG_DOES_NOT_EXIST
 	drop trigger trig;
 	--enable_warnings
 
 
-#Section 3.5.1.11 
-# Testcase: Ensure that it is possible to create two or more triggers with 
+#Section 3.5.1.11
+# Testcase: Ensure that it is possible to create two or more triggers with
 #           the same name, provided each resides in a different database
 let $message= Testcase 3.5.1.11:;
 --source include/show_msg.inc
@@ -387,15 +387,15 @@ let $message= Testcase 3.5.1.11:;
 	create database trig_db3;
 	use trig_db1;
 	eval create table t1 (f1 char(50), f2 integer) engine = $engine_type;
-	create trigger trig before insert on t1 
+	create trigger trig before insert on t1
 		for each row set new.f1 ='trig1', @test_var1='trig1';
 	use trig_db2;
 	eval create table t2 (f1 char(50), f2 integer) engine = $engine_type;
-	create trigger trig before insert on t2 
+	create trigger trig before insert on t2
 		for each row set new.f1 ='trig2', @test_var2='trig2';
 	use trig_db3;
 	eval create table t1 (f1 char(50), f2 integer) engine = $engine_type;
-	create trigger trig before insert on t1 
+	create trigger trig before insert on t1
 		for each row set new.f1 ='trig3', @test_var3='trig3';
 
 	set @test_var1= '', @test_var2= '', @test_var3= '';
@@ -412,7 +412,7 @@ let $message= Testcase 3.5.1.11:;
 	use test;
 
 #Cleanup
-	--disable_warnings 
+	--disable_warnings
 	drop database trig_db1;
 	drop database trig_db2;
 	drop database trig_db3;
@@ -423,16 +423,16 @@ let $message= Testcase 3.5.1.11:;
 # Check for the global nature of Triggers #
 ###########################################
 
-#Section 3.5.2.1 
-# Test case: Ensure that if a trigger created without a qualifying database 
+#Section 3.5.2.1
+# Test case: Ensure that if a trigger created without a qualifying database
 #            name belongs to the database in use at creation time.
-#Section 3.5.2.2 
-# Test case: Ensure that if a trigger created with a qualifying database name 
+#Section 3.5.2.2
+# Test case: Ensure that if a trigger created with a qualifying database name
 #            belongs to the database specified.
-#Section 3.5.2.3 
-# Test case: Ensure that if a trigger created with a qualifying database name 
-#            does not belong to the database in use at creation time unless 
-#            the qualifying database name identifies the database that is 
+#Section 3.5.2.3
+# Test case: Ensure that if a trigger created with a qualifying database name
+#            does not belong to the database in use at creation time unless
+#            the qualifying database name identifies the database that is
 #            also in use at creation time.
 let $message= Testcase 3.5.2.1/2/3:;
 --source include/show_msg.inc
@@ -447,11 +447,11 @@ let $message= Testcase 3.5.2.1/2/3:;
 	use trig_db1;
 	eval create table t1 (f1 char(50), f2 integer) engine = $engine_type;
 	eval create table trig_db2.t1 (f1 char(50), f2 integer) engine = $engine_type;
-	create trigger trig1_b before insert on t1 
+	create trigger trig1_b before insert on t1
 		for each row set @test_var1='trig1_b';
-	create trigger trig_db1.trig1_a after insert on t1 
+	create trigger trig_db1.trig1_a after insert on t1
 		for each row set @test_var2='trig1_a';
-	create trigger trig_db2.trig2 before insert on trig_db2.t1 
+	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;
@@ -462,7 +462,7 @@ let $message= Testcase 3.5.2.1/2/3:;
 	select @test_var1, @test_var2, @test_var3;
 
 #Cleanup
-	--disable_warnings 
+	--disable_warnings
 	drop database trig_db1;
 	drop database trig_db2;
 
@@ -488,13 +488,13 @@ let $message= Testcase 3.5.3:;
 	create User test_yesprivs@localhost;
 	set password for test_yesprivs@localhost = password('PWD');
 
-#Section 3.5.3.1 / 3.5.3.2 
+#Section 3.5.3.1 / 3.5.3.2
 # Test case: Ensure SUPER privilege is required to create a trigger
 #Section 3.5.3.3 / 3.5.3.4
 # Test case: Ensure that root always has the SUPER privilege.
 # OMR - No need to test this since SUPER priv is an existing one and not related
-#       or added for triggers (TP 2005-06-06) 
-#Section 3.5.3.5 / 3.5.3.6 
+#       or added for triggers (TP 2005-06-06)
+#Section 3.5.3.5 / 3.5.3.6
 # Test case: Ensure that the SUPER privilege is required to drop a trigger.
 let $message= Testcase 3.5.3.2/6:;
 --source include/show_msg.inc
@@ -523,8 +523,8 @@ let $message= Testcase 3.5.3.2:;
         select current_user;
 	use priv_db;
 	
-	--error 1227
-	create trigger trg1_1 before INSERT on t1 for each row 
+	--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;
@@ -536,7 +536,7 @@ let $message= Testcase 3.5.3.2:;
         select current_user;
 	use priv_db;
 
-	create trigger trg1_2 before INSERT  on t1 for each row 
+	create trigger trg1_2 before INSERT  on t1 for each row
 		set new.f1 = 'trig 3.5.3.2_2-yes';
 
 	connection default;
@@ -550,8 +550,8 @@ let $message= Testcase 3.5.3.6:;
 	connection no_privs;
 	use priv_db;
 	
-	--error 1227
-	drop trigger trg1_2;  
+	--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+	drop trigger trg1_2;
 
 	connection default;
 	use priv_db;
@@ -561,7 +561,7 @@ let $message= Testcase 3.5.3.6:;
 	connection yes_privs;
 	use priv_db;
 
-	drop trigger trg1_2;  
+	drop trigger trg1_2;
 
 	connection default;
 	use priv_db;
@@ -569,9 +569,9 @@ let $message= Testcase 3.5.3.6:;
 	select f1 from t1;
 
 # Cleanup	
-	--disable_warnings 
+	--disable_warnings
 	connection default;
-	--error 0, 1360
+	--error 0, ER_TRG_DOES_NOT_EXIST
 	drop trigger trg1_2;
 	disconnect no_privs;
 	disconnect yes_privs;
@@ -579,7 +579,7 @@ let $message= Testcase 3.5.3.6:;
 
 
 #Section 3.5.3.7
-# Test case: Ensure that use of the construct "SET NEW. <column name> =
<value>" 
+# 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
 
@@ -607,21 +607,21 @@ let $message=Testcase 3.5.3.7a:;
 	show grants;
 	select f1 from t1;
 
-	--error 1227
-	create trigger trg4a_1 before INSERT on t1 for each row 
+	--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+	create trigger trg4a_1 before INSERT on t1 for each row
 		set new.f1 = 'trig 3.5.3.7-1a';
 
 	connection default;
 	insert into t1 (f1) values ('insert 3.5.3.7-1a');
 	select f1 from t1;
-	--error 0, 1360
+	--error 0, ER_TRG_DOES_NOT_EXIST
 	drop trigger trg4a_1;
 
 	connection yes_privs_424a;
 	use priv_db;
 	select current_user;
 	show grants;
-	create trigger trg4a_2 before INSERT  on t1 for each row 
+	create trigger trg4a_2 before INSERT  on t1 for each row
 		set new.f1 = 'trig 3.5.3.7-2a';
 
 	connection default;
@@ -629,7 +629,7 @@ let $message=Testcase 3.5.3.7a:;
 	select f1 from t1;
 
 # Cleanup
-	--disable_warnings 
+	--disable_warnings
 	drop trigger trg4a_2;
 	disconnect no_privs_424a;
 	disconnect yes_privs_424a;
@@ -660,8 +660,8 @@ let $message= Testcase 3.5.3.7b:;
 	show grants;
 	use priv_db;
 
-	--error 1227
-	create trigger trg4b_1 before UPDATE on t1 for each row 
+	--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+	create trigger trg4b_1 before UPDATE on t1 for each row
 		set new.f1 = 'trig 3.5.3.7-1b';
 
 	connection default;
@@ -669,13 +669,13 @@ let $message= Testcase 3.5.3.7b:;
 	select f1 from t1;
 	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
+	--error 0, ER_TRG_DOES_NOT_EXIST
 	drop trigger trg4b_1;
 
 	connection yes_privs_424b;
 	show grants;
 	use priv_db;
-	create trigger trg4b_2 before UPDATE  on t1 for each row 
+	create trigger trg4b_2 before UPDATE  on t1 for each row
 		set new.f1 = 'trig 3.5.3.7-2b';
 
 	connection default;
@@ -684,7 +684,7 @@ let $message= Testcase 3.5.3.7b:;
 	update t1 set  f1 = 'update 3.5.3.7-2b' where f1 = 'insert 3.5.3.7-2b';
 	select f1 from t1;
 # Cleanup
-	--disable_warnings 
+	--disable_warnings
 	drop trigger trg4b_2;
 	disconnect no_privs_424b;
 	disconnect yes_privs_424b;
@@ -715,20 +715,20 @@ let $message= Testcase 3.5.3.7c;
 	show grants;
 	use priv_db;
 
-	--error 1227
-	create trigger trg4c_1 before INSERT on t1 for each row 
+	--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+	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
+	--error 0, ER_TRG_DOES_NOT_EXIST
 	drop trigger trg4c_1;
 
 	connection yes_privs_424c;
 	show grants;
 	use priv_db;
-	create trigger trg4c_2 before INSERT  on t1 for each row 
+	create trigger trg4c_2 before INSERT  on t1 for each row
 		set new.f1 = 'trig 3.5.3.7-2c';
 
 	connection default;
@@ -736,7 +736,7 @@ let $message= Testcase 3.5.3.7c;
 	select f1 from t1;
 
 # Cleanup
-	--disable_warnings 
+	--disable_warnings
 	drop trigger trg4c_2;
 	disconnect no_privs_424c;
 	disconnect yes_privs_424c;
@@ -768,20 +768,20 @@ let $message= Testcase 3.5.3.7d:;
 	connection no_privs_424d;
 	show grants;
 	use priv_db;
-	--error 1227
-	create trigger trg4d_1 before INSERT on t1 for each row 
+	--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+	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
+	--error 0, ER_TRG_DOES_NOT_EXIST
 	drop trigger trg4d_1;
 
 	connection yes_privs_424d;
 	show grants;
 	use priv_db;
-	create trigger trg4d_2 before INSERT  on t1 for each row 
+	create trigger trg4d_2 before INSERT  on t1 for each row
 		set new.f1 = 'trig 3.5.3.7-2d';
 
 	connection default;
@@ -789,15 +789,15 @@ let $message= Testcase 3.5.3.7d:;
 	select f1 from t1;
 
 # Cleanup
-	--disable_warnings 
+	--disable_warnings
 	drop trigger trg4d_2;
 	disconnect no_privs_424d;
 	disconnect yes_privs_424d;
 	--enable_warnings
 
 #Section 3.5.3.8
-# Test case: Ensure that use of the construct "SET <target> = NEW. <Column
name>" fails 
-#            at CREATE TRIGGER time, if the current user does not have the SELECT
privilege 
+# Test case: Ensure that use of the construct "SET <target> = NEW. <Column
name>" fails
+#            at CREATE TRIGGER time, if the current user does not have the SELECT
privilege
 #            on the column specified.
 
 # --- 3.5.3.8a - Privs set on a global level
@@ -824,8 +824,8 @@ let $message= Testcase 3.5.3.8a:;
 	use priv_db;
 	show grants;
 
-	--error 1227
-	create trigger trg5a_1 before INSERT on t1 for each row 
+	--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+	create trigger trg5a_1 before INSERT on t1 for each row
 		set @test_var = new.f1;
 
 	connection default;
@@ -833,14 +833,14 @@ let $message= Testcase 3.5.3.8a:;
 	select @test_var;
 	insert into t1 (f1) values ('insert 3.5.3.8-1a');
 	select @test_var;
-	--error 0, 1360
+	--error 0, ER_TRG_DOES_NOT_EXIST
 	drop trigger trg5a_1;
 
 	connection yes_privs_425a;
 	use priv_db;
 	select current_user;
 	show grants;
-	create trigger trg5a_2 before INSERT  on t1 for each row 
+	create trigger trg5a_2 before INSERT  on t1 for each row
 		set @test_var= new.f1;
 
 	connection default;
@@ -850,7 +850,7 @@ let $message= Testcase 3.5.3.8a:;
 	select @test_var;
 
 # Cleanup
-	--disable_warnings 
+	--disable_warnings
 	drop trigger trg5a_2;
 	disconnect no_privs_425a;
 	disconnect yes_privs_425a;
@@ -881,8 +881,8 @@ let $message= Testcase: 3.5.3.8b;
 	show grants;
 	use priv_db;
 
-	--error 1227
-	create trigger trg5b_1 before UPDATE on t1 for each row 
+	--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+	create trigger trg5b_1 before UPDATE on t1 for each row
 		set @test_var= new.f1;
 
 	connection default;
@@ -891,13 +891,13 @@ let $message= Testcase: 3.5.3.8b;
 	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
+	--error 0, ER_TRG_DOES_NOT_EXIST
 	drop trigger trg5b_1;
 
 	connection yes_privs_425b;
 	show grants;
 	use priv_db;
-	create trigger trg5b_2 before UPDATE  on t1 for each row 
+	create trigger trg5b_2 before UPDATE  on t1 for each row
 		set @test_var= new.f1;
 
 	connection default;
@@ -907,7 +907,7 @@ let $message= Testcase: 3.5.3.8b;
 	update t1 set  f1= 'update 3.5.3.8-2b' where f1 = 'insert 3.5.3.8-2b';
 	select @test_var;
 # Cleanup
-	--disable_warnings 
+	--disable_warnings
 	drop trigger trg5b_2;
 	disconnect no_privs_425b;
 	disconnect yes_privs_425b;
@@ -938,21 +938,21 @@ let $message= Testcase 3.5.3.8c:;
 	show grants;
 	use priv_db;
 
-	--error 1227
-	create trigger trg5c_1 before INSERT on t1 for each row 
+	--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+	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
+	--error 0, ER_TRG_DOES_NOT_EXIST
 	drop trigger trg5c_1;
 
 	connection yes_privs_425c;
 	show grants;
 	use priv_db;
-	create trigger trg5c_2 before INSERT  on t1 for each row 
+	create trigger trg5c_2 before INSERT  on t1 for each row
 		set @test_var= new.f1;
 
 	connection default;
@@ -960,7 +960,7 @@ let $message= Testcase 3.5.3.8c:;
 	insert into t1 (f1) values ('insert 3.5.3.8-2c');
 	select @test_var;
 # Cleanup
-	--disable_warnings 
+	--disable_warnings
 	drop trigger trg5c_2;
 	disconnect no_privs_425c;
 	disconnect yes_privs_425c;
@@ -990,21 +990,21 @@ let $message=Testcase: 3.5.3.8d:;
 	connection no_privs_425d;
 	show grants;
 	use priv_db;
-	--error 1227
-	create trigger trg5d_1 before INSERT on t1 for each row 
+	--error ER_SPECIFIC_ACCESS_DENIED_ERROR
+	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
+	--error 0, ER_TRG_DOES_NOT_EXIST
 	drop trigger trg5d_1;
 
 	connection yes_privs_425d;
 	show grants;
 	use priv_db;
-	create trigger trg5d_2 before INSERT  on t1 for each row 
+	create trigger trg5d_2 before INSERT  on t1 for each row
 		set @test_var= new.f1;
 
 	connection default;
@@ -1013,12 +1013,12 @@ let $message=Testcase: 3.5.3.8d:;
 	select @test_var;
 
 # Cleanup 3.5.3.8
-	--disable_warnings 
+	--disable_warnings
 	drop trigger trg5d_2;
 	--enable_warnings
 
 # Cleanup 3.5.3
-	--disable_warnings 
+	--disable_warnings
 	drop database if exists priv_db;
 	drop user test_yesprivs@localhost;
 	drop user test_noprivs@localhost;
@@ -1046,7 +1046,7 @@ let $message= Testcase 3.5.4.1:;
 	eval create table t1 (f1 char(30)) engine=$engine_type;
 	grant INSERT, SELECT on db_drop.t1 to test_general;
 	Use db_drop;
-	Create trigger trg1 BEFORE INSERT on t1 
+	Create trigger trg1 BEFORE INSERT on t1
 		for each row set new.f1='Trigger 3.5.4.1';
 	connection con_general;
 	Use db_drop;
@@ -1061,17 +1061,17 @@ let $message= Testcase 3.5.4.1:;
 	Select * from t1;
 
 #Cleanup
-	--disable_warnings 
+	--disable_warnings
 	connection con_super;
         --disable_warnings
-	--error 0,1360
-	drop trigger trg1; 
+	--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';
 	--enable_warnings
 
 #Section 3.5.4.2
-# Test case: Ensure that DROP TRIGGER <trigger name> fails, with an appropriate
error 
+# Test case: Ensure that DROP TRIGGER <trigger name> fails, with an appropriate
error
 #            message, if the trigger name does not exist.
 let $message= Testcase 3.5.4.2:;
 --source include/show_msg.inc
@@ -1083,16 +1083,16 @@ 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 
+#cleanup
 	--disable_warnings
 	drop table if exists t1_432 ;
 	drop database  if exists db_drop2;
 	--enable_warnings
 
 #Section 3.5.4.3
-# Test case: Ensure that DROP TRIGGER <trigger name> fails, with an appropriate 
+# Test case: Ensure that DROP TRIGGER <trigger name> fails, with an appropriate
 #            error message, if <trigger name> is not a qualified name.
 let $message= Testcase 3.5.4.3:;
 --source include/show_msg.inc
@@ -1107,33 +1107,33 @@ let $message= Testcase 3.5.4.3:;
 	eval create table t1_433 (f1 char (30)) engine=$engine_type;
 	eval create table t1_433a (f1a char (5)) engine=$engine_type;
 
-	CREATE TRIGGER trg3 BEFORE INSERT on t1_433 for each row 
+	CREATE TRIGGER trg3 BEFORE INSERT on t1_433 for each row
 		set new.f1 = 'Trigger 3.5.4.3';
 
-# Using table 
-	--error 1064
+# Using table
+	--error ER_PARSE_ERROR
 	Drop trigger t1.433.trg3;
 
-# Using database.table 
-	--error 1064
+# Using database.table
+	--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 
+#cleanup
 	Drop trigger db_drop3.trg3;
 	drop table if exists t1_433;
 	drop table if exists t1_433a;
 	drop database if exists db_drop3;
 
 #Section 3.5.4.4
-# Test case: Ensure that when a database is dropped, all triggers created within 
+# Test case: Ensure that when a database is dropped, all triggers created within
 #            that database are also cleanly dropped.
 let $message= Testcase 3.5.4.4:;
 --source include/show_msg.inc
@@ -1143,7 +1143,7 @@ let $message= Testcase 3.5.4.4:;
 	Use db_drop4;
 	eval create table t1 (f1 char(30)) engine=$engine_type;
 	grant INSERT, SELECT on db_drop4.t1 to test_general;
-	Create trigger trg4 BEFORE INSERT on t1 
+	Create trigger trg4 BEFORE INSERT on t1
 		for each row set new.f1='Trigger 3.5.4.4';
 	connection con_general;
 	Use db_drop4;
@@ -1166,14 +1166,14 @@ let $message= Testcase 3.5.4.4:;
 #Cleanup
 	connection con_super;
         --disable_warnings
-	--error 1360
-	drop trigger trg4; 
+	--error ER_TRG_DOES_NOT_EXIST
+	drop trigger trg4;
 	drop database if exists db_drop4;
 	--enable_warnings
 	revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
 
 #Section 3.5.4.5
-# Test case: Ensure that when a table is dropped, all triggers for which it is the 
+# Test case: Ensure that when a table is dropped, all triggers for which it is the
 #            subject table are also cleanly dropped.
 let $message= Testcase 3.5.4.5:;
 --source include/show_msg.inc
@@ -1183,7 +1183,7 @@ let $message= Testcase 3.5.4.5:;
 	Use db_drop5;
 	eval create table t1 (f1 char(50)) engine=$engine_type;
 	grant INSERT, SELECT on t1 to test_general;
-	Create trigger trg5 BEFORE INSERT on t1 
+	Create trigger trg5 BEFORE INSERT on t1
 		for each row set new.f1='Trigger 3.5.4.5';
 	connection con_general;
 	Use db_drop5;
@@ -1204,8 +1204,8 @@ let $message= Testcase 3.5.4.5:;
 #Cleanup
 	connection con_super;
         --disable_warnings
-	--error 1360
-	drop trigger trg5; 
+	--error ER_TRG_DOES_NOT_EXIST
+	drop trigger trg5;
 	drop database if exists db_drop5;
 	--enable_warnings
 	revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
@@ -1223,55 +1223,55 @@ let $message= Testcase 3.5.5:;
 	use test;
 
 #Section 3.5.5.1
-# Test case: Ensure that, if CREATE TRIGGER is executed with a non-existent 
+# Test case: Ensure that, if CREATE TRIGGER is executed with a non-existent
 #            subject table, the statement fails with an appropriate error message.
 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;
 
 
 #Section 3.5.5.2
-# Test case: Ensure that, if CREATE TRIGGER is executed with a temporary table 
+# Test case: Ensure that, if CREATE TRIGGER is executed with a temporary table
 #           as the subject table, the statement fails with an appropriate error message.
 let $message= Testcase 3.5.5.2:;
 --source include/show_msg.inc
 	
 	Create temporary table t1_temp (f1 bigint signed, f2 bigint unsigned);
 	
-	--error 1361
-	Create trigger trg2 before INSERT 
+	--error ER_TRG_ON_VIEW_OR_TEMP_TABLE
+	Create trigger trg2 before INSERT
 		on t1_temp for each row set new.f2=9999;
 
 #Cleanup
-	--disable_warnings 
+	--disable_warnings
 	drop table t1_temp;
 	--enable_warnings
 
 
 #Section 3.5.5.3
-# Test case: Ensure that, if CREATE TRIGGER is executed with a view as the subject 
+# Test case: Ensure that, if CREATE TRIGGER is executed with a view as the subject
 #            table, the statement fails with an appropriate error message.
 let $message= Testcase 3.5.5.3:;
 --source include/show_msg.inc
 
 	Create view vw3 as select f118 from tb3;
 	
-# OBN Not sure why the server is returning error 1347
-	--error 1347
-	Create trigger trg3 before INSERT 
+# 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';
 
 #Cleanup
-	--disable_warnings 
+	--disable_warnings
 	drop view vw3;
 	--enable_warnings
 
 
 #Section 3.5.5.4
-# Test case: Ensure that, if CREATE TRIGGER is executed with a table that resides 
-#            in a different database than in which the trigger will reside, the 
+# Test case: Ensure that, if CREATE TRIGGER is executed with a table that resides
+#            in a different database than in which the trigger will reside, the
 #            statement fails with an appropriate error message; that is, ensure that
 #            the trigger and its subject table must reside in the same database.
 let $message= Testcase 3.5.5.4:;
@@ -1283,7 +1283,7 @@ let $message= Testcase 3.5.5.4:;
 	use dbtest_two;
 	create table t2 (f1 char(15));
 	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;
@@ -1298,7 +1298,7 @@ let $message= Testcase 3.5.5.4:;
 
 #Cleanup
 	connection con_super;
-	--disable_warnings 
+	--disable_warnings
 	revoke ALL PRIVILEGES, GRANT OPTION FROM 'test_general'@'localhost';
 	DROP DATABASE if exists dbtest_one;
 	drop database if EXISTS dbtest_two;
@@ -1316,7 +1316,7 @@ let $message= Testcase 3.5.6:;
 	use test;
 
 #Section 3.5.6.1
-# Test case: Ensure that a trigger definition can specify a trigger action time of
BEFORE. 
+# Test case: Ensure that a trigger definition can specify a trigger action time of
BEFORE.
 # See section 3.5.1.1
 let $message= Testcase 3.5.6.1 (see Testcase 3.5.1.1);
 --source include/show_msg.inc
@@ -1328,37 +1328,37 @@ let $message= Testcase 3.5.6.2 (see Test
 --source include/show_msg.inc
 
 #Section 3.5.6.3
-# Test case: Ensure that a trigger definition that specifies a trigger action 
-#            time that is not either BEFORE or AFTER fails, with an appropriate 
+# Test case: Ensure that a trigger definition that specifies a trigger action
+#            time that is not either BEFORE or AFTER fails, with an appropriate
 #            error message, at CREATE TRIGGER time.
 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 
+#Cleanup
 # 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.
 	--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
 
 #Section 3.5.6.4
-# Test case: Ensure that a trigger defined with a trigger action time of BEFORE 
-#            always executes its triggered action immediately before the trigger event. 
+# Test case: Ensure that a trigger defined with a trigger action time of BEFORE
+#            always executes its triggered action immediately before the trigger event.
 # See section 3.5.1.1
 let $message= Testcase 3.5.6.4 (see Testcase 3.5.1.1);
 --source include/show_msg.inc
 
 #Section 3.5.6.5
-# Test case: Ensure that a trigger defined with a trigger action time of AFTER 
+# Test case: Ensure that a trigger defined with a trigger action time of AFTER
 #            always executes its triggered action immediately after the trigger event.
 let $message= Testcase 3.5.6.5 (see Testcase 3.5.1.1);
 --source include/show_msg.inc
@@ -1384,40 +1384,40 @@ let $message= Testcase 3.5.7.3 (see Test
 --source include/show_msg.inc
 
 #Section 3.5.7.4
-# Test case: Ensure that a trigger definition that specifies a trigger event that 
-#            is not either INSERT, UPDATE or DELETE fails, with an appropriate error 
+# Test case: Ensure that a trigger definition that specifies a trigger event that
+#            is not either INSERT, UPDATE or DELETE fails, with an appropriate error
 #            message, at CREATE TRIGGER time.
 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 
+#Cleanup
 # 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.
 	--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
 
-#Section 3.5.7.5 / 3.5.7.6 
-# Test case: Ensure that it is not possible to create multiple BEFORE INSERT triggers 
+#Section 3.5.7.5 / 3.5.7.6
+# Test case: Ensure that it is not possible to create multiple BEFORE INSERT triggers
 #            on the same table, even if the triggers have different names / different
 #            triggered actions.
 let $message= Testcase 3.5.7.5 / 3.5.7.6:;
 --source include/show_msg.inc
 
-	Create trigger trg5_1 BEFORE INSERT 
+	Create trigger trg5_1 BEFORE INSERT
 		on tb3 for each row set new.f122='Trigger1 3.5.7.5/6';
 
-	--error 1359 
-	Create trigger trg5_2 BEFORE INSERT 
+	--error ER_TRG_ALREADY_EXISTS
+	Create trigger trg5_2 BEFORE INSERT
 		on tb3 for each row set new.f122='Trigger2 3.5.7.5';
 
 	Insert into tb3 (f121,f122) values ('Test 3.5.7.5/6','Insert 3.5.7.5');
@@ -1426,27 +1426,27 @@ let $message= Testcase 3.5.7.5 / 3.5.7.6
 	Select f121,f122 from tb3 where f121='Test 3.5.7.5/6';
 
 #Cleanup
-	--disable_warnings 
+	--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
 
 
-#Section 3.5.7.7 / 3.5.7.8 
-# Test case: Ensure that it is not possible to create multiple AFTER INSERT triggers 
+#Section 3.5.7.7 / 3.5.7.8
+# Test case: Ensure that it is not possible to create multiple AFTER INSERT triggers
 #            on the same table, even if the triggers have different names / different
 #            triggered actions.
 let $message= Testcase 3.5.7.7 / 3.5.7.8:;
 --source include/show_msg.inc
 	
 	set @test_var='Before trig 3.5.7.7';
-	Create trigger trg6_1 AFTER INSERT 
+	Create trigger trg6_1 AFTER INSERT
 		on tb3 for each row set @test_var='Trigger1 3.5.7.7/8';
 
-	--error 1359 
-	Create trigger trg6_2 AFTER INSERT 
+	--error ER_TRG_ALREADY_EXISTS
+	Create trigger trg6_2 AFTER INSERT
 		on tb3 for each row set @test_var='Trigger2 3.5.7.7';
 
 	select @test_var;
@@ -1458,26 +1458,26 @@ let $message= Testcase 3.5.7.7 / 3.5.7.8
 	select @test_var;
 
 #Cleanup
-	--disable_warnings 
+	--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
 
 
 #Section 3.5.7.9 / 3.5.7.10
-# Test case: Ensure that it is not possible to create multiple BEFORE UPDATE triggers 
-#            on the same table, even if the triggers have different names / different 
+# Test case: Ensure that it is not possible to create multiple BEFORE UPDATE triggers
+#            on the same table, even if the triggers have different names / different
 #            triggered actions.
 let $message= Testcase 3.5.7.9/10:;
 --source include/show_msg.inc
 
-	Create trigger trg7_1 BEFORE UPDATE 
+	Create trigger trg7_1 BEFORE UPDATE
 		on tb3 for each row set new.f122='Trigger1 3.5.7.9/10';
 
-	--error 1359 
-	Create trigger trg7_2 BEFORE UPDATE 
+	--error ER_TRG_ALREADY_EXISTS
+	Create trigger trg7_2 BEFORE UPDATE
 		on tb3 for each row set new.f122='Trigger2 3.5.7.9';
 
 	Insert into tb3 (f121,f122) values ('Test 3.5.7.9/10','Insert 3.5.7.9');
@@ -1486,25 +1486,25 @@ let $message= Testcase 3.5.7.9/10:;
 	Select f121,f122 from tb3 where f121='Test 3.5.7.9/10';
 
 #Cleanup
-	--disable_warnings 
+	--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';	
 
 #Section 3.5.7.11 / 3.5.7.12
-# Test case: Ensure that it is not possible to create multiple AFTER UPDATE triggers 
+# Test case: Ensure that it is not possible to create multiple AFTER UPDATE triggers
 #            on the same table, even if the triggers have different names / different
-#            triggered actions. 
+#            triggered actions.
 let $message= Testcase 3.5.7.11/12:;
 --source include/show_msg.inc
 
 	set @test_var='Before trig 3.5.7.11';
-	Create trigger trg8_1 AFTER UPDATE 
+	Create trigger trg8_1 AFTER UPDATE
 		on tb3 for each row set @test_var='Trigger 3.5.7.11/12';
 
-	--error 1359 
-	Create trigger trg8_2 AFTER UPDATE 
+	--error ER_TRG_ALREADY_EXISTS
+	Create trigger trg8_2 AFTER UPDATE
 		on tb3 for each row set @test_var='Trigger2 3.5.7.11';
 
 
@@ -1518,25 +1518,25 @@ let $message= Testcase 3.5.7.11/12:;
 	delete from tb3 where f121='Test 3.5.7.11/12';
 
 #Cleanup
-	--disable_warnings 
+	--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';	
 
 #Section 3.5.7.13 / 3.5.7.14
-# Test case: Ensure that it is not possible to create multiple BEFORE DELETE triggers 
+# Test case: Ensure that it is not possible to create multiple BEFORE DELETE triggers
 #            on the same table, even if the triggers have different names / different
 #            triggered actions.
 let $message= Testcase 3.5.7.13/14:;
 --source include/show_msg.inc
 
 	set @test_var=1;
-	Create trigger trg9_1 BEFORE DELETE 
+	Create trigger trg9_1 BEFORE DELETE
 		on tb3 for each row set @test_var=@test_var+1;
 
-	--error 1359 
-	Create trigger trg9_2 BEFORE DELETE 
+	--error ER_TRG_ALREADY_EXISTS
+	Create trigger trg9_2 BEFORE DELETE
 		on tb3 for each row set @test_var=@test_var+10;
 
 	select @test_var;
@@ -1550,29 +1550,29 @@ let $message= Testcase 3.5.7.13/14:;
 	select @test_var;
 
 #Cleanup
-	--disable_warnings 
+	--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';	
 
 #Section 3.5.7.15 / 3.5.7.16
-# Test case: Ensure that it is not possible to create multiple AFTER DELETE triggers 
-#            on the same table, even if the triggers have different names / different 
+# Test case: Ensure that it is not possible to create multiple AFTER DELETE triggers
+#            on the same table, even if the triggers have different names / different
 #            triggered actions.
 let $message= Testcase 3.5.7.15/16:;
 --source include/show_msg.inc
 	
 	set @test_var=1;
-	Create trigger trg_3_406010_1 AFTER DELETE 
+	Create trigger trg_3_406010_1 AFTER DELETE
 		on tb3 for each row set @test_var=@test_var+5;
 
-	--error 1359 
-	Create trigger trg_3_406010_2 AFTER DELETE 
+	--error ER_TRG_ALREADY_EXISTS
+	Create trigger trg_3_406010_2 AFTER DELETE
 		on tb3 for each row set @test_var=@test_var+50;
 
-	--error 1359 
-	Create trigger trg_3_406010_1 AFTER INSERT 
+	--error ER_TRG_ALREADY_EXISTS
+	Create trigger trg_3_406010_1 AFTER INSERT
 		on tb3 for each row set @test_var=@test_var+1;
 
 	select @test_var;
@@ -1586,18 +1586,18 @@ let $message= Testcase 3.5.7.15/16:;
 	select @test_var;
 
 #Cleanup
-	--disable_warnings 
+	--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
 
 
 #Section 3.5.7.17
-# Test case: Ensure that it is possible to have a BEFORE INSERT, an AFTER INSERT, 
-#            a BEFORE UPDATE, an AFTER UPDATE, a BEFORE DELETE, and an AFTER DELETE 
-#            trigger on the same table; that is, ensure that every persistent base 
+# Test case: Ensure that it is possible to have a BEFORE INSERT, an AFTER INSERT,
+#            a BEFORE UPDATE, an AFTER UPDATE, a BEFORE DELETE, and an AFTER DELETE
+#            trigger on the same table; that is, ensure that every persistent base
 #            table may be the subject table for exactly six triggers
 let $message= Testcase 3.5.7.17 (see Testcase 3.5.1.1);
 --source include/show_msg.inc
@@ -1609,21 +1609,21 @@ let $message= Testcase 3.5.7.17 (see Tes
 #################################
 
 #Section 3.5.8.1
-# Testcase: Ensure that the triggered action of every trigger always executes 
+# Testcase: Ensure that the triggered action of every trigger always executes
 #           correctly and the results in all expected changes made to the database
 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 
+# Testcase: Ensure that the triggered actions of every trigger never results
 #           in an unexpected change made to the database.
 let $message= Testcase 3.5.8.2: (implied in previous tests);
 --source include/show_msg.inc
 
 
 #Section 3.5.8.3 / 3.5.8.4
-#Test case: Ensure that the triggered action can any valid SQL statement / set 
+#Test case: Ensure that the triggered action can any valid SQL statement / set
 #           of valid SQL statements, provided the statements are written within
 #           a BEGIN/END compound statement construct
 # OBN - At this point the tests focuses on the the INSERT/UPDATE/DELETE SQL statements
@@ -1637,17 +1637,17 @@ let $message= Testcase 3.5.8.3/4:;
 	grant SELECT, INSERT, UPDATE, DELETE on db_test.* to test_general;
 	grant LOCK TABLES on db_test.* to test_general;
 	Use db_test;
-	eval create table t1_i ( 
+	eval create table t1_i (
 		i120 char ascii not null DEFAULT b'101',
 		i136 smallint zerofill not null DEFAULT 999,
 		i144 int zerofill not null DEFAULT 99999,
 		i163 decimal (63,30)) engine=$engine_type;
-	eval create table t1_u ( 
+	eval create table t1_u (
 		u120 char ascii not null DEFAULT b'101',
 		u136 smallint zerofill not null DEFAULT 999,
 		u144 int zerofill not null DEFAULT 99999,
 		u163 decimal (63,30)) engine=$engine_type;
-	eval create table t1_d ( 
+	eval create table t1_d (
 		d120 char ascii not null DEFAULT b'101',
 		d136 smallint zerofill not null DEFAULT 999,
 		d144 int zerofill not null DEFAULT 99999,
@@ -1672,22 +1672,22 @@ let $message= 3.5.8.4 - multiple SQL;
 	delimiter //;
 	Create trigger trg1 AFTER INSERT on tb3 for each row
 	BEGIN
-		insert into db_test.t1_i 
+		insert into db_test.t1_i
 			values (new.f120, new.f136, new.f144, new.f163);
-		update db_test.t1_u 
+		update db_test.t1_u
 			set u144=new.f144, u163=new.f163
-			where u136=new.f136; 
+			where u136=new.f136;
 		delete from db_test.t1_d where d136= new.f136;
-		select sum(db_test.t1_u.u163) into @test_var from db_test.t1_u 
-			where u136= new.f136; 
-	END// 
+		select sum(db_test.t1_u.u163) into @test_var from db_test.t1_u
+			where u136= new.f136;
+	END//
 	delimiter ;//
 
 # Test trigger execution - multiple SQL
 	connection con_general;
 	Use test;
 	set @test_var=0;
-	Insert into tb3 (f120, f122, f136, f144, f163) 
+	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';
 	select * from db_test.t1_i;
@@ -1701,7 +1701,7 @@ let $message= 3.5.8.4 - single SQL - ins
 # Trigger definition - single SQL Insert
 	connection con_super;
 	Create trigger trg2 BEFORE UPDATE on tb3 for each row
-		insert into db_test.t1_i 
+		insert into db_test.t1_i
 			values (new.f120, new.f136, new.f144, new.f163);
 
 # Trigger exeution - single SQL Insert
@@ -1718,9 +1718,9 @@ let $message= 3.5.8.4 - single SQL - upd
 	connection con_super;
 	drop trigger trg2;
 	Create trigger trg3 BEFORE UPDATE on tb3 for each row
-		update db_test.t1_u 
+		update db_test.t1_u
 			set u120=new.f120
-			where u136=new.f136; 
+			where u136=new.f136;
 
 # Trigger exeution - single SQL  - update;
 	connection con_general;
@@ -1741,7 +1741,7 @@ let $message= 3.5.8.3/4 - single SQL - d
 # Trigger exeution - single SQL delete
 	connection con_general;
 #lock tables tb3 write, db_test.t1_i write, db_test.t1_u write, db_test.t1_d write;
-	update tb3 set f120='D', f136=444, 
+	update tb3 set f120='D', f136=444,
 		f122='Test 3.5.8.4-Single Delete'
 		 where f122='Test 3.5.8.4-Single Update';
 #unlock tables;
@@ -1755,13 +1755,13 @@ let $message= 3.5.8.3/4 - single SQL - s
 	connection con_super;
 	drop trigger trg4;
 	Create trigger trg5 AFTER UPDATE on tb3 for each row
-		select sum(db_test.t1_u.u163) into @test_var from db_test.t1_u 
-			where u136= new.f136; 
+		select sum(db_test.t1_u.u163) into @test_var from db_test.t1_u
+			where u136= new.f136;
 
 # Trigger exeution - single SQL select
 	connection con_general;
 	set @test_var=0;
-	update tb3 set f120='S', f136=111, 
+	update tb3 set f120='S', f136=111,
 		f122='Test 3.5.8.4-Single Select'
 		 where f122='Test 3.5.8.4-Single Delete';
 	Select f120, f122, f136, f144, f163 from tb3 where f122 like 'Test 3.5.8.4%';
@@ -1769,7 +1769,7 @@ let $message= 3.5.8.3/4 - single SQL - s
 
 #Cleanup
 	connection default;
-	--disable_warnings 
+	--disable_warnings
 	drop trigger trg1;
 	drop trigger trg5;
 	drop database if exists db_test;
@@ -1779,8 +1779,8 @@ let $message= 3.5.8.3/4 - single SQL - s
 
 
 #Section 3.5.8.5 (IF)
-# Test case: Ensure that the stored procedure-specific flow control statement like IF 
-#            works correctly when it is a part of the triggered action portion of a 
+# Test case: Ensure that the stored procedure-specific flow control statement like IF
+#            works correctly when it is a part of the triggered action portion of a
 #            trigger definition.
 let $message= Testcase 3.5.8.5 (IF):;
 --source include/show_msg.inc
@@ -1798,7 +1798,7 @@ let $message= Testcase 3.5.8.5 (IF):;
 
 		IF (new.f120='4') and (new.f136=10) then
 			set @test_var2='2nd if', new.f120='d';
-		ELSE 
+		ELSE
 			set @test_var2='2nd else', new.f120='D';
 		END IF;
 	END//
@@ -1806,50 +1806,50 @@ 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 
+	select f120, f122, f136, @test_var, @test_var2
 		from tb3 where f122 = 'Test 3.5.8.5-if';
 	Insert into tb3 (f120, f122, f136) values ('2', 'Test 3.5.8.5-if', 102);
-	select f120, f122, f136, @test_var, @test_var2 
+	select f120, f122, f136, @test_var, @test_var2
 		from tb3 where f122 = 'Test 3.5.8.5-if';
 	Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 10);
-	select f120, f122, f136, @test_var, @test_var2 
+	select f120, f122, f136, @test_var, @test_var2
 		from tb3 where f122 = 'Test 3.5.8.5-if';
 	Insert into tb3 (f120, f122, f136) values ('3', 'Test 3.5.8.5-if', 103);
-	select f120, f122, f136, @test_var, @test_var2 
+	select f120, f122, f136, @test_var, @test_var2
 		from tb3 where f122 = 'Test 3.5.8.5-if';
 
 	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
 			set @test_var2='2nd if', new.f120='d';
-		ELSE 
+		ELSE
 			set @test_var2='2nd else', new.f120='D';
 	END//
 	delimiter ;//
-	--error 0, 1360
+	--error 0, ER_TRG_DOES_NOT_EXIST
 	drop trigger trg4;
 
 #Cleanup
-	--disable_warnings 
+	--disable_warnings
 	drop trigger trg2;
 	delete from tb3 where f121='Test 3.5.8.5-if';	
 	--enable_warnings
 
 
 #Section 3.5.8.5 (CASE)
-# Test case: Ensure that the stored procedure-specific flow control statement 
-#            like CASE works correctly when it is a part of the triggered action 
+# Test case: Ensure that the stored procedure-specific flow control statement
+#            like CASE works correctly when it is a part of the triggered action
 #            portion of a trigger definition.
 let $message= Testcase 3.5.8.5-case:;
 --source include/show_msg.inc
@@ -1889,34 +1889,34 @@ let $message= Testcase 3.5.8.5-case:;
 	delimiter ;//
 
 	set @test_var='Empty';
-	Insert into tb3 (f120, f122, f136, f144) 
+	Insert into tb3 (f120, f122, f136, f144)
 		values ('a', 'Test 3.5.8.5-case', 5, 7);
-	select f120, f122, f136, f144, @test_var 
+	select f120, f122, f136, f144, @test_var
 		from tb3 where f122 = 'Test 3.5.8.5-case';
-	Insert into tb3 (f120, f122, f136, f144) 
+	Insert into tb3 (f120, f122, f136, f144)
 		values ('b', 'Test 3.5.8.5-case', 71,16);
-	select f120, f122, f136, f144, @test_var 
+	select f120, f122, f136, f144, @test_var
 		from tb3 where f122 = 'Test 3.5.8.5-case';
-	Insert into tb3 (f120, f122, f136, f144) 
+	Insert into tb3 (f120, f122, f136, f144)
 		values ('c', 'Test 3.5.8.5-case', 80,1);
-	select f120, f122, f136, f144, @test_var 
+	select f120, f122, f136, f144, @test_var
 		from tb3 where f122 = 'Test 3.5.8.5-case';
-	Insert into tb3 (f120, f122, f136) 
+	Insert into tb3 (f120, f122, f136)
 		values ('d', 'Test 3.5.8.5-case', 152);
-	select f120, f122, f136, f144, @test_var 
+	select f120, f122, f136, f144, @test_var
 		from tb3 where f122 = 'Test 3.5.8.5-case';
-	Insert into tb3 (f120, f122, f136, f144) 
+	Insert into tb3 (f120, f122, f136, f144)
 		values ('e', 'Test 3.5.8.5-case', 200, 8);
-	select f120, f122, f136, f144, @test_var 
+	select f120, f122, f136, f144, @test_var
 		from tb3 where f122 = 'Test 3.5.8.5-case';
-	--error 0, 1339
-	Insert into tb3 (f120, f122, f136, f144) 
+	--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 
+	select f120, f122, f136, f144, @test_var
 		from tb3 where f122 = 'Test 3.5.8.5-case';
 
 	delimiter //;
-	--error 1064
+	--error ER_PARSE_ERROR
 	create trigger trg3a before update on tb3 for each row
 	BEGIN
 		CASE
@@ -1924,11 +1924,11 @@ let $message= Testcase 3.5.8.5-case:;
 	END//
 	delimiter ;//
 
-	--error 0, 1360
+	--error 0, ER_TRG_DOES_NOT_EXIST
 	drop trigger trg3a;
 
 #Cleanup
-	--disable_warnings 
+	--disable_warnings
 	drop trigger trg3;
 	delete from tb3 where f121='Test 3.5.8.5-case';	
 	--enable_warnings
@@ -1942,53 +1942,53 @@ let $message= Testcase 3.5.8.5-loop/leav
 		
 	delimiter //;
 	Create trigger trg4 after insert on tb3 for each row
-	BEGIN 
+	BEGIN
 		set @counter=0, @flag='Initial';
-		Label1: loop 
+		Label1: loop
 			if new.f136<new.f144 then
 				set @counter='Nothing to loop';
-				leave Label1; 
+				leave Label1;
 			else
 				set @counter=@counter+1;
 				if new.f136=new.f144+@counter then
 					set @counter=concat(@counter, ' loops');
 					leave Label1;
-				end if; 
-			end if; 
-			iterate label1; 
+				end if;
+			end if;
+			iterate label1;
 			set @flag='Final';
-		END loop Label1; 
+		END loop Label1;
 	END//
 	delimiter ;//
-	Insert into tb3 (f122, f136, f144) 
+	Insert into tb3 (f122, f136, f144)
 		values ('Test 3.5.8.5-loop', 2, 8);
 		select @counter, @flag;
-	Insert into tb3 (f122, f136, f144) 
+	Insert into tb3 (f122, f136, f144)
 		values ('Test 3.5.8.5-loop', 11, 8);
 		select @counter, @flag;
 
 
 	delimiter //;
 
-	--error 1064
+	--error ER_PARSE_ERROR
 	Create trigger trg4_2 after update on tb3 for each row
-	BEGIN 
-		Label1: loop 
+	BEGIN
+		Label1: loop
 			set @counter=@counter+1;
-		END;  
+		END;
 	END//
 	delimiter ;//
-	--error 0, 1360
+	--error 0, ER_TRG_DOES_NOT_EXIST
 	drop trigger trg4_2;
 
 #Cleanup
-	--disable_warnings 
+	--disable_warnings
 	drop trigger trg4;
 	delete from tb3 where f122='Test 3.5.8.5-loop';
 	--enable_warnings
 
 #Section 3.5.8.5 (REPEAT ITERATE)
-#Testcase: Ensure that the stored procedure-specific flow control statements 
+#Testcase: Ensure that the stored procedure-specific flow control statements
 #          like REPEAT work correctly when they are part of the triggered action
 #          portion of a trigger definition.
 let $message= Testcase 3.5.8.5-repeat:;
@@ -1997,91 +1997,91 @@ let $message= Testcase 3.5.8.5-repeat:;
 	delimiter //;
 	Create trigger trg6 after insert on tb3 for each row
 	BEGIN
-		rp_label: REPEAT 
-			SET @counter1 = @counter1 + 1; 
+		rp_label: REPEAT
+			SET @counter1 = @counter1 + 1;
 			IF (@counter1 MOD 2 = 0) THEN ITERATE rp_label; 	
 			END IF;
-			SET @counter2 = @counter2 + 1; 
+			SET @counter2 = @counter2 + 1;
 		UNTIL @counter1> new.f136 END REPEAT rp_label;
 	END//
 	delimiter ;//
 
 	set @counter1= 0, @counter2= 0;
-	Insert into tb3 (f122, f136) 
+	Insert into tb3 (f122, f136)
 		values ('Test 3.5.8.5-repeat', 13);
 	select @counter1, @counter2;
 
 			
 	delimiter //;
-	--error 1064 
+	--error ER_PARSE_ERROR
 	Create trigger trg6_2 after update on tb3 for each row
 	BEGIN
-		REPEAT 
-			SET @counter2 = @counter2 + 1; 
+		REPEAT
+			SET @counter2 = @counter2 + 1;
 	END//
 	delimiter ;//
 
 #Cleanup			
-	--disable_warnings 
+	--disable_warnings
 	drop trigger trg6;
 	delete from tb3 where f122='Test 3.5.8.5-repeat';
 	--enable_warnings
 
 
 #Section 3.5.8.5 (WHILE)
-# Test case: Ensure that the stored procedure-specific flow control 
-#            statements WHILE, work correctly when they are part of 
+# Test case: Ensure that the stored procedure-specific flow control
+#            statements WHILE, work correctly when they are part of
 #            the triggered action portion of a trigger definition.
 let $message= Testcase 3.5.8.5-while:;
 --source include/show_msg.inc
 
 	delimiter //;
 	Create trigger trg7 after insert on tb3 for each row
-		wl_label: WHILE @counter1 < new.f136 DO 
-			SET @counter1 = @counter1 + 1; 
+		wl_label: WHILE @counter1 < new.f136 DO
+			SET @counter1 = @counter1 + 1;
 			IF (@counter1 MOD 2 = 0) THEN ITERATE wl_label; 	
 			END IF;
-			SET @counter2 = @counter2 + 1; 
+			SET @counter2 = @counter2 + 1;
 		END WHILE wl_label//
 	delimiter ;//
 
 	set @counter1= 0, @counter2= 0;
-	Insert into tb3 (f122, f136) 
+	Insert into tb3 (f122, f136)
 		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 
-			SET @counter1 = @counter1 + 1; 
+		WHILE @counter1 < new.f136
+			SET @counter1 = @counter1 + 1;
 	END//
 	delimiter ;//
 
 #Cleanup
-	--disable_warnings 
+	--disable_warnings
 	delete from tb3 where f122='Test 3.5.8.5-while';
 	drop trigger trg7;
 	--enable_warnings
 
 #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 
+# 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 
+# OBN - requirement void since allowed
 let $message= Testcase 3.5.8.6: (requirement void since allowed)
 --source include/show_msg.inc
 
 
 #Section 3.5.8.7
-# Test case: Ensure that a trigger definition that includes a 
-#            transaction-delimiting statement (e.g. COMMIT, 
-#            ROLLBACK, START TRANSACTION) fails, at CREATE TRIGGER 
+# Test case: Ensure that a trigger definition that includes a
+#            transaction-delimiting statement (e.g. COMMIT,
+#            ROLLBACK, START TRANSACTION) fails, at CREATE TRIGGER
 #            time, with an appropriate error message.
 let $message= Testcase 3.5.8.7;
 --source include/show_msg.inc
 
-#	--error 1314
+#	--error ER_SP_BADSTATEMENT
 #	Create trigger trg9_1 before update on tb3 for each row
 #	BEGIN
 #		Start transaction;
@@ -2089,7 +2089,7 @@ let $message= Testcase 3.5.8.7;
 #		Commit;
 #	END;
 
-#	--error 1314
+#	--error ER_SP_BADSTATEMENT
 #	Create trigger trg9_2 before delete on tb3 for each row
 #	BEGIN
 #		Start transaction;
@@ -2103,15 +2103,15 @@ let $message= Testcase 3.5.8.7;
 #################################
 
 #Section 3.5.9.1
-#Test case: Ensure that every trigger executes its triggered action on each row 
+#Test case: Ensure that every trigger executes its triggered action on each row
 #           that meets the conditions stated in the trigger definition.
 #Section 3.5.9.2
-#Testcase: Ensure that a trigger never executes its triggered action on any row 
+#Testcase: Ensure that a trigger never executes its triggered action on any row
 #          that doesn't meet the conditions stated in the trigger definition.
 let $message= Testcase 3.5.9.1/2:;
 --source include/show_msg.inc
 
-	Create trigger trg1 BEFORE UPDATE on tb3 for each row 
+	Create trigger trg1 BEFORE UPDATE on tb3 for each row
 		set new.f142 = 94087, @counter=@counter+1;
 --disable_query_log
 	select count(*) as TotalRows from tb3;
@@ -2121,22 +2121,22 @@ let $message= Testcase 3.5.9.1/2:;
 --enable_query_log
 	set @counter=0;
 	Update tb3 Set f142='1' where f130<100;
-	select count(*) as ExpectedChanged, @counter as TrigCounter 
+	select count(*) as ExpectedChanged, @counter as TrigCounter
 		from tb3 where f142=94087;
-	select count(*) as ExpectedNotChange from tb3 
+	select count(*) as ExpectedNotChange from tb3
 		where f130<100 and f142<>94087;
-	select count(*) as NonExpectedChanged from tb3 
+	select count(*) as NonExpectedChanged from tb3
 		where f130>=130 and f142=94087;
 
 #Cleanup
-	--disable_warnings 
+	--disable_warnings
 	drop trigger trg1;
 	--enable_warnings
 
 
 #Section 3.5.9.3
-#Test case: Ensure that a reference to OLD.<column name> always correctly refers 
-#           to the values of the specified column of the subject table before a 
+#Test case: Ensure that a reference to OLD.<column name> always correctly refers
+#           to the values of the specified column of the subject table before a
 #           data row is updated or deleted.
 let $message= Testcase 3.5.9.3:;
 --source include/show_msg.inc
@@ -2163,46 +2163,46 @@ let $message= Testcase 3.5.9.3:;
 
 
 --disable_query_log
-	set @tr_var_b4_118=0, @tr_var_b4_121=0, @tr_var_b4_122=0, 
+	set @tr_var_b4_118=0, @tr_var_b4_121=0, @tr_var_b4_122=0,
 		@tr_var_b4_136=0, @tr_var_b4_163=0;
-	set @tr_var_af_118=0, @tr_var_af_121=0, @tr_var_af_122=0, 
+	set @tr_var_af_118=0, @tr_var_af_121=0, @tr_var_af_122=0,
 		@tr_var_af_136=0, @tr_var_af_163=0;
-	select  @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122, 
+	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, 
+	select  @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
 		@tr_var_af_136, @tr_var_af_163;
 --enable_query_log
 
-	Insert into tb3 (f122, f136, f163) 
+	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  @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122, 
+	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, 
+	select  @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
 		@tr_var_af_136, @tr_var_af_163;
 
 --disable_query_log
-	set @tr_var_b4_118=0, @tr_var_b4_121=0, @tr_var_b4_122=0, 
+	set @tr_var_b4_118=0, @tr_var_b4_121=0, @tr_var_b4_122=0,
 		@tr_var_b4_136=0, @tr_var_b4_163=0;
-	set @tr_var_af_118=0, @tr_var_af_121=0, @tr_var_af_122=0, 
+	set @tr_var_af_118=0, @tr_var_af_121=0, @tr_var_af_122=0,
 		@tr_var_af_136=0, @tr_var_af_163=0;
-	select  @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122, 
+	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, 
+	select  @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
 		@tr_var_af_136, @tr_var_af_163;
 --enable_query_log
 
 	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  @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122, 
+	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, 
+	select  @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
 		@tr_var_af_136, @tr_var_af_163;
 #Cleanup
-	--disable_warnings 
+	--disable_warnings
 	drop trigger trg2_a;
 	drop trigger trg2_b;
 	drop trigger trg2_c;
@@ -2210,8 +2210,8 @@ let $message= Testcase 3.5.9.3:;
 	--enable_warnings
 
 #Section 3.5.9.4
-#Test case: Ensure that a reference to NEW.<column name> always correctly refers 
-#           to the values of the specified column of the subject table after an 
+#Test case: Ensure that a reference to NEW.<column name> always correctly refers
+#           to the values of the specified column of the subject table after an
 #           existing data row has been updated or a new data row has been inserted.
 let $message= Testcase 3.5.9.4:;
 --source include/show_msg.inc
@@ -2237,48 +2237,48 @@ let $message= Testcase 3.5.9.4:;
 		    @tr_var_af_151=new.f151, @tr_var_af_163=new.f163;
 
 --disable_query_log
-	set @tr_var_b4_118=0, @tr_var_b4_121=0, @tr_var_b4_122=0, 
+	set @tr_var_b4_118=0, @tr_var_b4_121=0, @tr_var_b4_122=0,
 		@tr_var_b4_136=0, @tr_var_b4_151=0, @tr_var_b4_163=0;
-	set @tr_var_af_118=0, @tr_var_af_121=0, @tr_var_af_122=0, 
+	set @tr_var_af_118=0, @tr_var_af_121=0, @tr_var_af_122=0,
 		@tr_var_af_136=0, @tr_var_af_151=0, @tr_var_af_163=0;
-	select  @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122, 
+	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, 
+	select  @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
 		@tr_var_af_136, @tr_var_af_151, @tr_var_af_163;
 --enable_query_log
 
-	Insert into tb3 (f122, f136, f151, f163) 
+	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 
+	select f118, f121, f122, f136, f151, f163 from tb3
 		where f122 like 'Test 3.5.9.4%';
-	select  @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122, 
+	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, 
+	select  @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
 		@tr_var_af_136, @tr_var_af_151, @tr_var_af_163;
 
 --disable_query_log
-	set @tr_var_b4_118=0, @tr_var_b4_121=0, @tr_var_b4_122=0, 
+	set @tr_var_b4_118=0, @tr_var_b4_121=0, @tr_var_b4_122=0,
 		@tr_var_b4_136=0, @tr_var_b4_151=0, @tr_var_b4_163=0;
-	set @tr_var_af_118=0, @tr_var_af_121=0, @tr_var_af_122=0, 
+	set @tr_var_af_118=0, @tr_var_af_121=0, @tr_var_af_122=0,
 		@tr_var_af_136=0, @tr_var_af_151=0, @tr_var_af_163=0;
-	select  @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122, 
+	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, 
+	select  @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
 		@tr_var_af_136, @tr_var_af_151, @tr_var_af_163;
 --enable_query_log
 
 	Update tb3 Set f122='Test 3.5.9.4-trig', f136=NULL, f151=DEFAULT, f163=NULL
 		 where f122='Test 3.5.9.4';
 
-	select f118, f121, f122, f136, f151, f163 from tb3 
+	select f118, f121, f122, f136, f151, f163 from tb3
 		where f122 like 'Test 3.5.9.4-trig';
-	select  @tr_var_b4_118, @tr_var_b4_121, @tr_var_b4_122, 
+	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, 
+	select  @tr_var_af_118, @tr_var_af_121, @tr_var_af_122,
 		@tr_var_af_136, @tr_var_af_151, @tr_var_af_163;
 #Cleanup
-	--disable_warnings 
+	--disable_warnings
 	drop trigger trg3_a;
 	drop trigger trg3_b;
 	drop trigger trg3_c;
@@ -2288,119 +2288,119 @@ let $message= Testcase 3.5.9.4:;
 
 
 #Section 3.5.9.5
-# Test case: Ensure that the definition of an INSERT trigger can include a 
+# Test case: Ensure that the definition of an INSERT trigger can include a
 #            reference to NEW. <Column name>.
 let $message= Testcase 3.5.9.5: (implied in previous tests);
 --source include/show_msg.inc
 	
 #Section 3.5.9.6
-# Test case: Ensure that the definition of an INSERT trigger cannot include 
+# Test case: Ensure that the definition of an INSERT trigger cannot include
 #            a reference to OLD. <Column name>.
 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
+	--disable_warnings
+	--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
 
 
 #Section 3.5.9.7
-# Test case: Ensure that the definition of an UPDATE trigger can include a 
+# Test case: Ensure that the definition of an UPDATE trigger can include a
 #            reference to NEW. <Column name>.
 let $message= Testcase 3.5.9.7: (implied in previous tests);
 --source include/show_msg.inc
 	
 #Section 3.5.9.8
-# Test case: Ensure that the definition of an UPDATE trigger cannot include a 
+# Test case: Ensure that the definition of an UPDATE trigger cannot include a
 #            reference to OLD. <Column name>.
 let $message= Testcase 3.5.9.8: (implied in previous tests);
 --source include/show_msg.inc
 	
 #Section 3.5.9.9
-# Test case: Ensure that the definition of a DELETE trigger cannot include a 
+# Test case: Ensure that the definition of a DELETE trigger cannot include a
 #            reference to NEW.<column name>.
 let $message= Testcase 3.5.9.9:;
 --source include/show_msg.inc
 	
-	--error 1362
+	--error ER_TRG_CANT_CHANGE_ROW
 	create trigger trg5a before DELETE on tb3 for each row
 		set @temp1=new.f122;
-	--error 1362
+	--error ER_TRG_CANT_CHANGE_ROW
 	create trigger trg5b after DELETE on tb3 for each row
 		set new.f122='test';
 
 #Cleanup
-	--disable_warnings 
-	--error 0, 1360
+	--disable_warnings
+	--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
 
 
 #Section 3.5.9.10
-# Test case: Ensure that the definition of a DELETE trigger can include a reference 
+# Test case: Ensure that the definition of a DELETE trigger can include a reference
 #            to OLD.<column name>.
 let $message= Testcase 3.5.9.10: (implied in previous tests);
 --source include/show_msg.inc
 	
 
 #Section 3.5.9.11
-# Testcase: Ensure that trigger definition that includes a referance to 
-#           NEW.<colunm name> fails with an appropriate error message, 
+# Testcase: Ensure that trigger definition that includes a referance to
+#           NEW.<colunm name> fails with an appropriate error message,
 #           at CREATE TRIGGER time, if the trigger event in not INSERT or UPDATE
 let $message= Testcase 3.5.9.11: covered by 3.5.9.9;
 --source include/show_msg.inc
 
 
 #Section 3.5.9.12
-# Testcase: Ensure that trigger definition that includes a referance to 
-#           OLD.<column name> fails with an appropriate error message, at 
+# Testcase: Ensure that trigger definition that includes a referance to
+#           OLD.<column name> fails with an appropriate error message, at
 #           CREATE TRIGGER time, if the trigger event is not DELETE or UPDATE
 let $message= Testcase 3.5.9.12: covered by 3.5.9.6;
 --source include/show_msg.inc
 
 
 #Section 3.5.9.13
-# Test case: Ensure that all references to OLD. <Column name> are read-only, 
+# Test case: Ensure that all references to OLD. <Column name> are read-only,
 #            that is, that they cannot be used to modify a data row.
 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
+	--disable_warnings
+	--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
 
 
 #Section 3.5.9.14
-# Test case: Ensure that all references to NEW. <Column name> may be used both to 
+# Test case: Ensure that all references to NEW. <Column name> may be used both to
 #            read a data row and to modify a data row
 let $message= Testcase 3.5.9.14: (implied in previous tests);
 --source include/show_msg.inc
@@ -2411,51 +2411,51 @@ let $message= Testcase 3.5.9.14: (implie
 # Check on Trigger Activation
 ##############################################
 #Section 3.5.10.1
-# Test case: Ensure that every trigger that should be activated by 
-#            every possible type of implicit insertion into its subject 
-#            table (INSERT into a view based on the subject table) is 
+# Test case: Ensure that every trigger that should be activated by
+#            every possible type of implicit insertion into its subject
+#            table (INSERT into a view based on the subject table) is
 #            indeed activated correctly
 #Section 3.5.10.2
-# Test case: Ensure that every trigger that should be activated by every 
-#            possible type of implicit insertion into its subject table 
-#            (UPDATE into a view based on the subject table) is indeed 
+# Test case: Ensure that every trigger that should be activated by every
+#            possible type of implicit insertion into its subject table
+#            (UPDATE into a view based on the subject table) is indeed
 #            activated correctly
 #Section 3.5.10.3
-# Test case: Ensure that every trigger that should be activated by every 
-#            possible type of implicit insertion into its subject table 
-#            (DELETE from a view based on the subject table) is indeed 
+# Test case: Ensure that every trigger that should be activated by every
+#            possible type of implicit insertion into its subject table
+#            (DELETE from a view based on the subject table) is indeed
 #            activated correctly
 let $message= Testcase 3.5.10.1/2/3:;
 --source include/show_msg.inc
 
 	Create view vw11 as select * from tb3
 		 where f122 like 'Test 3.5.10.1/2/3%';
-	Create trigger trg1a before insert on tb3 
+	Create trigger trg1a before insert on tb3
 		for each row set new.f163=111.11;
-	Create trigger trg1b after insert on tb3 
+	Create trigger trg1b after insert on tb3
 		for each row set @test_var='After Insert';
-	Create trigger trg1c before update on tb3 
+	Create trigger trg1c before update on tb3
 		for each row set new.f121='Y', new.f122='Test 3.5.10.1/2/3-Update';
-	Create trigger trg1d after update on tb3 
+	Create trigger trg1d after update on tb3
 		for each row set @test_var='After Update';
-	Create trigger trg1e before delete on tb3 
+	Create trigger trg1e before delete on tb3
 		for each row set @test_var=5;
-	Create trigger trg1f after delete on tb3 
+	Create trigger trg1f after delete on tb3
 		for each row set @test_var= 2* @test_var+7;
 
 #Section 3.5.10.1
 	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 
+	select f121, f122, f151, f163
 		from tb3 where f122 like 'Test 3.5.10.1/2/3%';
 	select f121, f122, f151, f163 from vw11;
-	select f121, f122, f151, f163 
+	select f121, f122, f151, f163
 		from tb3 where f122 like 'Not in View';
 
 #Section 3.5.10.2
 	Update vw11 set f163=1;
-	select f121, f122, f151, f163 from tb3 
+	select f121, f122, f151, f163 from tb3
 		where f122 like 'Test 3.5.10.1/2/3%';
 	select f121, f122, f151, f163 from vw11;
 
@@ -2463,33 +2463,33 @@ let $message= Testcase 3.5.10.1/2/3:;
 	set @test_var=0;
 	Select @test_var as 'before delete';
 	delete from vw11 where f151=1;
-	select f121, f122, f151, f163 from tb3 
+	select f121, f122, f151, f163 from tb3
 		where f122 like 'Test 3.5.10.1/2/3%';
 	select f121, f122, f151, f163 from vw11;
 	Select @test_var as 'after delete';
 
 #Cleanup
-	--disable_warnings 
+	--disable_warnings
 	drop view vw11;
-	drop trigger trg1a;  
-	drop trigger trg1b;  
-	drop trigger trg1c;  
-	drop trigger trg1d;  
-	drop trigger trg1e;  
-	drop trigger trg1f;  
+	drop trigger trg1a;
+	drop trigger trg1b;
+	drop trigger trg1c;
+	drop trigger trg1d;
+	drop trigger trg1e;
+	drop trigger trg1f;
 	delete from tb3 where f122 like 'Test 3.5.10.1/2/3%';
 	--enable_warnings
 
 
 #Section 3.5.10.4
-# Test case: Ensure that every trigger that should be activated by every 
-#            possible type of implicit insertion into its subject table 
+# Test case: Ensure that every trigger that should be activated by every
+#            possible type of implicit insertion into its subject table
 #            (LOAD into the subject table) is indeed activated correctly
 let $message= Testcase 3.5.10.4:;
 --source include/show_msg.inc
 	
 	eval create table tb_load (f1 int, f2 char(25),f3 int) engine=$engine_type;
-	Create trigger trg4 before insert on tb_load 
+	Create trigger trg4 before insert on tb_load
 		for each row set new.f3=-(new.f1 div 5), @counter= @counter+1;
 
         set @counter= 0;
@@ -2500,40 +2500,40 @@ let $message= Testcase 3.5.10.4:;
 	select @counter as 'Rows Loaded After';
 	Select * from tb_load limit 10;
 
-#Cleanup 
-	--disable_warnings 
+#Cleanup
+	--disable_warnings
 	drop trigger trg4;
 	drop table tb_load;
 	--enable_warnings
 
 
 #Section 3.5.10.5
-# Testcase: Ensure that every trigger that should be activated by every possible 
-#           type of implicit update of its subject table (e.g.a FOREIGN KEY SET 
-#           DEFAULT action or an UPDATE of a view based on the subject table) is 
+# Testcase: Ensure that every trigger that should be activated by every possible
+#           type of implicit update of its subject table (e.g.a FOREIGN KEY SET
+#           DEFAULT action or an UPDATE of a view based on the subject table) is
 #           indeed activated correctly
 let $message= Testcase 3.5.10.5: (implemented in trig_frkey.test);
 --source include/show_msg.inc
 
 
 #Section 3.5.10.6
-# Testcase: Ensure that every trigger that should be activated by every possible 
-#           type of implicit deletion from its subject table (e.g.a FOREIGN KEY 
-#           CASCADE action or a DELETE from a view based on the subject table) is 
+# Testcase: Ensure that every trigger that should be activated by every possible
+#           type of implicit deletion from its subject table (e.g.a FOREIGN KEY
+#           CASCADE action or a DELETE from a view based on the subject table) is
 #           indeed activated correctly
 let $message= Testcase 3.5.10.6: (implemented in trig_frkey.test);
 --source include/show_msg.inc
 
 #Section 3.5.10.extra
-# Testcase: Ensure that every trigger that should be activated by every possible 
+# Testcase: Ensure that every trigger that should be activated by every possible
 #           type of implicit deletion from its subject table (e.g. an action performed
 #           on the subject table from a stored procedure is indeed activated correctly
-let $message= Testcase 3.5.10.extra:; 
+let $message= Testcase 3.5.10.extra:;
 --source include/show_msg.inc
 
 	eval create table t1_sp (var136 tinyint, var151 decimal) engine=$engine_type;
 
-	create trigger trg before insert on t1_sp 
+	create trigger trg before insert on t1_sp
 		for each row set @counter=@counter+1;		
                 # declare continue handler for sqlstate '01000' set done = 1;
 
@@ -2547,7 +2547,7 @@ let $message= Testcase 3.5.10.extra:; 
                 declare continue handler for sqlstate '01000' set done = 1;
                 open cur1;
                 fetch cur1 into var136, var151;
-		wl_loop: WHILE NOT done DO 
+		wl_loop: WHILE NOT done DO
                         insert into t1_sp values (var136, var151);
                         fetch cur1 into var136, var151;
 		END WHILE wl_loop;
@@ -2557,14 +2557,14 @@ let $message= Testcase 3.5.10.extra:; 
 
 	set @counter=0;
 	select @counter;
-	--error 1329
+	--error ER_SP_CASE_NOT_FOUND
 	call trig_sp();
 	select @counter;
 	select count(*) from tb3;
 	select count(*) from t1_sp;
 
-#Cleanup 
-	--disable_warnings 
+#Cleanup
+	--disable_warnings
 	drop procedure trig_sp;
 	drop trigger trg;
 	drop table t1_sp;
@@ -2572,14 +2572,14 @@ let $message= Testcase 3.5.10.extra:; 
 
 ##################################
 ########## Section 3.5.11 ########
-# Check on Trigger Performance   # 
+# Check on Trigger Performance   #
 ##################################
 #Section 3.5.11.1
-# Testcase: Ensure that a set of complicated, interlocking triggers that are activated 
-#           by multiple trigger events on no fewer than 50 different tables with at least

-#           500,000 rows each, all work correctly, return the correct results, and have 
-#           the correct effects on the database. It is expected that the Services
Provider 
-#           will use its own skills and experience in database testing to devise tables
and 
+# Testcase: Ensure that a set of complicated, interlocking triggers that are activated
+#           by multiple trigger events on no fewer than 50 different tables with at least
+#           500,000 rows each, all work correctly, return the correct results, and have
+#           the correct effects on the database. It is expected that the Services
Provider
+#           will use its own skills and experience in database testing to devise tables
and
 #           triggers that fulfill this requirement.
 let $message= Testcase 3.5.11.1 (implemented in trig_perf.test);
 --source include/show_msg.inc
@@ -2591,7 +2591,7 @@ let $message= Testcase 3.5.11.1 (impleme
 	drop user test_super@localhost;
 
 ##########################################
-# Other Scenasrios (not in requirements) # 
+# Other Scenasrios (not in requirements) #
 ##########################################
 # Testcase: y.y.y.2:
 # Checking for triggers starting triggers (no direct requirement)
@@ -2617,7 +2617,7 @@ let $message= Testcase y.y.y.2: Check fo
 
 	insert into t1 values (1);
 	delimiter //;
-	create trigger tr1 after insert on t1 for each row 
+	create trigger tr1 after insert on t1 for each row
 	BEGIN
 		insert into t2_1 (f1) values (new.f1+1);
 		insert into t2_2 (f1) values (new.f1+1);
@@ -2626,13 +2626,13 @@ let $message= Testcase y.y.y.2: Check fo
 	END//
 	delimiter ;//
 
-	create trigger tr2_1 after insert on t2_1 for each row 
+	create trigger tr2_1 after insert on t2_1 for each row
 		insert into t3 (f1) values (new.f1+10);
-	create trigger tr2_2 after insert on t2_2 for each row 
+	create trigger tr2_2 after insert on t2_2 for each row
 		insert into t3 (f1) values (new.f1+100);
-	create trigger tr2_3 after insert on t2_3 for each row 
+	create trigger tr2_3 after insert on t2_3 for each row
 		insert into t3 (f1) values (new.f1+1000);
-	create trigger tr2_4 after insert on t2_4 for each row 
+	create trigger tr2_4 after insert on t2_4 for each row
 		insert into t3 (f1) values (new.f1+10000);
 
 #lock tables t1 write, t2_1 write, t2_2 write, t2_3 write, t2_4 write, t3 write;
@@ -2640,51 +2640,51 @@ let $message= Testcase y.y.y.2: Check fo
 #unlock tables;
 	select * from t3;
 
-#Cleanup 
-	--disable_warnings 
+#Cleanup
+	--disable_warnings
 	drop trigger tr1;
 	drop trigger tr2_1;
 	drop trigger tr2_2;
 	drop trigger tr2_3;
 	drop trigger tr2_4;
 	drop table t1, t2_1, t2_2, t2_3, t2_4, t3;
-	--enable_warnings 
+	--enable_warnings
 
 # Testcase: y.y.y.3:
 # Checking for circular trigger definitions
 let $message= Testcase y.y.y.3: Circular trigger reference;
 --source include/show_msg.inc
 	use test;
-	--disable_warnings 
+	--disable_warnings
 	drop table if exists t1;
 	drop table if exists t2;
 	drop table if exists t3;
 	drop table if exists t4;
-	--enable_warnings 
+	--enable_warnings
 	eval create table t1 (f1 integer) engine = $engine_type;
 	eval create table t2 (f2 integer) engine = $engine_type;
 	eval create table t3 (f3 integer) engine = $engine_type;
 	eval create table t4 (f4 integer) engine = $engine_type;
 
 	insert into t1 values (0);
-	create trigger tr1 after insert on t1 
+	create trigger tr1 after insert on t1
 		for each row insert into t2 (f2) values (new.f1+1);
-	create trigger tr2 after insert on t2 
+	create trigger tr2 after insert on t2
 		for each row insert into t3 (f3) values (new.f2+1);
-	create trigger tr3 after insert on t3 
+	create trigger tr3 after insert on t3
 		for each row insert into t4 (f4) values (new.f3+1);
-	create trigger tr4 after insert on t4 
+	create trigger tr4 after insert on t4
 		for each row insert into t1 (f1) values (new.f4+1);
 
-	--error 1442
+	--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;
 
-#Cleanup 
-	--disable_warnings 
+#Cleanup
+	--disable_warnings
 	drop trigger tr1;
 	drop trigger tr2;
 	drop trigger tr3;
@@ -2693,7 +2693,7 @@ let $message= Testcase y.y.y.3: Circular
 	drop table t2;
 	drop table t3;
 	drop table t4;
-	--enable_warnings 
+	--enable_warnings
 
 
 #Section y.y.y.4
@@ -2703,8 +2703,8 @@ let $message= Testcase y.y.y.4: Recursiv
 
 set @sql_mode='traditional';
 	eval create table t1_sp (
-		count integer, 
-   		var136 tinyint, 
+		count integer,
+   		var136 tinyint,
 		var151 decimal) engine=$engine_type;
 	
 	delimiter //;
@@ -2718,7 +2718,7 @@ set @sql_mode='traditional';
 		set @counter= @counter+1;
                 open cur1;
                 fetch cur1 into var136, var151;
-		wl_loop: WHILE NOT done DO 
+		wl_loop: WHILE NOT done DO
                         insert into t1_sp values (@counter, var136, var151);
                         fetch cur1 into var136, var151;
 		END WHILE wl_loop;
@@ -2726,19 +2726,19 @@ set @sql_mode='traditional';
         end//
 	delimiter ;//
 
-	create trigger trg before insert on t1_sp 
-		for each row call trig_sp(); 
+	create trigger trg before insert on t1_sp
+		for each row call trig_sp();
 
 	set @counter=0;
 	select @counter;
-	--error 1424
+	--error ER_SP_NO_RECURSION
 	call trig_sp();
 	select @counter;
 	select count(*) from tb3;
 	select count(*) from t1_sp;
 
-#Cleanup 
-	--disable_warnings 
+#Cleanup
+	--disable_warnings
 	drop procedure trig_sp;
 	drop trigger trg;
 	drop table t1_sp;
@@ -2752,38 +2752,38 @@ let $message= Testcase y.y.y.5: Roleback
 	
 	set @@sql_mode='traditional';
 	use test;
-	--disable_warnings 
+	--disable_warnings
 	drop table if exists t1;
 	drop table if exists t2;
 	drop table if exists t3;
 	drop table if exists t4;
-	--enable_warnings 
+	--enable_warnings
 	eval create table t1 (f1 integer) engine = $engine_type;
 	eval create table t2 (f2 integer) engine = $engine_type;
 	eval create table t3 (f3 integer) engine = $engine_type;
 	eval create table t4 (f4 tinyint) engine = $engine_type;
 	show create table t1;
 	insert into t1 values (1);
-	create trigger tr1 after insert on t1 
+	create trigger tr1 after insert on t1
 		for each row insert into t2 (f2) values (new.f1+1);
-	create trigger tr2 after insert on t2 
+	create trigger tr2 after insert on t2
 		for each row insert into t3 (f3) values (new.f2+1);
-	create trigger tr3 after insert on t3 
+	create trigger tr3 after insert on t3
 		for each row insert into t4 (f4) values (new.f3+1000);
 
 #lock tables t1 write, t2 write, t3 write, t4 write;
 	
 	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;
 #unlock tables;
-#Cleanup 
-	--disable_warnings 
+#Cleanup
+	--disable_warnings
 	drop trigger tr1;
 	drop trigger tr2;
 	drop trigger tr3;
@@ -2791,5 +2791,5 @@ let $message= Testcase y.y.y.5: Roleback
 	drop table t2;
 	drop table t3;
 	drop table t4;
-	--enable_warnings 
+	--enable_warnings
 
diff -Nrup a/mysql-test/suite/funcs_1/views/func_view.inc
b/mysql-test/suite/funcs_1/views/func_view.inc
--- a/mysql-test/suite/funcs_1/views/func_view.inc	2007-11-27 17:40:13 +01:00
+++ b/mysql-test/suite/funcs_1/views/func_view.inc	2007-12-20 19:06:38 +01:00
@@ -40,7 +40,7 @@
 #       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.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.
 #
 #
@@ -580,6 +580,7 @@ let $col_type= my_bigint;
 eval INSERT INTO t1_values SET select_id = @select_id,
             $col_type = 1758;
 let $col_type= my_double;
+# 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;
@@ -619,6 +620,7 @@ 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
+# 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,
@@ -656,6 +658,7 @@ 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
+# 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;
@@ -693,6 +696,7 @@ let $col_type= my_decimal;
 let $message= some statements disabled because of
 Bug#5913 Traditional mode: BIGINT range not correctly delimited;
 --source include/show_msg80.inc
+# 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;
@@ -994,6 +998,8 @@ 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
+# 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;
 eval SET @my_select = 
 'SELECT LEFT(''AaBbCcDdEeFfGgHhIiJjÄäÜüÖö'', $col_type),
$col_type, id FROM t1_values';
@@ -1002,6 +1008,7 @@ 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
+# 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';
diff -Nrup a/mysql-test/suite/funcs_1/views/views_master.inc
b/mysql-test/suite/funcs_1/views/views_master.inc
--- a/mysql-test/suite/funcs_1/views/views_master.inc	2007-11-28 17:56:51 +01:00
+++ b/mysql-test/suite/funcs_1/views/views_master.inc	2007-12-20 19:06:38 +01:00
@@ -1042,7 +1042,7 @@ let $message= Testcase 3.3.1.22 ;
 --disable_warnings
 DROP VIEW  IF EXISTS v1;
 --enable_warnings
-CREATE VIEW test.v1( product ) AS SELECT f59*f60 From tb2 WHERE f59 < 3 LIMIT 2;
+CREATE VIEW test.v1( product ) AS SELECT f59*f60 From tb2 WHERE f59 < 3;
 --sorted_result
 SELECT * FROM test.v1;
 CREATE OR REPLACE VIEW test.v1( product ) AS SELECT 1*2;
@@ -1597,7 +1597,7 @@ let $message= Testcase 3.3.1.41 ;
 ###############################################################################
 # Testcase 3.3.1.41: Ensure that a view definition within a stored procedure
 #                    definition cannot include references to any of the stored
-#                    procedure’s parameters.
+#                    procedures parameters.
 ###############################################################################
 --disable_warnings
 Drop view if exists test.v1 ;
@@ -2004,7 +2004,10 @@ let $message= Testcase 3.3.1.49A ;
 #       The annoying redundant
 #       eval INSERT INTO t1_results VALUES (@v3_to_v1_options,@statement,
 #                                           @v3_to_v1_violation,$mysql_errno);
-#       could not be put into a file to be sourced because of 
+#       could not be put into a file to be sourced because of the closed 
+#       Bug#10267 mysqltest, wrong number of loops when a script is sourced
+#                 within a loop
+# To be implemented later.
 
 USE test;
 --disable_warnings
@@ -3117,7 +3120,7 @@ eval EXPLAIN SELECT CAST(f1 AS SIGNED IN
                    CAST(f2 AS CHAR) AS f2 FROM test1.v$toplevel;
 # 2.3.3 UCS2 string instead of common string
 CREATE OR REPLACE VIEW test3.v0 AS
-SELECT f1 ,
CONVERT('ßÄäÖöÜü§'
USING UCS2) as f2 FROM test1.t1;
+SELECT f1 , CONVERT('ßÄäÖöÜü§' USING UCS2) as f2
FROM test1.t1;
 eval SHOW CREATE VIEW test1.v$toplevel;
 eval SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
             CAST(f2 AS CHAR) AS f2 FROM test1.v$toplevel;
@@ -3126,7 +3129,7 @@ eval EXPLAIN SELECT CAST(f1 AS SIGNED IN
 
 # 2.3.4 UCS2 string instead of numeric
 CREATE OR REPLACE VIEW test3.v0 AS
-SELECT
CONVERT('ßÄäÖöÜü§'
USING UCS2) as f1, f2 FROM test1.t1;
+SELECT CONVERT('ßÄäÖöÜü§' USING UCS2) as f1, f2
FROM test1.t1;
 eval SHOW CREATE VIEW test1.v$toplevel;
 eval SELECT CAST(f1 AS SIGNED INTEGER) AS f1,
             CAST(f2 AS CHAR) AS f2 FROM test1.v$toplevel;
@@ -3882,6 +3885,7 @@ INSERT INTO v1 SET f1 = 0, f4x = 'ABC', 
 --error ER_VIEW_INVALID
 INSERT INTO v1 SET f1 = 0, report = 'v1 1b';
 DESCRIBE t1;
+# Bug#12533 crash on DESCRIBE <view> after renaming base table column;
 --error ER_VIEW_INVALID
 DESCRIBE v1;
 SELECT * FROM t1 order by f1, report;
Thread
bk commit into 5.1 tree (hhunger:1.2622)horst20 Dec