Loading innobase/dict/dict0dict.c +11 −3 Original line number Diff line number Diff line Loading @@ -1761,9 +1761,8 @@ dict_scan_col( col = dict_table_get_nth_col(table, i); if (ut_strlen(col->name) == (ulint)(ptr - old_ptr) && 0 == ut_memcmp(col->name, old_ptr, && 0 == ut_cmp_in_lower_case(col->name, old_ptr, (ulint)(ptr - old_ptr))) { /* Found */ *success = TRUE; Loading Loading @@ -1827,11 +1826,20 @@ dict_scan_table_name( break; } } #ifdef __WIN__ ut_cpy_in_lower_case(second_table_name + i, old_ptr, ptr - old_ptr); #else ut_memcpy(second_table_name + i, old_ptr, ptr - old_ptr); #endif second_table_name[i + (ptr - old_ptr)] = '\0'; } else { #ifdef __WIN__ ut_cpy_in_lower_case(second_table_name, old_ptr, ptr - old_ptr); #else ut_memcpy(second_table_name, old_ptr, ptr - old_ptr); #endif second_table_name[dot_ptr - old_ptr] = '/'; second_table_name[ptr - old_ptr] = '\0'; } Loading innobase/include/ut0byte.h +20 −0 Original line number Diff line number Diff line Loading @@ -220,6 +220,26 @@ ut_bit_set_nth( ulint a, /* in: ulint */ ulint n, /* in: nth bit requested */ ibool val); /* in: value for the bit to set */ /**************************************************************** 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 */ /**************************************************************** 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 */ #ifndef UNIV_NONINL Loading innobase/ut/ut0byte.c +43 −0 Original line number Diff line number Diff line Loading @@ -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); } Loading
innobase/dict/dict0dict.c +11 −3 Original line number Diff line number Diff line Loading @@ -1761,9 +1761,8 @@ dict_scan_col( col = dict_table_get_nth_col(table, i); if (ut_strlen(col->name) == (ulint)(ptr - old_ptr) && 0 == ut_memcmp(col->name, old_ptr, && 0 == ut_cmp_in_lower_case(col->name, old_ptr, (ulint)(ptr - old_ptr))) { /* Found */ *success = TRUE; Loading Loading @@ -1827,11 +1826,20 @@ dict_scan_table_name( break; } } #ifdef __WIN__ ut_cpy_in_lower_case(second_table_name + i, old_ptr, ptr - old_ptr); #else ut_memcpy(second_table_name + i, old_ptr, ptr - old_ptr); #endif second_table_name[i + (ptr - old_ptr)] = '\0'; } else { #ifdef __WIN__ ut_cpy_in_lower_case(second_table_name, old_ptr, ptr - old_ptr); #else ut_memcpy(second_table_name, old_ptr, ptr - old_ptr); #endif second_table_name[dot_ptr - old_ptr] = '/'; second_table_name[ptr - old_ptr] = '\0'; } Loading
innobase/include/ut0byte.h +20 −0 Original line number Diff line number Diff line Loading @@ -220,6 +220,26 @@ ut_bit_set_nth( ulint a, /* in: ulint */ ulint n, /* in: nth bit requested */ ibool val); /* in: value for the bit to set */ /**************************************************************** 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 */ /**************************************************************** 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 */ #ifndef UNIV_NONINL Loading
innobase/ut/ut0byte.c +43 −0 Original line number Diff line number Diff line Loading @@ -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); }