| 1 |
## Verify if X Plugin can transfer a large amount of warnings |
| 2 |
|
| 3 |
--source include/xplugin_preamble.inc |
| 4 |
--source include/xplugin_create_user.inc |
| 5 |
|
| 6 |
## Test starts here |
| 7 |
--write_file $MYSQL_TMP_DIR/testcase.xpl |
| 8 |
## Test data |
| 9 |
import assert_messages.macro; |
| 10 |
|
| 11 |
echo ## 1. Setup the test; |
| 12 |
echo ## 2. Trigger warnings; |
| 13 |
echo ## a. trigger small amount of warnings (2); |
| 14 |
echo ## b. trigger large amount of warnings (14998); |
| 15 |
|
| 16 |
|
| 17 |
echo; |
| 18 |
echo # Ad 1.; |
| 19 |
echo #; |
| 20 |
noquery_result; |
| 21 |
USE test; |
| 22 |
CREATE TABLE table_with_ints(i INTEGER); |
| 23 |
SET max_error_count=20000; |
| 24 |
|
| 25 |
-->varlet %FIELDS% |
| 26 |
-->repeat 4999 |
| 27 |
varlet %FIELDS% %FIELDS%i/0,i/'s',; |
| 28 |
-->endrepeat |
| 29 |
varlet %FIELDS% %FIELDS%i/0; |
| 30 |
|
| 31 |
|
| 32 |
echo; |
| 33 |
echo # Ad 2.a.; |
| 34 |
echo #; |
| 35 |
INSERT INTO table_with_ints(i) VALUES(1),(0),(1),(0); |
| 36 |
expectwarnings ER_DIVISION_BY_ZERO; |
| 37 |
SELECT 1/i FROM table_with_ints; |
| 38 |
|
| 39 |
callmacro Assert_received_messages Mysqlx.Notice.Warning 2; |
| 40 |
|
| 41 |
|
| 42 |
echo; |
| 43 |
echo # Ad 2.b.; |
| 44 |
echo #; |
| 45 |
DELETE FROM table_with_ints WHERE TRUE; |
| 46 |
INSERT INTO table_with_ints(i) VALUES(1); |
| 47 |
expectwarnings ER_TRUNCATED_WRONG_VALUE,ER_DIVISION_BY_ZERO; |
| 48 |
varsub %FIELDS%; |
| 49 |
SELECT %FIELDS% FROM table_with_ints; |
| 50 |
callmacro Assert_received_messages Mysqlx.Notice.Warning 15000; |
| 51 |
|
| 52 |
EOF |
| 53 |
|
| 54 |
--exec $MYSQLXTEST -ux_root --password='' --file=$MYSQL_TMP_DIR/testcase.xpl 2>&1 |
| 55 |
|
| 56 |
## Cleanup |
| 57 |
DROP TABLE table_with_ints; |
| 58 |
|
| 59 |
--source ../include/xplugin_cleanup.inc |