summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
authorJon Olav Hauglid <jon.hauglid@sun.com>2010-02-25 13:29:14 +0100
committerJon Olav Hauglid <jon.hauglid@sun.com>2010-02-25 13:29:14 +0100
commita52ad97e67f703ab1a5ee9e49cf7a4cac9191534 (patch)
tree38573df058958389676e559712f75cc85edda383 /sql
parentdd42aab8406e70caec4f58435c0281cddc8ea2c0 (diff)
parent342c5c2c7f99d776c544c29c29b9002eb61a937c (diff)
downloadmariadb-git-a52ad97e67f703ab1a5ee9e49cf7a4cac9191534.tar.gz
merge from mysql-next-mr-bugfixing
Diffstat (limited to 'sql')
-rwxr-xr-xsql/CMakeLists.txt9
-rw-r--r--sql/share/CMakeLists.txt4
-rw-r--r--sql/sql_parse.cc71
3 files changed, 53 insertions, 31 deletions
diff --git a/sql/CMakeLists.txt b/sql/CMakeLists.txt
index 28a9d321455..8399b0c7219 100755
--- a/sql/CMakeLists.txt
+++ b/sql/CMakeLists.txt
@@ -191,7 +191,14 @@ ADD_CUSTOM_COMMAND(
COMMAND ${CMAKE_COMMAND} -E remove -f lex_hash.h.tmp
WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/gen_lex_hash.cc)
-
+
+MYSQL_ADD_EXECUTABLE(mysql_tzinfo_to_sql tztime.cc)
+SET_TARGET_PROPERTIES(mysql_tzinfo_to_sql PROPERTIES COMPILE_FLAGS "-DTZINFO2SQL")
+TARGET_LINK_LIBRARIES(mysql_tzinfo_to_sql ${MYSQLD_STATIC_PLUGIN_LIBS}
+ mysys dbug strings vio regex
+ ${LIBWRAP} ${LIBCRYPT} ${LIBDL}
+ ${SSL_LIBRARIES})
+
ADD_CUSTOM_TARGET(
GenServerSource
DEPENDS ${GEN_SOURCES}
diff --git a/sql/share/CMakeLists.txt b/sql/share/CMakeLists.txt
index 944120cfc24..1868200f038 100644
--- a/sql/share/CMakeLists.txt
+++ b/sql/share/CMakeLists.txt
@@ -47,6 +47,8 @@ FOREACH (dir ${dirs})
INSTALL(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${dir}
DESTINATION ${INSTALL_MYSQLSHAREDIR})
ENDFOREACH()
-INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/charsets DESTINATION ${INSTALL_MYSQLSHAREDIR})
+INSTALL(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/charsets DESTINATION ${INSTALL_MYSQLSHAREDIR}
+ PATTERN "languages.html" EXCLUDE
+)
INSTALL(FILES ${files} DESTINATION ${INSTALL_MYSQLSHAREDIR})
diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc
index b3c60fbd429..19373b58b49 100644
--- a/sql/sql_parse.cc
+++ b/sql/sql_parse.cc
@@ -4132,6 +4132,47 @@ create_sp_error:
case SQLCOM_DROP_PROCEDURE:
case SQLCOM_DROP_FUNCTION:
{
+#ifdef HAVE_DLOPEN
+ if (lex->sql_command == SQLCOM_DROP_FUNCTION &&
+ ! lex->spname->m_explicit_name)
+ {
+ /* DROP FUNCTION <non qualified name> */
+ udf_func *udf = find_udf(lex->spname->m_name.str,
+ lex->spname->m_name.length);
+ if (udf)
+ {
+ if (check_access(thd, DELETE_ACL, "mysql", NULL, NULL, 1, 0))
+ goto error;
+
+ if (!(res = mysql_drop_function(thd, &lex->spname->m_name)))
+ {
+ my_ok(thd);
+ break;
+ }
+ my_error(ER_SP_DROP_FAILED, MYF(0),
+ "FUNCTION (UDF)", lex->spname->m_name.str);
+ goto error;
+ }
+
+ if (lex->spname->m_db.str == NULL)
+ {
+ if (lex->drop_if_exists)
+ {
+ push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
+ ER_SP_DOES_NOT_EXIST, ER(ER_SP_DOES_NOT_EXIST),
+ "FUNCTION (UDF)", lex->spname->m_name.str);
+ res= FALSE;
+ my_ok(thd);
+ break;
+ }
+ my_error(ER_SP_DOES_NOT_EXIST, MYF(0),
+ "FUNCTION (UDF)", lex->spname->m_name.str);
+ goto error;
+ }
+ /* Fall thought to test for a stored function */
+ }
+#endif
+
int sp_result;
int type= (lex->sql_command == SQLCOM_DROP_PROCEDURE ?
TYPE_ENUM_PROCEDURE : TYPE_ENUM_FUNCTION);
@@ -4178,34 +4219,6 @@ create_sp_error:
}
#endif
}
- else
- {
-#ifdef HAVE_DLOPEN
- if (lex->sql_command == SQLCOM_DROP_FUNCTION)
- {
- udf_func *udf = find_udf(lex->spname->m_name.str,
- lex->spname->m_name.length);
- if (udf)
- {
- if (check_access(thd, DELETE_ACL, "mysql", NULL, NULL, 1, 0))
- goto error;
-
- if (!(res = mysql_drop_function(thd, &lex->spname->m_name)))
- {
- my_ok(thd);
- break;
- }
- }
- }
-#endif
- if (lex->spname->m_db.str)
- sp_result= SP_KEY_NOT_FOUND;
- else
- {
- my_message(ER_NO_DB_ERROR, ER(ER_NO_DB_ERROR), MYF(0));
- goto error;
- }
- }
res= sp_result;
switch (sp_result) {
case SP_OK:
@@ -4217,7 +4230,7 @@ create_sp_error:
res= write_bin_log(thd, TRUE, thd->query(), thd->query_length());
push_warning_printf(thd, MYSQL_ERROR::WARN_LEVEL_NOTE,
ER_SP_DOES_NOT_EXIST, ER(ER_SP_DOES_NOT_EXIST),
- SP_COM_STRING(lex), lex->spname->m_name.str);
+ SP_COM_STRING(lex), lex->spname->m_qname.str);
if (!res)
my_ok(thd);
break;