diff options
author | heikki@donna.mysql.fi <> | 2001-12-11 22:45:32 +0200 |
---|---|---|
committer | heikki@donna.mysql.fi <> | 2001-12-11 22:45:32 +0200 |
commit | 6732573c3c4d4f372fde875370fa372aceb0246b (patch) | |
tree | 225aadb08bc235e5b4b323c3a87f1157fa5a09e0 /innobase/ut | |
parent | 12058c299647533050950d1dd5952c666c2eceb2 (diff) | |
download | mariadb-git-6732573c3c4d4f372fde875370fa372aceb0246b.tar.gz |
ut0byte.h, ut0byte.c, dict0dict.c:
Make column names non-case-sensitive in referential constraints and put table and database names there in lower case in Windows
Diffstat (limited to 'innobase/ut')
-rw-r--r-- | innobase/ut/ut0byte.c | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/innobase/ut/ut0byte.c b/innobase/ut/ut0byte.c index fa0d904a6a7..02bdf2065ee 100644 --- a/innobase/ut/ut0byte.c +++ b/innobase/ut/ut0byte.c @@ -30,3 +30,46 @@ ut_dulint_sort(dulint* arr, dulint* aux_arr, ulint low, ulint high) ut_dulint_cmp); } +/**************************************************************** +Copies a string to a memory location, setting characters to lower case. */ + +void +ut_cpy_in_lower_case( +/*=================*/ + char* dest, /* in: destination */ + char* source,/* in: source */ + ulint len) /* in: string length */ +{ + ulint i; + + for (i = 0; i < len; i++) { + dest[i] = tolower(source[i]); + } +} + +/**************************************************************** +Compares two strings when converted to lower case. */ + +int +ut_cmp_in_lower_case( +/*=================*/ + /* out: -1, 0, 1 if str1 < str2, str1 == str2, + str1 > str2, respectively */ + char* str1, /* in: string1 */ + char* str2, /* in: string2 */ + ulint len) /* in: length of both strings */ +{ + ulint i; + + for (i = 0; i < len; i++) { + if (tolower(str1[i]) < tolower(str2[i])) { + return(-1); + } + + if (tolower(str1[i]) > tolower(str2[i])) { + return(1); + } + } + + return(0); +} |