|
| 1 | +# |
| 2 | +# WL#16949: A mysql command line option to disable all built-in commands |
| 3 | +# |
| 4 | +# FR1: --commands boolean option added |
| 5 | +1 |
| 6 | +1 |
| 7 | +2 |
| 8 | +2 |
| 9 | +3 |
| 10 | +3 |
| 11 | +4 |
| 12 | +4 |
| 13 | +5 |
| 14 | +5 |
| 15 | +6 |
| 16 | +6 |
| 17 | +# FR1.1: check the default value of --commands |
| 18 | +# test: must not fail |
| 19 | +include/assert_grep.inc [FR1.1: checking the default --commands value] |
| 20 | +include/assert_grep.inc [FR1.1: checking the updated --commands value] |
| 21 | +# FR1.2.1: help short disabled |
| 22 | +ERROR at line 1: Unknown command '\?'. |
| 23 | +# FR1.2.2: clear disabled |
| 24 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'clear' at line 1 |
| 25 | +# FR1.2.3: connect disabled |
| 26 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'connect' at line 1 |
| 27 | +# FR1.2.4: delimier enabled |
| 28 | +# FR1.2.5: edit disabled |
| 29 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'edit' at line 1 |
| 30 | +# FR1.2.6: ego disabled |
| 31 | +ERROR at line 1: Unknown command '\G'. |
| 32 | +# FR1.2.7: exit disabled |
| 33 | +1 |
| 34 | +1 |
| 35 | +ERROR 1064 (42000) at line 2: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'exit' at line 1 |
| 36 | +# FR1.2.8: go enabled |
| 37 | +go |
| 38 | +1 |
| 39 | +# FR1.2.9: help disabled |
| 40 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 |
| 41 | +# FR1.2.10: nopager disabled |
| 42 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'nopager' at line 1 |
| 43 | +# FR1.2.11: notee disabled |
| 44 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'notee' at line 1 |
| 45 | +# FR1.2.12: pager disabled |
| 46 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'pager more' at line 1 |
| 47 | +# FR1.2.13: print disabled |
| 48 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'print' at line 1 |
| 49 | +# FR1.2.14: prompt disabled |
| 50 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'prompt foo' at line 1 |
| 51 | +# FR1.2.15: quit disabled |
| 52 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'quit' at line 1 |
| 53 | +# FR1.2.16: rehash disabled |
| 54 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'rehash' at line 1 |
| 55 | +# FR1.2.17: source disabled |
| 56 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'source gogo.text' at line 1 |
| 57 | +# FR1.2.18: status disabled |
| 58 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'status' at line 1 |
| 59 | +# FR1.2.19: system disabled |
| 60 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'system echo' at line 1 |
| 61 | +# FR1.2.20: tee disabled |
| 62 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'tee foo' at line 1 |
| 63 | +# FR1.2.21: use disabled |
| 64 | +ERROR at line 1: Unknown command '\u'. |
| 65 | +# FR1.2.22: charset disabled |
| 66 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'charset latin1' at line 1 |
| 67 | +# FR1.2.22.1: \c enabled |
| 68 | +# FR1.2.23: warnings disabled |
| 69 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'warnings' at line 1 |
| 70 | +# FR1.2.24: nowarning disabled |
| 71 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'nowarning' at line 1 |
| 72 | +# FR1.2.25: resetconnection disabled |
| 73 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'resetconnection' at line 1 |
| 74 | +# FR1.2.26: query_attributes disabled |
| 75 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'query_attributes a b' at line 1 |
| 76 | +# FR1.2.27: ssl_session_data_print disabled |
| 77 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ssl_session_data_print foo' at line 1 |
| 78 | +# FR1.3: system-command ignored when commands=off |
| 79 | +# must fail with syntax error |
| 80 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'system cd foo' at line 1 |
| 81 | +# FR1.3: system-command ignored when commands=off in reverse |
| 82 | +# must fail with syntax error |
| 83 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'system cd foo' at line 1 |
| 84 | +# FR1.4: resetconnection enabled when commands is ON |
| 85 | +# FR1.5: system-command=off in effect when commands=on |
| 86 | +# must fail with specific error |
| 87 | +ERROR at line 1: 'system' command received, but the --system-command option is off. Skipping. |
| 88 | +# FR1.5: system-command=off in effect when commands=on in reverse |
| 89 | +# must fail with specific error |
| 90 | +ERROR at line 1: 'system' command received, but the --system-command option is off. Skipping. |
| 91 | +# FR1.6: commands in .cnf files work |
| 92 | +include/assert_grep.inc [FR1.1: the --commands value must be true] |
| 93 | +# FR1.7: --binary-mode=1 overrides --commands |
| 94 | +# must fail with a syntax error |
| 95 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'system echo foo' at line 1 |
| 96 | +trying in reverse |
| 97 | +# must fail with a syntax error |
| 98 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'system echo foo' at line 1 |
| 99 | +# FR1.8: --binary-mode=0 enables --commands |
| 100 | +# must fail with a syntax error |
| 101 | +ERROR 1064 (42000) at line 1: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'system echo foo' at line 1 |
| 102 | +# End of tests |
0 commit comments