Loading innobase/buf/buf0flu.c +10 −2 Original line number Diff line number Diff line Loading @@ -412,6 +412,9 @@ buf_flush_write_block_low( /*======================*/ buf_block_t* block) /* in: buffer block to write */ { #ifdef UNIV_LOG_DEBUG static ibool univ_log_debug_warned; #endif /* UNIV_LOG_DEBUG */ ut_a(block->state == BUF_BLOCK_FILE_PAGE); #ifdef UNIV_IBUF_DEBUG Loading @@ -420,8 +423,13 @@ buf_flush_write_block_low( ut_ad(!ut_dulint_is_zero(block->newest_modification)); #ifdef UNIV_LOG_DEBUG fputs("Warning: cannot force log to disk in the log debug version!\n", if (!univ_log_debug_warned) { univ_log_debug_warned = TRUE; fputs( "Warning: cannot force log to disk if UNIV_LOG_DEBUG is defined!\n" "Crash recovery will not work!\n", stderr); } #else /* Force the log to the disk before writing the modified block */ log_write_up_to(block->newest_modification, LOG_WAIT_ALL_GROUPS, TRUE); Loading innobase/log/log0recv.c +3 −0 Original line number Diff line number Diff line Loading @@ -628,6 +628,9 @@ log_block_checksum_is_ok_or_old_format( format of InnoDB version < 3.23.52 */ byte* block) /* in: pointer to a log block */ { #ifdef UNIV_LOG_DEBUG return(TRUE); #endif /* UNIV_LOG_DEBUG */ if (log_block_calc_checksum(block) == log_block_get_checksum(block)) { return(TRUE); Loading innobase/row/row0mysql.c +0 −1 Original line number Diff line number Diff line Loading @@ -2284,7 +2284,6 @@ row_drop_table_for_mysql( "COMMIT WORK;\n" "END;\n"; ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); ut_a(name != NULL); if (srv_created_new_raw) { Loading myisam/mi_key.c +39 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,9 @@ static int _mi_put_key_in_record(MI_INFO *info,uint keynr,byte *record); ** Ret: Length of key */ #define my_charpos(cs, b, e, num)\ (cs)->cset->charpos((cs), (const char*) (b), (const char *)(e), (num)) uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, const byte *record, my_off_t filepos) { Loading @@ -57,6 +60,8 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, { enum ha_base_keytype type=(enum ha_base_keytype) keyseg->type; uint length=keyseg->length; uint char_length; CHARSET_INFO *cs; if (keyseg->null_bit) { Loading @@ -68,6 +73,15 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, *key++=1; /* Not NULL */ } char_length= (cs= keyseg->charset) && (cs->mbmaxlen > 1) ? length / cs->mbmaxlen : 0; if (info->s->keyinfo[keynr].flag & HA_FULLTEXT) { /* Ask Serg to make a better fix */ char_length= 0; } pos= (byte*) record+keyseg->start; if (keyseg->flag & HA_SPACE_PACK) { Loading @@ -83,6 +97,11 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, pos++; } length=(uint) (end-pos); if (char_length && length > char_length) { char_length= my_charpos(cs, pos, pos+length, char_length); set_if_smaller(length, char_length); } store_key_length_inc(key,length); memcpy((byte*) key,(byte*) pos,(size_t) length); key+=length; Loading @@ -94,13 +113,26 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, pos+=2; /* Skip VARCHAR length */ set_if_smaller(length,tmp_length); store_key_length_inc(key,length); memcpy((byte*) key, pos, length); key+= length; continue; } else if (keyseg->flag & HA_BLOB_PART) { uint tmp_length=_mi_calc_blob_length(keyseg->bit_start,pos); memcpy_fixed((byte*) &pos,pos+keyseg->bit_start,sizeof(char*)); set_if_smaller(length,tmp_length); #if NOT_YET_BLOB_PART if (char_length && length > char_length) { char_length= my_charpos(cs, pos, pos+length, char_length); set_if_smaller(length, char_length); } #endif store_key_length_inc(key,length); memcpy((byte*) key, pos, length); key+= length; continue; } else if (keyseg->flag & HA_SWAP_KEY) { /* Numerical column */ Loading Loading @@ -136,6 +168,13 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, } continue; } #ifdef NOT_YET_FIXED_LENGTH_KEY if (char_length && length > char_length) { char_length= my_charpos(cs, pos, pos+length, char_length); set_if_smaller(length, char_length); } #endif memcpy((byte*) key, pos, length); key+= length; } Loading mysql-test/r/ctype_utf8.result +33 −0 Original line number Diff line number Diff line Loading @@ -243,3 +243,36 @@ select 'zвасяz' rlike '[[:<:]]вася[[:>:]]'; CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8_unicode_ci); ALTER TABLE t1 ADD COLUMN b CHAR(20); DROP TABLE t1; create table t1 (c varchar(30) character set utf8, unique(c(10))); insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z'); insert into t1 values ('aaaaaaaaaa'); insert into t1 values ('aaaaaaaaaaa'); ERROR 23000: Duplicate entry 'aaaaaaaaaaa' for key 1 insert into t1 values ('aaaaaaaaaaaa'); ERROR 23000: Duplicate entry 'aaaaaaaaaaaa' for key 1 insert into t1 values (repeat('b',20)); select c c1 from t1 where c='1'; c1 1 select c c2 from t1 where c='2'; c2 2 select c c3 from t1 where c='3'; c3 3 select c cx from t1 where c='x'; cx x select c cy from t1 where c='y'; cy y select c cz from t1 where c='z'; cz z select c ca10 from t1 where c='aaaaaaaaaa'; ca10 aaaaaaaaaa select c cb20 from t1 where c=repeat('b',20); cb20 bbbbbbbbbbbbbbbbbbbb drop table t1; Loading
innobase/buf/buf0flu.c +10 −2 Original line number Diff line number Diff line Loading @@ -412,6 +412,9 @@ buf_flush_write_block_low( /*======================*/ buf_block_t* block) /* in: buffer block to write */ { #ifdef UNIV_LOG_DEBUG static ibool univ_log_debug_warned; #endif /* UNIV_LOG_DEBUG */ ut_a(block->state == BUF_BLOCK_FILE_PAGE); #ifdef UNIV_IBUF_DEBUG Loading @@ -420,8 +423,13 @@ buf_flush_write_block_low( ut_ad(!ut_dulint_is_zero(block->newest_modification)); #ifdef UNIV_LOG_DEBUG fputs("Warning: cannot force log to disk in the log debug version!\n", if (!univ_log_debug_warned) { univ_log_debug_warned = TRUE; fputs( "Warning: cannot force log to disk if UNIV_LOG_DEBUG is defined!\n" "Crash recovery will not work!\n", stderr); } #else /* Force the log to the disk before writing the modified block */ log_write_up_to(block->newest_modification, LOG_WAIT_ALL_GROUPS, TRUE); Loading
innobase/log/log0recv.c +3 −0 Original line number Diff line number Diff line Loading @@ -628,6 +628,9 @@ log_block_checksum_is_ok_or_old_format( format of InnoDB version < 3.23.52 */ byte* block) /* in: pointer to a log block */ { #ifdef UNIV_LOG_DEBUG return(TRUE); #endif /* UNIV_LOG_DEBUG */ if (log_block_calc_checksum(block) == log_block_get_checksum(block)) { return(TRUE); Loading
innobase/row/row0mysql.c +0 −1 Original line number Diff line number Diff line Loading @@ -2284,7 +2284,6 @@ row_drop_table_for_mysql( "COMMIT WORK;\n" "END;\n"; ut_ad(trx->mysql_thread_id == os_thread_get_curr_id()); ut_a(name != NULL); if (srv_created_new_raw) { Loading
myisam/mi_key.c +39 −0 Original line number Diff line number Diff line Loading @@ -32,6 +32,9 @@ static int _mi_put_key_in_record(MI_INFO *info,uint keynr,byte *record); ** Ret: Length of key */ #define my_charpos(cs, b, e, num)\ (cs)->cset->charpos((cs), (const char*) (b), (const char *)(e), (num)) uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, const byte *record, my_off_t filepos) { Loading @@ -57,6 +60,8 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, { enum ha_base_keytype type=(enum ha_base_keytype) keyseg->type; uint length=keyseg->length; uint char_length; CHARSET_INFO *cs; if (keyseg->null_bit) { Loading @@ -68,6 +73,15 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, *key++=1; /* Not NULL */ } char_length= (cs= keyseg->charset) && (cs->mbmaxlen > 1) ? length / cs->mbmaxlen : 0; if (info->s->keyinfo[keynr].flag & HA_FULLTEXT) { /* Ask Serg to make a better fix */ char_length= 0; } pos= (byte*) record+keyseg->start; if (keyseg->flag & HA_SPACE_PACK) { Loading @@ -83,6 +97,11 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, pos++; } length=(uint) (end-pos); if (char_length && length > char_length) { char_length= my_charpos(cs, pos, pos+length, char_length); set_if_smaller(length, char_length); } store_key_length_inc(key,length); memcpy((byte*) key,(byte*) pos,(size_t) length); key+=length; Loading @@ -94,13 +113,26 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, pos+=2; /* Skip VARCHAR length */ set_if_smaller(length,tmp_length); store_key_length_inc(key,length); memcpy((byte*) key, pos, length); key+= length; continue; } else if (keyseg->flag & HA_BLOB_PART) { uint tmp_length=_mi_calc_blob_length(keyseg->bit_start,pos); memcpy_fixed((byte*) &pos,pos+keyseg->bit_start,sizeof(char*)); set_if_smaller(length,tmp_length); #if NOT_YET_BLOB_PART if (char_length && length > char_length) { char_length= my_charpos(cs, pos, pos+length, char_length); set_if_smaller(length, char_length); } #endif store_key_length_inc(key,length); memcpy((byte*) key, pos, length); key+= length; continue; } else if (keyseg->flag & HA_SWAP_KEY) { /* Numerical column */ Loading Loading @@ -136,6 +168,13 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key, } continue; } #ifdef NOT_YET_FIXED_LENGTH_KEY if (char_length && length > char_length) { char_length= my_charpos(cs, pos, pos+length, char_length); set_if_smaller(length, char_length); } #endif memcpy((byte*) key, pos, length); key+= length; } Loading
mysql-test/r/ctype_utf8.result +33 −0 Original line number Diff line number Diff line Loading @@ -243,3 +243,36 @@ select 'zвасяz' rlike '[[:<:]]вася[[:>:]]'; CREATE TABLE t1 (a enum ('Y', 'N') DEFAULT 'N' COLLATE utf8_unicode_ci); ALTER TABLE t1 ADD COLUMN b CHAR(20); DROP TABLE t1; create table t1 (c varchar(30) character set utf8, unique(c(10))); insert into t1 values ('1'),('2'),('3'),('x'),('y'),('z'); insert into t1 values ('aaaaaaaaaa'); insert into t1 values ('aaaaaaaaaaa'); ERROR 23000: Duplicate entry 'aaaaaaaaaaa' for key 1 insert into t1 values ('aaaaaaaaaaaa'); ERROR 23000: Duplicate entry 'aaaaaaaaaaaa' for key 1 insert into t1 values (repeat('b',20)); select c c1 from t1 where c='1'; c1 1 select c c2 from t1 where c='2'; c2 2 select c c3 from t1 where c='3'; c3 3 select c cx from t1 where c='x'; cx x select c cy from t1 where c='y'; cy y select c cz from t1 where c='z'; cz z select c ca10 from t1 where c='aaaaaaaaaa'; ca10 aaaaaaaaaa select c cb20 from t1 where c=repeat('b',20); cb20 bbbbbbbbbbbbbbbbbbbb drop table t1;