diff options
author | unknown <monty@donna.mysql.fi> | 2001-05-09 23:02:36 +0300 |
---|---|---|
committer | unknown <monty@donna.mysql.fi> | 2001-05-09 23:02:36 +0300 |
commit | 0fece375f2ae4bb173357609b46924a997113593 (patch) | |
tree | 288f7cc7d0ca91ae340b7a568971bb02d8eb798d /sql/item_strfunc.cc | |
parent | 2321260ff07b0a90e3f84c756370a328ac17f990 (diff) | |
download | mariadb-git-0fece375f2ae4bb173357609b46924a997113593.tar.gz |
Applied patches for BDB tables
Fixes to InnoDB to compile on Windows
Fix for temporary InnoDB tables
Fixed bug in REPLACE()
Fixed sub char keys for InnoDB
Docs/manual.texi:
Changelog + update of table types
bdb/include/log.h:
Patch from Sleepycat
bdb/log/log.c:
Patch from Sleepycat
bdb/log/log_rec.c:
Patch from Sleepycat
client/mysqladmin.c:
Cleanup
innobase/include/univ.i:
Fix for compilation on Windows
innobase/os/os0file.c:
cleanup
innobase/pars/pars0grm.y:
Fix for compilation on Windows
mysql-test/r/innodb.result:
New test case
mysql-test/t/innodb.test:
New test case
sql/ha_innobase.cc:
cleanup
sql/ha_innobase.h:
Fix for prefix keys
sql/handler.h:
Fix for temporary Innodb tables
sql/item_strfunc.cc:
Fixed bug in REPLACE()
sql/lock.cc:
Fix for temporary Innodb tables
sql/mysqld.cc:
Added --skip-stack-trace
sql/share/english/errmsg.txt:
Better error messages
sql/sql_base.cc:
Fix for temporary Innodb tables
sql/sql_select.cc:
Fix for temporary Innodb tables
sql/sql_table.cc:
Fixed sub char keys for InnoDB
sql/table.h:
Fix for temporary Innodb tables
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r-- | sql/item_strfunc.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc index 82dcb0268b4..80f72c30e57 100644 --- a/sql/item_strfunc.cc +++ b/sql/item_strfunc.cc @@ -393,12 +393,14 @@ void Item_func_reverse::fix_length_and_dec() String *Item_func_replace::val_str(String *str) { String *res,*res2,*res3; - int offset=0; + int offset; uint from_length,to_length; bool alloced=0; #ifdef USE_MB const char *ptr,*end,*strend,*search,*search_end; register uint32 l; + bool binary_str = (args[0]->binary || args[1]->binary || + !use_mb(default_charset_info)); #endif null_value=0; @@ -415,7 +417,8 @@ String *Item_func_replace::val_str(String *str) if ((offset=res->strstr(*res2)) < 0) return res; #else - if (!use_mb(default_charset_info) && (offset=res->strstr(*res2)) < 0) + offset=0; + if (binary_str && (offset=res->strstr(*res2)) < 0) return res; #endif if (!(res3=args[2]->val_str(&tmp_value2))) @@ -424,7 +427,7 @@ String *Item_func_replace::val_str(String *str) to_length= res3->length(); #ifdef USE_MB - if (use_mb(default_charset_info)) + if (!binary_str) { search=res2->ptr(); search_end=search+from_length; @@ -449,6 +452,7 @@ redo: res=copy_if_not_alloced(str,res,res->length()+to_length); } res->replace((uint) offset,from_length,*res3); + offset+=(int) to_length; goto redo; } skipp: |