diff options
| author | Alexander Barkov <bar@mariadb.com> | 2019-02-28 07:17:47 +0400 |
|---|---|---|
| committer | Alexander Barkov <bar@mariadb.com> | 2019-02-28 07:17:47 +0400 |
| commit | 09d29dfc766613ffd6ac6b8a0bc1c3e6f9388eb2 (patch) | |
| tree | 0ff25f30dd8988b0dd34c883d4464d2ad3e05c44 /mysql-test | |
| parent | 9bd47835d0fcdcf2f041da39dbe5b98ff738ff10 (diff) | |
| download | mariadb-git-09d29dfc766613ffd6ac6b8a0bc1c3e6f9388eb2.tar.gz | |
MDEV-18767 Port "MDEV-16294: INSTALL PLUGIN IF NOT EXISTS / UNINSTALL PLUGIN IF EXISTS" to sql_yacc_ora.yy
Diffstat (limited to 'mysql-test')
| -rw-r--r-- | mysql-test/include/install_plugin_if_exists.inc | 41 | ||||
| -rw-r--r-- | mysql-test/main/plugin.result | 2 | ||||
| -rw-r--r-- | mysql-test/main/plugin.test | 40 | ||||
| -rw-r--r-- | mysql-test/suite/compat/oracle/r/plugin.result | 48 | ||||
| -rw-r--r-- | mysql-test/suite/compat/oracle/t/plugin.test | 3 |
5 files changed, 95 insertions, 39 deletions
diff --git a/mysql-test/include/install_plugin_if_exists.inc b/mysql-test/include/install_plugin_if_exists.inc new file mode 100644 index 00000000000..93f968e8a39 --- /dev/null +++ b/mysql-test/include/install_plugin_if_exists.inc @@ -0,0 +1,41 @@ +--echo # +--echo # MDEV-16294: INSTALL PLUGIN IF NOT EXISTS / UNINSTALL PLUGIN IF EXISTS +--echo # +--echo # INSTALL IF NOT EXISTS PLUGIN name SONAME library / +--echo # UNINSTALL IF EXISTS PLUGIN|SONAME name +--echo # + +select PLUGIN_NAME,PLUGIN_STATUS,PLUGIN_TYPE from information_schema.plugins where plugin_library like 'ha_example%'; +INSTALL PLUGIN IF NOT EXISTS example SONAME 'ha_example'; +select PLUGIN_NAME,PLUGIN_STATUS,PLUGIN_TYPE from information_schema.plugins where plugin_library like 'ha_example%'; + +--replace_regex /\.dll/.so/ +--error ER_PLUGIN_INSTALLED +INSTALL PLUGIN example SONAME 'ha_example'; + +INSTALL PLUGIN IF NOT EXISTS example SONAME 'ha_example'; +SHOW WARNINGS; + +UNINSTALL PLUGIN IF EXISTS example; +select PLUGIN_NAME,PLUGIN_STATUS,PLUGIN_TYPE from information_schema.plugins where plugin_library like 'ha_example%'; + +UNINSTALL PLUGIN IF EXISTS example; +SHOW WARNINGS; + +--error ER_SP_DOES_NOT_EXIST +UNINSTALL PLUGIN example; + +INSTALL SONAME 'ha_example'; +select PLUGIN_NAME,PLUGIN_STATUS,PLUGIN_TYPE from information_schema.plugins where plugin_library like 'ha_example%'; + +UNINSTALL SONAME IF EXISTS 'ha_example'; + +--replace_regex /\.dll/.so/ +UNINSTALL SONAME IF EXISTS 'ha_example'; +--replace_regex /\.dll/.so/ +SHOW WARNINGS; +select PLUGIN_NAME,PLUGIN_STATUS,PLUGIN_TYPE from information_schema.plugins where plugin_library like 'ha_example%'; + +--replace_regex /\.dll/.so/ +--error ER_SP_DOES_NOT_EXIST +UNINSTALL SONAME 'ha_example'; diff --git a/mysql-test/main/plugin.result b/mysql-test/main/plugin.result index fde2550ad81..947a2b6bd7a 100644 --- a/mysql-test/main/plugin.result +++ b/mysql-test/main/plugin.result @@ -332,6 +332,8 @@ RENAME TABLE t1 TO t2; ERROR 42S02: Table 'test.t1' doesn't exist DROP TABLE t1; # +# MDEV-16294: INSTALL PLUGIN IF NOT EXISTS / UNINSTALL PLUGIN IF EXISTS +# # INSTALL IF NOT EXISTS PLUGIN name SONAME library / # UNINSTALL IF EXISTS PLUGIN|SONAME name # diff --git a/mysql-test/main/plugin.test b/mysql-test/main/plugin.test index 273e1e064a5..68aab865036 100644 --- a/mysql-test/main/plugin.test +++ b/mysql-test/main/plugin.test @@ -266,42 +266,4 @@ UNINSTALL PLUGIN example; RENAME TABLE t1 TO t2; DROP TABLE t1; ---echo # ---echo # INSTALL IF NOT EXISTS PLUGIN name SONAME library / ---echo # UNINSTALL IF EXISTS PLUGIN|SONAME name ---echo # - -select PLUGIN_NAME,PLUGIN_STATUS,PLUGIN_TYPE from information_schema.plugins where plugin_library like 'ha_example%'; -INSTALL PLUGIN IF NOT EXISTS example SONAME 'ha_example'; -select PLUGIN_NAME,PLUGIN_STATUS,PLUGIN_TYPE from information_schema.plugins where plugin_library like 'ha_example%'; - ---replace_regex /\.dll/.so/ ---error ER_PLUGIN_INSTALLED -INSTALL PLUGIN example SONAME 'ha_example'; - -INSTALL PLUGIN IF NOT EXISTS example SONAME 'ha_example'; -SHOW WARNINGS; - -UNINSTALL PLUGIN IF EXISTS example; -select PLUGIN_NAME,PLUGIN_STATUS,PLUGIN_TYPE from information_schema.plugins where plugin_library like 'ha_example%'; - -UNINSTALL PLUGIN IF EXISTS example; -SHOW WARNINGS; - ---error 1305 -UNINSTALL PLUGIN example; - -INSTALL SONAME 'ha_example'; -select PLUGIN_NAME,PLUGIN_STATUS,PLUGIN_TYPE from information_schema.plugins where plugin_library like 'ha_example%'; - -UNINSTALL SONAME IF EXISTS 'ha_example'; - ---replace_regex /\.dll/.so/ -UNINSTALL SONAME IF EXISTS 'ha_example'; ---replace_regex /\.dll/.so/ -SHOW WARNINGS; -select PLUGIN_NAME,PLUGIN_STATUS,PLUGIN_TYPE from information_schema.plugins where plugin_library like 'ha_example%'; - ---replace_regex /\.dll/.so/ ---error 1305 -UNINSTALL SONAME 'ha_example'; +--source include/install_plugin_if_exists.inc diff --git a/mysql-test/suite/compat/oracle/r/plugin.result b/mysql-test/suite/compat/oracle/r/plugin.result new file mode 100644 index 00000000000..c885c03e656 --- /dev/null +++ b/mysql-test/suite/compat/oracle/r/plugin.result @@ -0,0 +1,48 @@ +SET sql_mode=ORACLE; +# +# MDEV-16294: INSTALL PLUGIN IF NOT EXISTS / UNINSTALL PLUGIN IF EXISTS +# +# INSTALL IF NOT EXISTS PLUGIN name SONAME library / +# UNINSTALL IF EXISTS PLUGIN|SONAME name +# +select PLUGIN_NAME,PLUGIN_STATUS,PLUGIN_TYPE from information_schema.plugins where plugin_library like 'ha_example%'; +PLUGIN_NAME PLUGIN_STATUS PLUGIN_TYPE +INSTALL PLUGIN IF NOT EXISTS example SONAME 'ha_example'; +select PLUGIN_NAME,PLUGIN_STATUS,PLUGIN_TYPE from information_schema.plugins where plugin_library like 'ha_example%'; +PLUGIN_NAME PLUGIN_STATUS PLUGIN_TYPE +EXAMPLE ACTIVE STORAGE ENGINE +INSTALL PLUGIN example SONAME 'ha_example'; +ERROR HY000: Plugin 'example' already installed +INSTALL PLUGIN IF NOT EXISTS example SONAME 'ha_example'; +Warnings: +Note 1968 Plugin 'example' already installed +SHOW WARNINGS; +Level Code Message +Note 1968 Plugin 'example' already installed +UNINSTALL PLUGIN IF EXISTS example; +select PLUGIN_NAME,PLUGIN_STATUS,PLUGIN_TYPE from information_schema.plugins where plugin_library like 'ha_example%'; +PLUGIN_NAME PLUGIN_STATUS PLUGIN_TYPE +UNINSTALL PLUGIN IF EXISTS example; +Warnings: +Note 1305 PLUGIN example does not exist +SHOW WARNINGS; +Level Code Message +Note 1305 PLUGIN example does not exist +UNINSTALL PLUGIN example; +ERROR 42000: PLUGIN example does not exist +INSTALL SONAME 'ha_example'; +select PLUGIN_NAME,PLUGIN_STATUS,PLUGIN_TYPE from information_schema.plugins where plugin_library like 'ha_example%'; +PLUGIN_NAME PLUGIN_STATUS PLUGIN_TYPE +EXAMPLE ACTIVE STORAGE ENGINE +UNUSABLE ACTIVE DAEMON +UNINSTALL SONAME IF EXISTS 'ha_example'; +UNINSTALL SONAME IF EXISTS 'ha_example'; +Warnings: +Note 1305 SONAME ha_example.so does not exist +SHOW WARNINGS; +Level Code Message +Note 1305 SONAME ha_example.so does not exist +select PLUGIN_NAME,PLUGIN_STATUS,PLUGIN_TYPE from information_schema.plugins where plugin_library like 'ha_example%'; +PLUGIN_NAME PLUGIN_STATUS PLUGIN_TYPE +UNINSTALL SONAME 'ha_example'; +ERROR 42000: SONAME ha_example.so does not exist diff --git a/mysql-test/suite/compat/oracle/t/plugin.test b/mysql-test/suite/compat/oracle/t/plugin.test new file mode 100644 index 00000000000..a84c4ae7828 --- /dev/null +++ b/mysql-test/suite/compat/oracle/t/plugin.test @@ -0,0 +1,3 @@ +SET sql_mode=ORACLE; + +--source include/install_plugin_if_exists.inc |
