summaryrefslogtreecommitdiff
path: root/innobase/dict/dict0dict.c
diff options
context:
space:
mode:
authorunknown <monty@mysql.com>2004-11-12 19:58:24 +0200
committerunknown <monty@mysql.com>2004-11-12 19:58:24 +0200
commit19c2ce47dbe4e79c378e06b09c1543eb875ade51 (patch)
treee0dd750287073966f1595d8099b4cc23faa803f7 /innobase/dict/dict0dict.c
parent671871d95fe7a66195a229be550d19c2fcf6dd35 (diff)
parent870b048b8ea84108f3325b1fa455d60123f4fb9e (diff)
downloadmariadb-git-19c2ce47dbe4e79c378e06b09c1543eb875ade51.tar.gz
Merge with 4.1
BitKeeper/etc/logging_ok: auto-union BitKeeper/deleted/.del-Makefile.am: Auto merged BitKeeper/deleted/.del-Makefile.am~1: Delete: Docs/Images/Makefile.am client/mysqltest.c: Auto merged include/mysql.h: Auto merged libmysql/libmysql.c: Auto merged myisam/mi_check.c: Auto merged mysql-test/r/grant.result: Auto merged mysql-test/r/ps_1general.result: Auto merged mysql-test/t/grant.test: Auto merged mysql-test/t/mix_innodb_myisam_binlog.test: Auto merged mysql-test/t/ps_1general.test: Auto merged sql/field.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/mysqld.cc: Auto merged sql/share/french/errmsg.txt: Auto merged sql/share/greek/errmsg.txt: Auto merged sql/sql_acl.cc: Auto merged sql/sql_table.cc: Auto merged sql/time.cc: Auto merged sql-common/my_time.c: Auto merged sql/share/portuguese/errmsg.txt: Auto merged sql/share/romanian/errmsg.txt: Auto merged sql/share/serbian/errmsg.txt: Auto merged sql/share/spanish/errmsg.txt: Auto merged sql/share/swedish/errmsg.txt: Auto merged configure.in: Merge with 4.0 mysql-test/r/mix_innodb_myisam_binlog.result: Merge with 4.0 mysys/default.c: Merge with 4.1 (to get new extension handling) sql/log.cc: Merge with 4.0 tests/client_test.c: Merge with 4.1 (to get possibility to run any tests)
Diffstat (limited to 'innobase/dict/dict0dict.c')
-rw-r--r--innobase/dict/dict0dict.c53
1 files changed, 28 insertions, 25 deletions
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c
index bc08fc2437e..183c547ab2b 100644
--- a/innobase/dict/dict0dict.c
+++ b/innobase/dict/dict0dict.c
@@ -2266,8 +2266,8 @@ dict_foreign_add_to_cache(
/*************************************************************************
Scans from pointer onwards. Stops if is at the start of a copy of
-'string' where characters are compared without case sensitivity. Stops
-also at '\0'. */
+'string' where characters are compared without case sensitivity, and
+only outside `` or "" quotes. Stops also at '\0'. */
const char*
dict_scan_to(
@@ -2276,31 +2276,34 @@ dict_scan_to(
const char* ptr, /* in: scan from */
const char* string) /* in: look for this */
{
- ibool success;
- ulint i;
-loop:
- if (*ptr == '\0') {
- return(ptr);
- }
-
- success = TRUE;
-
- for (i = 0; i < ut_strlen(string); i++) {
- if (toupper((ulint)(ptr[i])) != toupper((ulint)(string[i]))) {
- success = FALSE;
+ char quote = '\0';
+ for (; *ptr; ptr++) {
+ if (*ptr == quote) {
+ /* Closing quote character: do not look for
+ starting quote or the keyword. */
+ quote = '\0';
+ } else if (quote) {
+ /* Within quotes: do nothing. */
+ } else if (*ptr == '`' || *ptr == '"') {
+ /* Starting quote: remember the quote character. */
+ quote = *ptr;
+ } else {
+ /* Outside quotes: look for the keyword. */
+ ulint i;
+ for (i = 0; string[i]; i++) {
+ if (toupper((ulint)(ptr[i]))
+ != toupper((ulint)(string[i]))) {
+ goto nomatch;
+ }
+ }
break;
+ nomatch:
+ ;
}
}
- if (success) {
-
- return(ptr);
- }
-
- ptr++;
-
- goto loop;
+ return(ptr);
}
/*************************************************************************
@@ -2877,13 +2880,13 @@ loop:
ut_a(success);
- if (!isspace(*ptr)) {
+ if (!isspace(*ptr) && *ptr != '"' && *ptr != '`') {
goto loop;
}
- do {
+ while (isspace(*ptr)) {
ptr++;
- } while (isspace(*ptr));
+ }
/* read constraint name unless got "CONSTRAINT FOREIGN" */
if (ptr != ptr2) {