summaryrefslogtreecommitdiff
path: root/sql/item_strfunc.cc
diff options
context:
space:
mode:
authorunknown <monty@hundin.mysql.fi>2002-06-19 00:22:30 +0300
committerunknown <monty@hundin.mysql.fi>2002-06-19 00:22:30 +0300
commit518787c29965d10f65a7e9c073718076aceb058c (patch)
treedf0fd78ddd1c83d577e830a40da77487a62451b7 /sql/item_strfunc.cc
parent9424f80f19a84eb667c3d588d8c0d19b833c7c28 (diff)
downloadmariadb-git-518787c29965d10f65a7e9c073718076aceb058c.tar.gz
Made keyread (key scanning) a key specific attribute.
This avoids using fulltext keys for table scanning. This also reverts Sinisa's original fix for this problem. Docs/manual.texi: Update of SQL_JOIN_MAX_SIZE information3602 client/mysqldump.c: comment cleanup include/my_aes.h: General cleanup for new file include/rijndael.h: General cleanup for new file include/sha1.h: General cleanup for new file mysys/my_aes.c: General cleanup for new file mysys/rijndael.c: General cleanup for new file mysys/sha1.c: General cleanup for new file sql/ha_berkeley.h: Made keyread (key scanning) a key specific attribute. sql/ha_innodb.cc: Merge with 3.23.x sql/ha_innodb.h: Made keyread (key scanning) a key specific attribute. sql/ha_isam.cc: Moved things to table_flags() sql/ha_isam.h: Made keyread (key scanning) a key specific attribute. sql/ha_myisam.cc: Made keyread (key scanning) a key specific attribute. sql/ha_myisam.h: Made keyread (key scanning) a key specific attribute. sql/ha_myisammrg.h: Made keyread (key scanning) a key specific attribute. sql/handler.h: Made keyread (key scanning) a key specific attribute. sql/item_strfunc.cc: Cleanup of AES_xxx code sql/opt_range.cc: Made keyread (key scanning) a key specific attribute. sql/sql_base.cc: Made keyread (key scanning) a key specific attribute. sql/sql_cache.cc: Removed compiler warning sql/sql_select.cc: Removed wrong patch to fulltext problem sql/table.cc: Made keyread (key scanning) a key specific attribute. sql/table.h: Made keyread (key scanning) a key specific attribute.
Diffstat (limited to 'sql/item_strfunc.cc')
-rw-r--r--sql/item_strfunc.cc31
1 files changed, 16 insertions, 15 deletions
diff --git a/sql/item_strfunc.cc b/sql/item_strfunc.cc
index fd52668da3f..dfb53a32910 100644
--- a/sql/item_strfunc.cc
+++ b/sql/item_strfunc.cc
@@ -153,15 +153,15 @@ String *Item_func_aes_encrypt::val_str(String *str)
null_value=0;
aes_length=my_aes_get_size(sptr->length()); // calculate result length
- if ( !str->alloc(aes_length) ) // Ensure that memory is free
+ if (!str->alloc(aes_length)) // Ensure that memory is free
{
// finally encrypt directly to allocated buffer.
- if (my_aes_encrypt(sptr->ptr(),sptr->length(),str->ptr(),key->ptr(),
- key->length()) == aes_length)
+ if (my_aes_encrypt(sptr->ptr(),sptr->length(), (char*) str->ptr(),
+ key->ptr(), key->length()) == aes_length)
{
- // we have to get expected result length
- str->length((uint) aes_length);
- return str;
+ // We got the expected result length
+ str->length((uint) aes_length);
+ return str;
}
}
}
@@ -169,9 +169,10 @@ String *Item_func_aes_encrypt::val_str(String *str)
return 0;
}
+
void Item_func_aes_encrypt::fix_length_and_dec()
{
- max_length=my_aes_get_size(args[0]->max_length);
+ max_length=my_aes_get_size(args[0]->max_length);
}
@@ -184,12 +185,12 @@ String *Item_func_aes_decrypt::val_str(String *str)
if (sptr && key) // Need to have both arguments not NULL
{
null_value=0;
- if ( !str->alloc(sptr->length()) ) // Ensure that memory is free
+ if (!str->alloc(sptr->length())) // Ensure that memory is free
{
- // finally decencrypt directly to allocated buffer.
- length=my_aes_decrypt(sptr->ptr(),sptr->length(),str->ptr(),
- key->ptr(),key->length());
- if (length>=0) // if we got correct data data
+ // finally decrypt directly to allocated buffer.
+ length=my_aes_decrypt(sptr->ptr(), sptr->length(), (char*) str->ptr(),
+ key->ptr(), key->length());
+ if (length >= 0) // if we got correct data data
{
str->length((uint) length);
return str;
@@ -208,9 +209,9 @@ void Item_func_aes_decrypt::fix_length_and_dec()
/*
-** Concatinate args with the following premissess
-** If only one arg which is ok, return value of arg
-** Don't reallocate val_str() if not absolute necessary.
+ Concatenate args with the following premises:
+ If only one arg (which is ok), return value of arg
+ Don't reallocate val_str() if not absolute necessary.
*/
String *Item_func_concat::val_str(String *str)