summaryrefslogtreecommitdiff
path: root/mysql-test/t/trigger-compat.test
diff options
context:
space:
mode:
authorPatrick Crews <patrick.crews@sun.com>2009-02-19 15:37:40 -0500
committerPatrick Crews <patrick.crews@sun.com>2009-02-19 15:37:40 -0500
commit79300d6f7fb5cd22b9d3c2d14b6eb443e2ae28ed (patch)
tree3c5612c250539e8247653a8c257cb8969d10d5bf /mysql-test/t/trigger-compat.test
parentddf6ac40ea0f3290c148b3009069a22f12ab6e70 (diff)
downloadmariadb-git-79300d6f7fb5cd22b9d3c2d14b6eb443e2ae28ed.tar.gz
Bug#38831: 11 test cases fail on Windows due to missing commands
Replaced Unix calls with mysql-test-run's built-in functions / SQL manipulation where possible. Replaced error codes with error names as well. Disabled two tests on Windows due to more complex Unix command usage See Bug#41307, Bug#41308
Diffstat (limited to 'mysql-test/t/trigger-compat.test')
-rw-r--r--mysql-test/t/trigger-compat.test24
1 files changed, 19 insertions, 5 deletions
diff --git a/mysql-test/t/trigger-compat.test b/mysql-test/t/trigger-compat.test
index f2e350cb161..db410ba2f18 100644
--- a/mysql-test/t/trigger-compat.test
+++ b/mysql-test/t/trigger-compat.test
@@ -50,9 +50,7 @@ GRANT CREATE ON mysqltest_db1.* TO mysqltest_dfn@localhost;
CREATE TABLE t1(num_value INT);
CREATE TABLE t2(user_str TEXT);
-CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1
- FOR EACH ROW
- INSERT INTO t2 VALUES(CURRENT_USER());
+CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1 FOR EACH ROW INSERT INTO t2 VALUES(CURRENT_USER());
#
# Remove definers from TRG file.
@@ -61,8 +59,24 @@ CREATE TRIGGER wl2818_trg1 BEFORE INSERT ON t1
--echo
--echo ---> patching t1.TRG...
---exec grep -v 'definers=' $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG > $MYSQLTEST_VARDIR/tmp/t1.TRG
---exec mv $MYSQLTEST_VARDIR/tmp/t1.TRG $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG
+# Here we remove definers. This is somewhat complex than the original test
+# Previously, the test only used grep -v 'definers=' t1.TRG, but grep is not
+# portable and we have to load the file into a table, exclude the definers line,
+# then load the data to an outfile to accomplish the same effect
+
+--disable_query_log
+--connection default
+CREATE TABLE patch (a blob);
+eval LOAD DATA LOCAL INFILE '$MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG' INTO TABLE patch;
+# remove original t1.TRG file so SELECT INTO OUTFILE won't fail
+--remove_file $MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG
+eval SELECT SUBSTRING_INDEX(a,'definers=',1) INTO OUTFILE
+ '$MYSQLTEST_VARDIR/master-data/mysqltest_db1/t1.TRG'
+FROM patch;
+DROP TABLE patch;
+--connection wl2818_definer_con
+--enable_query_log
+
#
# Create a new trigger.