From 518787c29965d10f65a7e9c073718076aceb058c Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 19 Jun 2002 00:22:30 +0300 Subject: 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. --- sql/item_strfunc.cc | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'sql/item_strfunc.cc') 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) -- cgit v1.2.1