summaryrefslogtreecommitdiff
path: root/storage/mroonga/data
diff options
context:
space:
mode:
authorSergei Golubchik <serg@mariadb.org>2018-06-23 23:44:11 +0200
committerSergei Golubchik <serg@mariadb.org>2018-06-24 15:18:36 +0200
commitf57731102713b1b38e02cd15393cc15784b4d937 (patch)
tree5a2314a28e41f2bb0077fb79c9d3586fd7bcacb2 /storage/mroonga/data
parentf25a5c39c1467df4677663607625c7444e65f837 (diff)
downloadmariadb-git-f57731102713b1b38e02cd15393cc15784b4d937.tar.gz
fix mroonga post-install script
it only worked if mroonga plugin wasn't installed before (normal case), but then it didn't need to delete anything. if, by some glitch, mroonga was already installed, it would delete mroonga from mysql.plugin, but INSTALL would fail (as mroonga was running), and the script aborted, leaving mroonga not in mysql.plugin at all.
Diffstat (limited to 'storage/mroonga/data')
-rw-r--r--storage/mroonga/data/install.sql.in6
1 files changed, 3 insertions, 3 deletions
diff --git a/storage/mroonga/data/install.sql.in b/storage/mroonga/data/install.sql.in
index d7d5f3c4ad6..0a2f308aef4 100644
--- a/storage/mroonga/data/install.sql.in
+++ b/storage/mroonga/data/install.sql.in
@@ -1,6 +1,6 @@
-DELETE IGNORE FROM mysql.plugin WHERE dl = 'ha_mroonga@MRN_PLUGIN_SUFFIX@';
-
-INSTALL PLUGIN Mroonga SONAME 'ha_mroonga@MRN_PLUGIN_SUFFIX@';
+SET @inst=IF(EXISTS(SELECT * FROM mysql.plugin WHERE NAME='mroonga'),'DO 1', "INSTALL PLUGIN mroonga SONAME 'ha_mroonga'");
+PREPARE s FROM @inst;
+EXECUTE s;
DROP FUNCTION IF EXISTS last_insert_grn_id;
CREATE FUNCTION last_insert_grn_id RETURNS INTEGER