Navigation Menu

Skip to content

Commit

Permalink
Use install SQL file
Browse files Browse the repository at this point in the history
  • Loading branch information
kou committed Mar 10, 2015
1 parent ebd5143 commit b745be0
Showing 1 changed file with 4 additions and 11 deletions.
15 changes: 4 additions & 11 deletions mroonga.rb
Expand Up @@ -71,7 +71,7 @@ def test
def caveats
<<-EOS.undent
To install mroonga plugin, run the following command:
mysql -uroot -e '#{install_sql}'
mysql -uroot < '#{install_sql_path}'
To confirm successfuly installed, run the following command
and confirm that 'mroonga' is in the list:
Expand Down Expand Up @@ -149,18 +149,11 @@ def install_mroonga(mysql_source_path, mysql_config_path)
system("./configure", *configure_args)
system("make")
system("make install")
system("mysql -uroot -e '#{install_sql}' || true")
system("mysql -uroot < '#{install_sql_path}' || true")
end

def install_sql
sqls = [
"INSTALL PLUGIN Mroonga SONAME \"ha_mroonga.so\";",
"CREATE FUNCTION last_insert_grn_id RETURNS INTEGER SONAME \"ha_mroonga.so\";",
"CREATE FUNCTION mroonga_snippet RETURNS STRING SONAME \"ha_mroonga.so\";",
"CREATE FUNCTION mroonga_command RETURNS STRING SONAME \"ha_mroonga.so\";",
"CREATE FUNCTION mroonga_escape RETURNS STRING SONAME \"ha_mroonga.so\";"
]
sqls.join(" ")
def install_sql_path
prefix + "share/mroonga/install.sql"
end

def option_value(search_key)
Expand Down

0 comments on commit b745be0

Please sign in to comment.