|
| 1 | +# |
| 2 | +# WL#16824: WASM library server support. |
| 3 | +# |
| 4 | +CREATE LIBRARY binary_library_utf8 LANGUAGE WASM |
| 5 | +AS $$cHJpbnRmKCdUaGlzIGlzIFdBU00nKTs=$$; |
| 6 | +Warnings: |
| 7 | +Warning 6001 Language component: Not available. |
| 8 | +SHOW CREATE LIBRARY binary_library_utf8; |
| 9 | +Library sql_mode Create Library |
| 10 | +binary_library_utf8 ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION CREATE LIBRARY `binary_library_utf8` |
| 11 | + LANGUAGE WASM |
| 12 | +AS $$cHJpbnRmKCdUaGlzIGlzIFdBU00nKTs=$$ |
| 13 | +ALTER LIBRARY binary_library_utf8 COMMENT 'A binary library stored in UTF8 encoding.'; |
| 14 | +CREATE LIBRARY binary_library_hex LANGUAGE WASM |
| 15 | +COMMENT 'A binary library stored in binary encoding' |
| 16 | +AS 0x7072696E7466282754686973206973205741534D27293B; |
| 17 | +Warnings: |
| 18 | +Warning 6001 Language component: Not available. |
| 19 | +SHOW CREATE LIBRARY binary_library_hex; |
| 20 | +Library sql_mode Create Library |
| 21 | +binary_library_hex ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION CREATE LIBRARY `binary_library_hex` |
| 22 | + COMMENT 'A binary library stored in binary encoding' |
| 23 | + LANGUAGE WASM |
| 24 | +AS 0x7072696E7466282754686973206973205741534D27293B |
| 25 | +ALTER LIBRARY binary_library_hex COMMENT 'A binary library stored in BINARY encoding.'; |
| 26 | +CREATE LIBRARY binary_library_quotes LANGUAGE WASM |
| 27 | +COMMENT 'A binary library stored in binary encoding' |
| 28 | +AS _binary X'7072696E7466282754686973206973205741534D20776974682071756F74657327293B'; |
| 29 | +Warnings: |
| 30 | +Warning 6001 Language component: Not available. |
| 31 | +SHOW CREATE LIBRARY binary_library_quotes; |
| 32 | +Library sql_mode Create Library |
| 33 | +binary_library_quotes ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION CREATE LIBRARY `binary_library_quotes` |
| 34 | + COMMENT 'A binary library stored in binary encoding' |
| 35 | + LANGUAGE WASM |
| 36 | +AS 0x7072696E7466282754686973206973205741534D20776974682071756F74657327293B |
| 37 | +CREATE LIBRARY binary_library_binary LANGUAGE WASM |
| 38 | +COMMENT 'A binary library stored in binary encoding' |
| 39 | +AS _binary b'111000011100101101001110111011101001100110101000100111101010011010001101001111001110000011010011110011100000101011110000011010011100110110000011010011101110100000110001011010011101110110000111100101111001100111101001111011'; |
| 40 | +Warnings: |
| 41 | +Warning 6001 Language component: Not available. |
| 42 | +SHOW CREATE LIBRARY binary_library_binary; |
| 43 | +Library sql_mode Create Library |
| 44 | +binary_library_binary ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION CREATE LIBRARY `binary_library_binary` |
| 45 | + COMMENT 'A binary library stored in binary encoding' |
| 46 | + LANGUAGE WASM |
| 47 | +AS 0x3872FFFFFFD3FFFFFFBBFFFFFFA66A27FFFFFFA9FFFFFFA34F3834FFFFFFF3FFFFFF82FFFFFFBC1A7360FFFFFFD3FFFFFFBA0C5A7761FFFFFFE5FFFFFFE67A7B |
| 48 | +# Negative tests: |
| 49 | +CREATE LIBRARY binary_library_binary_neg LANGUAGE WASM |
| 50 | +AS _binary b'01210'; |
| 51 | +ERROR 42000: 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 'b'01210'' at line 2 |
| 52 | +CREATE LIBRARY binary_library_hex_neg LANGUAGE WASM |
| 53 | +AS _binary X'ABCDEFGH'; |
| 54 | +ERROR 42000: 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 'X'ABCDEFGH'' at line 2 |
| 55 | +CREATE LIBRARY binary_library_null LANGUAGE WASM |
| 56 | +AS _binary NULL; |
| 57 | +ERROR 42000: 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 'NULL' at line 2 |
| 58 | +CREATE LIBRARY binary_library_null LANGUAGE WASM |
| 59 | +AS NULL; |
| 60 | +ERROR 42000: 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 'NULL' at line 2 |
| 61 | +CREATE LIBRARY binary_library_neg LANGUAGE WASM |
| 62 | +AS 0xABCDEFGH; |
| 63 | +ERROR 42000: 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 '0xABCDEFGH' at line 2 |
| 64 | +CREATE LIBRARY binary_library_neg LANGUAGE WASM |
| 65 | +AS 'This is not Base64 encoded text'; |
| 66 | +Warnings: |
| 67 | +Warning 6001 Language component: Not available. |
| 68 | +SELECT * FROM INFORMATION_SCHEMA.LIBRARIES |
| 69 | +WHERE LIBRARY_SCHEMA = 'test' |
| 70 | +ORDER BY LIBRARY_NAME; |
| 71 | +LIBRARY_CATALOG LIBRARY_SCHEMA LIBRARY_NAME LIBRARY_DEFINITION LANGUAGE CREATED LAST_ALTERED SQL_MODE LIBRARY_COMMENT CREATOR |
| 72 | +def test binary_library_binary WASM <created> <modified> ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION A binary library stored in binary encoding root@localhost |
| 73 | +def test binary_library_hex WASM <created> <modified> ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION A binary library stored in BINARY encoding. root@localhost |
| 74 | +def test binary_library_neg This is not Base64 encoded text WASM <created> <modified> ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION root@localhost |
| 75 | +def test binary_library_quotes WASM <created> <modified> ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION A binary library stored in binary encoding root@localhost |
| 76 | +def test binary_library_utf8 cHJpbnRmKCdUaGlzIGlzIFdBU00nKTs= WASM <created> <modified> ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION A binary library stored in UTF8 encoding. root@localhost |
| 77 | +SHOW LIBRARY STATUS like 'binary_library_%'; |
| 78 | +Db Name Language Creator Modified Created Comment |
| 79 | +test binary_library_binary WASM root@localhost <modified> <created> A binary library stored in binary encoding |
| 80 | +test binary_library_hex WASM root@localhost <modified> <created> A binary library stored in BINARY encoding. |
| 81 | +test binary_library_neg WASM root@localhost <modified> <created> |
| 82 | +test binary_library_quotes WASM root@localhost <modified> <created> A binary library stored in binary encoding |
| 83 | +test binary_library_utf8 WASM root@localhost <modified> <created> A binary library stored in UTF8 encoding. |
| 84 | +# Cleanup. |
| 85 | +DROP LIBRARY binary_library_neg; |
| 86 | +DROP LIBRARY binary_library_binary; |
| 87 | +DROP LIBRARY binary_library_quotes; |
| 88 | +DROP LIBRARY binary_library_hex; |
| 89 | +DROP LIBRARY binary_library_utf8; |
| 90 | +SELECT * FROM INFORMATION_SCHEMA.LIBRARIES |
| 91 | +WHERE LIBRARY_SCHEMA = 'test'; |
| 92 | +LIBRARY_CATALOG LIBRARY_SCHEMA LIBRARY_NAME LIBRARY_DEFINITION LANGUAGE CREATED LAST_ALTERED SQL_MODE LIBRARY_COMMENT CREATOR |
0 commit comments