null+****@clear*****
null+****@clear*****
2010年 11月 21日 (日) 12:28:11 JST
Kouhei Sutou 2010-11-21 03:28:11 +0000 (Sun, 21 Nov 2010)
New Revision: cfebc17c7a007390de45b0a0e940b415b970876d
Log:
support create/drop user define function.
Modified files:
debian/mysql-server-groonga.postinst
debian/mysql-server-groonga.postrm
rpm/centos/mysql-groonga.spec.in
rpm/fedora/mysql-groonga.spec.in
Modified: debian/mysql-server-groonga.postinst (+4 -2)
===================================================================
--- debian/mysql-server-groonga.postinst 2010-11-21 02:23:27 +0000 (995e20b)
+++ debian/mysql-server-groonga.postinst 2010-11-21 03:28:11 +0000 (e8dda14)
@@ -5,8 +5,10 @@ set -e
prevver="$2"
install_plugin() {
- echo "INSTALL PLUGIN groonga SONAME 'ha_groonga.so';" |
- mysql --defaults-file=/etc/mysql/debian.cnf
+ cat <<EOS | mysql --defaults-file=/etc/mysql/debian.cnf
+INSTALL PLUGIN groonga SONAME 'ha_groonga.so';
+CREATE FUNCTION LAST_INSERT_GRN_ID RETURNS INTEGER soname 'ha_groonga.so';
+EOS
}
case "$1" in
Modified: debian/mysql-server-groonga.postrm (+4 -2)
===================================================================
--- debian/mysql-server-groonga.postrm 2010-11-21 02:23:27 +0000 (e91e9b0)
+++ debian/mysql-server-groonga.postrm 2010-11-21 03:28:11 +0000 (1b77ddc)
@@ -2,7 +2,9 @@
set -e
-echo "UNINSTALL PLUGIN groonga;" |
- mysql --defaults-file=/etc/mysql/debian.cnf
+cat <<EOS | mysql --defaults-file=/etc/mysql/debian.cnf
+DROP FUNCTION LAST_INSERT_GRN_ID;
+UNINSTALL PLUGIN groonga;
+EOS
#DEBHELPER#
Modified: rpm/centos/mysql-groonga.spec.in (+14 -3)
===================================================================
--- rpm/centos/mysql-groonga.spec.in 2010-11-21 02:23:27 +0000 (50eb5cb)
+++ rpm/centos/mysql-groonga.spec.in 2010-11-21 03:28:11 +0000 (45df6bd)
@@ -4,7 +4,7 @@
Name: mysql-groonga
Version: @VERSION@
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: A MySQL storage engine powered by groonga.
Group: Applications/Databases
@@ -65,14 +65,22 @@ rm $RPM_BUILD_ROOT%{_libdir}/mysql/plugin/ha_groonga.a
rm -rf $RPM_BUILD_ROOT
%post
-command="/usr/bin/mysql -u root -e \"INSTALL PLUGIN groonga SONAME 'ha_groonga.so'\""
+sql=<<EOS
+INSTALL PLUGIN groonga SONAME 'ha_groonga.so';
+CREATE FUNCTION LAST_INSERT_GRN_ID RETURNS INTEGER soname 'ha_groonga.so';
+EOS
+command="/usr/bin/mysql -u root -e \"$sql\""
echo $command
eval $command || \
(echo "run the following command to register groonga storage engine:"; \
echo " $command")
%postun
-command="/usr/bin/mysql -u root -e \"UNINSTALL PLUGIN groonga\""
+sql=<<EOS
+DROP FUNCTION LAST_INSERT_GRN_ID;
+UNINSTALL PLUGIN groonga;
+EOS
+command="/usr/bin/mysql -u root -e \"$sql\""
echo $command
eval $command || \
(echo "run the following command to unregister groonga storage engine:"; \
@@ -83,6 +91,9 @@ eval $command || \
%{_libdir}/mysql/plugin/
%changelog
+* Sun Nov 21 2010 Kouhei Sutou <kou****@clear*****> - 0.3-2
+- install user define function.
+
* Fri Oct 29 2010 Kouhei Sutou <kou****@clear*****> - 0.3-1
- new upstream release.
Modified: rpm/fedora/mysql-groonga.spec.in (+14 -3)
===================================================================
--- rpm/fedora/mysql-groonga.spec.in 2010-11-21 02:23:27 +0000 (9f8abee)
+++ rpm/fedora/mysql-groonga.spec.in 2010-11-21 03:28:11 +0000 (9c754bc)
@@ -3,7 +3,7 @@
Name: mysql-groonga
Version: @VERSION@
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: A MySQL storage engine powered by groonga.
Group: Applications/Databases
@@ -48,14 +48,22 @@ rm $RPM_BUILD_ROOT%{_libdir}/mysql/plugin/ha_groonga.a
rm -rf $RPM_BUILD_ROOT
%post
-command="/usr/bin/mysql -u root -p -e \"INSTALL PLUGIN groonga SONAME 'ha_groonga.so'\""
+sql=<<EOS
+INSTALL PLUGIN groonga SONAME 'ha_groonga.so';
+CREATE FUNCTION LAST_INSERT_GRN_ID RETURNS INTEGER soname 'ha_groonga.so';
+EOS
+command="/usr/bin/mysql -u root -p -e \"$sql\""
echo $command
eval $command || \
(echo "run the following command to register groonga storage engine:"; \
echo " $command")
%postun
-command="/usr/bin/mysql -u root -p -e \"UNINSTALL PLUGIN groonga\""
+sql=<<EOS
+DROP FUNCTION LAST_INSERT_GRN_ID;
+UNINSTALL PLUGIN groonga;
+EOS
+command="/usr/bin/mysql -u root -p -e \"$sql\""
echo $command
eval $command || \
(echo "run the following command to unregister groonga storage engine:"; \
@@ -66,6 +74,9 @@ eval $command || \
%{_libdir}/mysql/plugin/
%changelog
+* Sun Nov 21 2010 Kouhei Sutou <kou****@clear*****> - 0.3-2
+- install user define function.
+
* Fri Oct 29 2010 Kouhei Sutou <kou****@clear*****> - 0.3-1
- new upstream release.