summaryrefslogtreecommitdiff
path: root/sql/sp_head.cc
diff options
context:
space:
mode:
authorunknown <pem@mysql.com>2006-01-19 11:48:07 +0100
committerunknown <pem@mysql.com>2006-01-19 11:48:07 +0100
commit663fe66468143aa457a93bd180998d8187d53ca6 (patch)
tree77998d0059ac8f7e597b7ada28b273f939d4a8d5 /sql/sp_head.cc
parent48ac5c4a2b241d8fcc8f7266b4192664855e0ee6 (diff)
parent1e968057523db1313438368812b99a38ba460542 (diff)
downloadmariadb-git-663fe66468143aa457a93bd180998d8187d53ca6.tar.gz
Merge mysql.com:/extern/mysql/bk/mysql-5.0
into mysql.com:/extern/mysql/work/bug15658/mysql-5.0 mysql-test/r/sp-error.result: Auto merged sql/sp_head.cc: Auto merged sql/sp_head.h: Auto merged sql/sql_yacc.yy: Auto merged sql/share/errmsg.txt: Auto merged
Diffstat (limited to 'sql/sp_head.cc')
-rw-r--r--sql/sp_head.cc17
1 files changed, 17 insertions, 0 deletions
diff --git a/sql/sp_head.cc b/sql/sp_head.cc
index 8853ee97e98..9c86ebfddf4 100644
--- a/sql/sp_head.cc
+++ b/sql/sp_head.cc
@@ -386,6 +386,23 @@ sp_name_current_db_new(THD *thd, LEX_STRING name)
return qname;
}
+/*
+ * Check that the name 'ident' is ok. It's assumed to be an 'ident'
+ * from the parser, so we only have to check length and trailing spaces.
+ * The former is a standard requirement (and 'show status' assumes a
+ * non-empty name), the latter is a mysql:ism as trailing spaces are
+ * removed by get_field().
+ *
+ * RETURN
+ * TRUE - bad name
+ * FALSE - name is ok
+ */
+
+bool
+sp_name_check(LEX_STRING ident)
+{
+ return (!ident.str || !ident.str[0] || ident.str[ident.length-1] == ' ');
+}
/* ------------------------------------------------------------------ */