mirror of
https://github.com/MariaDB/server.git
synced 2026-05-06 23:25:34 +02:00
Merge with new VARCHAR code
configure.in: Auto merged BitKeeper/deleted/.del-acinclude.m4~f4ab416bac5003: Auto merged BitKeeper/deleted/.del-ha_isam.cc~4dce65904db2675e: Auto merged BitKeeper/deleted/.del-ha_isammrg.cc~dc682e4755d77a2e: Auto merged client/mysqldump.c: Auto merged client/mysqltest.c: Auto merged heap/hp_create.c: Auto merged heap/hp_delete.c: Auto merged heap/hp_hash.c: Auto merged heap/hp_write.c: Auto merged include/decimal.h: Auto merged include/m_ctype.h: Auto merged libmysql/libmysql.c: Auto merged libmysqld/Makefile.am: Auto merged myisam/mi_check.c: Auto merged myisam/mi_create.c: Auto merged myisam/mi_write.c: Auto merged mysql-test/r/ctype_tis620.result: Auto merged mysql-test/r/ctype_ucs.result: Auto merged mysql-test/r/myisam.result: Auto merged mysql-test/r/mysqldump.result: Auto merged mysql-test/r/order_by.result: Auto merged mysql-test/r/ps.result: Auto merged mysql-test/r/ps_1general.result: Auto merged mysql-test/r/ps_2myisam.result: Auto merged mysql-test/r/ps_3innodb.result: Auto merged mysql-test/r/ps_4heap.result: Auto merged mysql-test/r/ps_5merge.result: Auto merged mysql-test/r/ps_6bdb.result: Auto merged mysql-test/r/select.result: Auto merged mysql-test/r/strict.result: Auto merged mysql-test/r/subselect.result: Auto merged mysql-test/r/type_blob.result: Auto merged mysql-test/t/ctype_ucs.test: Auto merged mysql-test/t/endspace.test: Auto merged mysql-test/t/myisam.test: Auto merged mysql-test/t/ps_1general.test: Auto merged mysql-test/t/strict.test: Auto merged mysql-test/t/type_blob.test: Auto merged ndb/src/common/util/NdbSqlUtil.cpp: Auto merged scripts/mysql_fix_privilege_tables.sh: Auto merged sql/field.h: Auto merged sql/field_conv.cc: Auto merged sql/ha_heap.cc: Auto merged sql/ha_innodb.cc: Auto merged sql/ha_innodb.h: Auto merged sql/ha_myisam.cc: Auto merged sql/ha_ndbcluster.cc: Auto merged sql/handler.h: Auto merged sql/item_cmpfunc.cc: Auto merged sql/item_sum.cc: Auto merged sql/opt_range.cc: Auto merged sql/opt_sum.cc: Auto merged sql/protocol.cc: Auto merged sql/sql_base.cc: Auto merged sql/sql_help.cc: Auto merged sql/sql_select.cc: Auto merged sql/sql_yacc.yy: Auto merged sql/structs.h: Auto merged sql/table.cc: Auto merged strings/ctype-czech.c: Auto merged strings/ctype-uca.c: Auto merged strings/ctype-utf8.c: Auto merged strings/ctype-win1250ch.c: Auto merged strings/decimal.c: Auto merged tests/client_test.c: Auto merged mysql-test/r/bdb.result: Merge with VARCHAR code mysql-test/r/heap.result: Merge with VARCHAR code mysql-test/r/innodb.result: Merge with VARCHAR code mysql-test/r/select.result.es: Merge with VARCHAR code mysql-test/t/bdb.test: Merge with VARCHAR code mysql-test/t/heap.test: Merge with VARCHAR code mysql-test/t/innodb.test: Merge with VARCHAR code sql/field.cc: Merge with VARCHAR code sql/item.cc: Merge with VARCHAR code sql/sql_acl.cc: Merge with VARCHAR code sql/sql_parse.cc: Merge with VARCHAR code sql/sql_table.cc: Merge with VARCHAR code sql/sql_update.cc: Merge with VARCHAR code sql/table.h: Merge with VARCHAR code strings/ctype-mb.c: Don't pad my_like_range with max_str for simple LIKE expression strings/ctype-tis620.c: Merge with VARCHAR code strings/ctype-ucs2.c: Added new argument to my_strnncollsp_ucs2() Simply code
This commit is contained in:
commit
8379b61efb
167 changed files with 3257 additions and 19116 deletions
|
|
@ -362,6 +362,9 @@ static int my_strnncoll_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
|
|||
slen Length of 's'
|
||||
t String to compare
|
||||
tlen Length of 't'
|
||||
diff_if_only_endspace_difference
|
||||
Set to 1 if the strings should be regarded as different
|
||||
if they only difference in end space
|
||||
|
||||
NOTE
|
||||
This function is used for character strings with binary collations.
|
||||
|
|
@ -376,10 +379,16 @@ static int my_strnncoll_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
|
|||
|
||||
static int my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
|
||||
const uchar *a, uint a_length,
|
||||
const uchar *b, uint b_length)
|
||||
const uchar *b, uint b_length,
|
||||
my_bool diff_if_only_endspace_difference)
|
||||
{
|
||||
const uchar *end;
|
||||
uint length;
|
||||
int res;
|
||||
|
||||
#ifndef VARCHAR_WITH_DIFF_ENDSPACE_ARE_DIFFERENT_FOR_UNIQUE
|
||||
diff_if_only_endspace_difference= 0;
|
||||
#endif
|
||||
|
||||
end= a + (length= min(a_length, b_length));
|
||||
while (a < end)
|
||||
|
|
@ -387,9 +396,12 @@ static int my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
|
|||
if (*a++ != *b++)
|
||||
return ((int) a[-1] - (int) b[-1]);
|
||||
}
|
||||
res= 0;
|
||||
if (a_length != b_length)
|
||||
{
|
||||
int swap= 0;
|
||||
if (diff_if_only_endspace_difference)
|
||||
res= 1; /* Assume 'a' is bigger */
|
||||
/*
|
||||
Check the next not space character of the longer key. If it's < ' ',
|
||||
then it's smaller than the other key.
|
||||
|
|
@ -400,6 +412,7 @@ static int my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
|
|||
a_length= b_length;
|
||||
a= b;
|
||||
swap= -1; /* swap sign of result */
|
||||
res= -res;
|
||||
}
|
||||
for (end= a + a_length-length; a < end ; a++)
|
||||
{
|
||||
|
|
@ -407,7 +420,7 @@ static int my_strnncollsp_mb_bin(CHARSET_INFO * cs __attribute__((unused)),
|
|||
return ((int) *a - (int) ' ') ^ swap;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
|
|
@ -523,9 +536,15 @@ my_bool my_like_range_mb(CHARSET_INFO *cs,
|
|||
if (charlen < (uint) (min_str - min_org))
|
||||
min_str= min_org + charlen;
|
||||
|
||||
/* Write min key */
|
||||
*min_length= (uint) (min_str - min_org);
|
||||
/*
|
||||
Calculate length of keys:
|
||||
'a\0\0... is the smallest possible string when we have space expand
|
||||
a\ff\ff... is the biggest possible string
|
||||
*/
|
||||
*min_length= ((cs->state & MY_CS_BINSORT) ? (uint) (min_str - min_org) :
|
||||
res_length);
|
||||
*max_length= res_length;
|
||||
/* Create min key */
|
||||
do
|
||||
{
|
||||
*min_str++= (char) cs->min_sort_char;
|
||||
|
|
@ -541,14 +560,14 @@ my_bool my_like_range_mb(CHARSET_INFO *cs,
|
|||
}
|
||||
*min_str++= *max_str++ = *ptr;
|
||||
}
|
||||
*min_length= *max_length = (uint) (min_str - min_org);
|
||||
|
||||
*min_length= *max_length = (uint) (min_str - min_org);
|
||||
while (min_str != min_end)
|
||||
*min_str++= ' '; /* Because if key compression */
|
||||
pad_max_char(cs, max_str, max_end);
|
||||
*min_str++= *max_str= ' '; /* Because if key compression */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
static int my_wildcmp_mb_bin(CHARSET_INFO *cs,
|
||||
const char *str,const char *str_end,
|
||||
const char *wildstr,const char *wildend,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue