Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Alain Takoudjou
slapos
Commits
76b41147
Commit
76b41147
authored
Feb 10, 2015
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
register more mroonga UDFs.
parent
841ae71b
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
7 deletions
+11
-7
slapos/recipe/generic_mysql/__init__.py
slapos/recipe/generic_mysql/__init__.py
+8
-5
slapos/recipe/generic_mysql/template/mysql-init-function.sql.in
.../recipe/generic_mysql/template/mysql-init-function.sql.in
+3
-2
No files found.
slapos/recipe/generic_mysql/__init__.py
View file @
76b41147
...
@@ -80,16 +80,19 @@ class Recipe(GenericBaseRecipe):
...
@@ -80,16 +80,19 @@ class Recipe(GenericBaseRecipe):
mysql_script_list
=
[]
mysql_script_list
=
[]
# user defined functions
# user defined functions
udf_registration
=
""
mroonga
=
self
.
options
.
get
(
'mroonga'
,
'ha_mroonga.so'
)
mroonga
=
self
.
options
.
get
(
'mroonga'
,
'ha_mroonga.so'
)
if
mroonga
:
if
mroonga
:
last_insert_grn_id
=
"CREATE FUNCTION last_insert_grn_id RETURNS "
\
udf_registration
+=
"CREATE FUNCTION last_insert_grn_id RETURNS "
\
"INTEGER SONAME '"
+
mroonga
+
"';"
"INTEGER SONAME '"
+
mroonga
+
"';
\
n
"
else
:
udf_registration
+=
"CREATE FUNCTION mroonga_snippet RETURNS "
\
last_insert_grn_id
=
""
"STRING SONAME '"
+
mroonga
+
"';
\
n
"
udf_registration
+=
"CREATE FUNCTION mroonga_command RETURNS "
\
"STRING SONAME '"
+
mroonga
+
"';
\
n
"
mysql_script_list
.
append
(
self
.
substituteTemplate
(
mysql_script_list
.
append
(
self
.
substituteTemplate
(
self
.
getTemplateFilename
(
'mysql-init-function.sql.in'
),
self
.
getTemplateFilename
(
'mysql-init-function.sql.in'
),
{
{
'
last_insert_grn_id'
:
last_insert_grn_id
,
'
udf_registration'
:
udf_registration
,
}
}
))
))
# real database
# real database
...
...
slapos/recipe/generic_mysql/template/mysql-init-function.sql.in
View file @
76b41147
USE mysql;
USE mysql;
DROP FUNCTION IF EXISTS last_insert_grn_id;
DROP FUNCTION IF EXISTS last_insert_grn_id;
%(last_insert_grn_id)s
DROP FUNCTION IF EXISTS mroonga_snippet;
DROP FUNCTION IF EXISTS mroonga_command;
DROP FUNCTION IF EXISTS sphinx_snippets;
DROP FUNCTION IF EXISTS sphinx_snippets;
#CREATE FUNCTION sphinx_snippets RETURNS STRING SONAME 'ha_sphinx.so';
%(udf_registration)s
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment