summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <tsmith@siva.hindu.god>2007-01-21 19:55:17 -0700
committerunknown <tsmith@siva.hindu.god>2007-01-21 19:55:17 -0700
commit47555a079a26b691c3977d34a2d2c14df20d4fa1 (patch)
treef0b4b1ae68a2dc1b5e16b697056ec527015fd875
parent7f5bcdaaa5f25dca746ea70f3c5f9dd8ab9884e3 (diff)
downloadmariadb-git-47555a079a26b691c3977d34a2d2c14df20d4fa1.tar.gz
Applied innodb-4.1-ss36 and innodb-4.1-ss38 snapshots
Fixes: - Bug #24299: - Bug #25596: innobase/dict/dict0dict.c: Applied innodb-4.1-ss36 and innodb-4.1-ss38 snapshots Revision r36: innodb-4.1: Port r1030 from innodb/branches/5.0: Replace isspace() with a wrapper ib_isspace(), because on Win32 isspace(0xa0) appears to hold. (Bug #24299) Revision r38: ib_isspace(c): Check for c being the null character. (Bug #25596)
-rw-r--r--innobase/dict/dict0dict.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/innobase/dict/dict0dict.c b/innobase/dict/dict0dict.c
index 4b23ce047b2..1e2511f88fa 100644
--- a/innobase/dict/dict0dict.c
+++ b/innobase/dict/dict0dict.c
@@ -27,6 +27,9 @@ Created 1/8/1996 Heikki Tuuri
#include "que0que.h"
#include "rem0cmp.h"
+/* Implement isspace() in a locale-independent way. (Bug #24299) */
+#define ib_isspace(c) ((char) (c) && strchr(" \v\f\t\r\n", c))
+
dict_sys_t* dict_sys = NULL; /* the dictionary system */
rw_lock_t dict_operation_lock; /* table create, drop, etc. reserve
@@ -2374,7 +2377,7 @@ dict_accept(
*success = FALSE;
- while (isspace(*ptr)) {
+ while (ib_isspace(*ptr)) {
ptr++;
}
@@ -2419,7 +2422,7 @@ dict_scan_id(
*id = NULL;
- while (isspace(*ptr)) {
+ while (ib_isspace(*ptr)) {
ptr++;
}
@@ -2450,7 +2453,7 @@ dict_scan_id(
len++;
}
} else {
- while (!isspace(*ptr) && *ptr != '(' && *ptr != ')'
+ while (!ib_isspace(*ptr) && *ptr != '(' && *ptr != ')'
&& (accept_also_dot || *ptr != '.')
&& *ptr != ',' && *ptr != '\0') {
@@ -2480,12 +2483,12 @@ dict_scan_id(
if (heap && !quote) {
/* EMS MySQL Manager sometimes adds characters 0xA0 (in
latin1, a 'non-breakable space') to the end of a table name.
- But isspace(0xA0) is not true, which confuses our foreign key
- parser. After the UTF-8 conversion in ha_innodb.cc, bytes 0xC2
- and 0xA0 are at the end of the string.
+ After the UTF-8 conversion in ha_innodb.cc, bytes 0xC2
+ and 0xA0 are at the end of the string, and ib_isspace()
+ does not work for multi-byte UTF-8 characters.
- TODO: we should lex the string using thd->charset_info, and
- my_isspace(). Only after that, convert id names to UTF-8. */
+ In MySQL 5.1 we lex the string using thd->charset_info, and
+ my_isspace(). This workaround is not needed there. */
b = (byte*)(*id);
id_len = strlen(b);
@@ -2956,11 +2959,11 @@ loop:
ut_a(success);
- if (!isspace(*ptr) && *ptr != '"' && *ptr != '`') {
+ if (!ib_isspace(*ptr) && *ptr != '"' && *ptr != '`') {
goto loop;
}
- while (isspace(*ptr)) {
+ while (ib_isspace(*ptr)) {
ptr++;
}
@@ -2990,7 +2993,7 @@ loop:
goto loop;
}
- if (!isspace(*ptr)) {
+ if (!ib_isspace(*ptr)) {
goto loop;
}
@@ -3078,7 +3081,7 @@ col_loop1:
}
ptr = dict_accept(ptr, "REFERENCES", &success);
- if (!success || !isspace(*ptr)) {
+ if (!success || !ib_isspace(*ptr)) {
dict_foreign_report_syntax_err(name, start_of_latest_foreign,
ptr);
return(DB_CANNOT_ADD_CONSTRAINT);
@@ -3461,7 +3464,7 @@ loop:
ptr = dict_accept(ptr, "DROP", &success);
- if (!isspace(*ptr)) {
+ if (!ib_isspace(*ptr)) {
goto loop;
}