summaryrefslogtreecommitdiff
path: root/sql/item_func.cc
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2001-11-22 13:50:50 +0200
committerunknown <monty@hundin.mysql.fi>2001-11-22 13:50:50 +0200
commitd576cd65d00d23b634e0ef4254660e67c055c045 (patch)
tree8c1d3e9b787e1017fce3c9e905b829557889f97a /sql/item_func.cc
parent5975e2364942dfcf8bca2fcc8e3107b16dd2fa46 (diff)
downloadmariadb-git-d576cd65d00d23b634e0ef4254660e67c055c045.tar.gz
Fix bug when repairing compressed MyISAM files
LOCATE() is now case sensitive BUILD/compile-alpha-cxx: Don't build manager because it fails with linker error on Linux Alpha Docs/manual.texi: Changelog myisam/mi_check.c: Fix bug when repairing compressed MyISAM files myisam/mi_open.c: Fix bug when repairing compressed MyISAM files myisam/mi_packrec.c: Fix bug when repairing compressed MyISAM files myisam/myisamchk.c: Fix bug when repairing compressed MyISAM files myisam/myisamdef.h: Fix bug when repairing compressed MyISAM files mysql-test/r/func_group.result: Fix result for new RND function mysql-test/r/func_math.result: Fix result for new RND function mysql-test/r/func_str.result: test of new locate() mysql-test/t/func_str.test: test of new locate() sql/item_func.cc: LOCATE() is now case sensitive sql/sql_string.cc: LOCATE() is now case sensitive sql/sql_string.h: LOCATE() is now case sensitive
Diffstat (limited to 'sql/item_func.cc')
-rw-r--r--sql/item_func.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/sql/item_func.cc b/sql/item_func.cc
index 6657d860592..91ec8826f73 100644
--- a/sql/item_func.cc
+++ b/sql/item_func.cc
@@ -621,8 +621,9 @@ double Item_func_rand::val()
{
if (arg_count)
{ // Only use argument once in query
- ulong tmp=((ulong) args[0]->val_int());
- randominit(&current_thd->rand,tmp*0x10001L+55555555L,tmp*0x10000001L);
+ uint32 tmp= (uint32) (args[0]->val_int());
+ randominit(&current_thd->rand,(uint32) (tmp*0x10001L+55555555L),
+ (uint32) (tmp*0x10000001L));
#ifdef DELETE_ITEMS
delete args[0];
#endif
@@ -797,9 +798,7 @@ longlong Item_func_locate::val_int()
{
String *a=args[0]->val_str(&value1);
String *b=args[1]->val_str(&value2);
-#ifdef USE_MB
bool binary_str = args[0]->binary || args[1]->binary;
-#endif
if (!a || !b)
{
null_value=1;
@@ -853,7 +852,8 @@ longlong Item_func_locate::val_int()
return 0;
}
#endif /* USE_MB */
- return (longlong) (a->strstr(*b,start)+1) ;
+ return (longlong) (binary ? a->strstr(*b,start) :
+ (a->strstr_case(*b,start)))+1;
}