| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# This test script serves as the functionality testing for the |
| 4 |
# statement_digest() and statement_digest_text() functions in replication |
| 5 |
# environment |
| 6 |
# |
| 7 |
# ==== Related Worklog ==== |
| 8 |
# |
| 9 |
# WL#9637: SQL Function to return DIGEST of given SQL |
| 10 |
|
| 11 |
--source include/master-slave.inc |
| 12 |
|
| 13 |
--source include/rpl_connection_master.inc |
| 14 |
--echo # test for statement_digest() |
| 15 |
CREATE TABLE test.t1 (a VARCHAR(1000)); |
| 16 |
INSERT INTO test.t1 SELECT statement_digest("SELECT * FROM foo"); |
| 17 |
|
| 18 |
--echo # test for statement_digest_text() |
| 19 |
CREATE TABLE test.t2 (a VARCHAR(1000)); |
| 20 |
|
| 21 |
INSERT INTO test.t2 SELECT statement_digest_text("SELECT * FROM foo"); |
| 22 |
--source include/sync_slave_sql_with_master.inc |
| 23 |
|
| 24 |
--source include/rpl_connection_master.inc |
| 25 |
--let $diff_tables=master:test.t1,slave:test.t1 |
| 26 |
--source include/diff_tables.inc |
| 27 |
|
| 28 |
--let $diff_tables=master:test.t2,slave:test.t2 |
| 29 |
--source include/diff_tables.inc |
| 30 |
|
| 31 |
SELECT * FROM test.t1; |
| 32 |
# statement_digest_text() function adds an extra trailing space |
| 33 |
# to the query due to Bug#26908015. |
| 34 |
SELECT * FROM test.t2; |
| 35 |
|
| 36 |
--echo # Clean up |
| 37 |
DROP TABLE test.t1; |
| 38 |
DROP TABLE test.t2; |
| 39 |
--source include/sync_slave_sql_with_master.inc |
| 40 |
|
| 41 |
--source include/rpl_end.inc |