Commit graph

398 commits

Author SHA1 Message Date
unknown
a9eebc9986 Merge siva.hindu.god:/usr/home/tim/m/bk/b20536-41
into  siva.hindu.god:/usr/home/tim/m/bk/41


sql/item_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
2006-08-23 16:30:05 -06:00
unknown
3212b399a8 Bug #20536: md5() with GROUP BY and UCS2 return different results on myisam/innodb
Make the encryption functions MD5(), SHA1() and ENCRYPT() return binary results.
    
Make MAKE_SET() and EXPORT_SET() use the correct character set for their default separator strings.


mysql-test/r/ctype_ucs.result:
  Add tests for bug #20536.
mysql-test/t/ctype_ucs.test:
  Add tests for bug #20536.
  
  Tests showing correct behavior for MD5(), SHA1(), MAKE_SET() and EXPORT_SET().
  
  Also, tests showing incorrect behavior, which will remain "Won't fix", for
  PASSWORD(), OLD_PASSWORD(), ENCRYPT() and QUOTE().
sql/item_strfunc.cc:
  Make the encryption functions MD5(), SHA1() and ENCRYPT() return binary results.
  
  Make MAKE_SET() and EXPORT_SET() use the correct character set for their default separator strings.
sql/item_strfunc.h:
  Make the encryption functions MD5(), SHA1() and ENCRYPT() return binary results.
2006-08-11 17:09:19 -06:00
unknown
6ec7976df9 Fixed bug #17526: incorrect print method
for class Item_func_trim. 
For 4.1 it caused wrong output for EXPLAIN EXTENDED commands
if expressions with the TRIM function of two arguments were used.
For 5.0 it caused an error message when trying to select
from a view with the TRIM function of two arguments.
This unexpected error message was due to the fact that the
print method for the class Item_func_trim was inherited from
the class Item_func. Yet the TRIM function does not take a list
of its arguments. Rather it takes the arguments in the form:
  [{BOTH | LEADING | TRAILING} [remstr] FROM] str) |
  [remstr FROM] str


mysql-test/r/func_str.result:
  Added a test case for bug #17526: uncorrect print method
  for class Item_func_trim.
mysql-test/t/func_str.test:
  Added a test case for bug #17526: incorrect print method
  for class Item_func_trim.
sql/item_strfunc.cc:
  Fixed bug #17526: incorrect print method
  for class Item_func_trim.
      
  Added an implementation for the virtual function print
  in the class Item_func_trim.
  The implementation takes into account the fact the TRIM
  function takes the arguments in the following forms:
    [{BOTH | LEADING | TRAILING} [remstr] FROM] str) |
    [remstr FROM] str
sql/item_strfunc.h:
  Fixed bug #17526: incorrect print method
  for class Item_func_trim.
      
  Added an implementation for the virtual function print
  in the class Item_func_trim.
  Declared a virtual method to return the mode of the TRIM 
  function: LEADING, TRAILING or BOTH.
  Added implementations of this method for Item_func_trim and
  its descendants Item_func_ltrim and Item_func_rtrim.
2006-07-19 12:36:55 -07:00
unknown
cf7627bce0 Fixed bug #18243.
The implementation of the method Item_func_reverse::val_str
for the REVERSE function modified the argument of the function.
This led to wrong results for expressions that contained
REVERSE(ref) if ref occurred somewhere else in the expressions.


mysql-test/r/func_str.result:
  Added a test case for bug #18243.
mysql-test/t/func_str.test:
  Added a test case for bug #18243.
sql/item_strfunc.cc:
  Fixed bug #18243.
  The implementation of the method Item_func_reverse::val_str
  for the REVERSE function modified the argument of the function.
  This led to wrong results for expressions that contained
  REVERSE(ref) if ref occurred somewhere else in the expressions.
  
  The implementation of Item_func_reverse::val_str has been changed
  to make the argument intact.
sql/item_strfunc.h:
  Fixed bug #18243.
  Added tmp_value to the Item_func_reverse class to store
  the result of the function. It erroneously replaced the 
  argument before this fix.
2006-07-06 11:11:49 -07:00
unknown
ca22a81b1c item_strfunc.cc:
Fix for bug#16716 for --ps-protocol mode.
item_cmpfunc.cc:
  Fix for a memory allocation/freeing problem in agg_cmp_type() after fix
for bug#16377. Few language corrections.


sql/item_cmpfunc.cc:
  Fix for a memory allocation/freeing problem in agg_cmp_type(). Few language corrections.
sql/item_strfunc.cc:
  Fix for bug#16716 for --ps-protocol mode.
2006-06-16 23:46:37 +04:00
unknown
99c320d7cf Merge moonbone.local:/work/15351-bug-4.1-mysql
into moonbone.local:/home/evgen/bk-trees/mysql-4.1-opt


sql/item_strfunc.cc:
  Auto merged
2006-06-15 14:57:53 +04:00
unknown
fd7d4d7429 Fixed bug#15351: Wrong collation used for comparison of md5() and sha()
argument can lead to a wrong result.

md5() and sha() functions treat their arguments as case sensitive strings.
But when they are compared their arguments were compared as a case
insensitive strings which leads to two functions with different arguments
and thus different results to being identical. This can lead to a wrong
decision made in the range optimizer and thus lead to a wrong result set.

Item_func_md5::fix_length_and_dec() and Item_func_sha::fix_length_and_dec()
functions now set binary collation on their arguments.


sql/item_strfunc.cc:
  Fixed bug#15351: Wrong collation used for comparison of md5() and sha()
  argument can lead to a wrong result.
  Item_func_md5::fix_length_and_dec() and Item_func_sha::fix_length_and_dec()
  functions now set binary collation on their arguments.
mysql-test/r/func_str.result:
   Added test case for the bug#15351: Wrong collation used for comparison of md5() and sha()
  argument can lead to a wrong result.
mysql-test/t/func_str.test:
  Added test case for the bug#15351: Wrong collation used for comparison of md5() and sha()
  argument can lead to a wrong result.
2006-05-28 22:01:38 +04:00
unknown
1991a87d83 Fixed bug#16716: subselect in concat() may lead to a wrong result.
The Item_func_concat::val_str() function tries to make as less re-allocations
as possible. This results in appending strings returned by 2nd and next
arguments to the string returned by 1st argument if the buffer for the first
argument has enough free space. A constant subselect is evaluated only once 
and its result is stored in an Item_cache_str. In the case when the first
argument of the concat() function is such a subselect Item_cache_str returns
the stored value and Item_func_concat::val_str() append values of other
arguments to it. But for the next row the value in the Item_cache_str isn't
restored because the subselect is a constant one and it isn't evaluated second
time. This results in appending string values of 2nd and next arguments to the 
result of the previous Item_func_concat::val_str() call.

The Item_func_concat::val_str() function now checks whether the first argument 
is a constant one and if so it doesn't append values of 2nd and next arguments
to the string value returned by it.


mysql-test/t/func_concat.test:
  Added test case for bug#16716: subselect in concat() may lead to a wrong result.
mysql-test/r/func_concat.result:
  Added test case for bug#16716: subselect in concat() may lead to a wrong result.
sql/item_strfunc.cc:
  Fixed bug#16716: subselect in concat() may lead to a wrong result.
  The Item_func_concat::val_str() function now checks whether the first argument 
  is a constant one and if so it doesn't append values of 2nd and next arguments
  to the string value returned by it.
2006-05-26 01:24:14 +04:00
unknown
dd934da915 Bug#10418: LOAD_FILE does not behave like in manual if file does not exist
load_file() string-function should return NULL rather than throw an error if
the file doesn't exist, as per the manual.


mysql-test/t/outfile.test:
  expect NULL rather than error if file given to load_file() doesn't exist
mysql-test/t/func_str.test:
  show that load_file() will return NULL rather than throw an error
  if file doesn't exist
mysql-test/r/outfile.result:
  expect NULL rather than error if file given to load_file() doesn't exist
mysql-test/r/func_str.result:
  expect NULL rather than error if file given to load_file() doesn't exist
sql/item_strfunc.cc:
  load_file() should return NULL as per the docs if file not found,
  rather than throw an error
2006-05-08 04:37:58 +02:00
unknown
5c87b55f7e Fix for bug #18643: crazy UNCOMPRESS().
mysql-test/r/func_compress.result:
  Fix for bug #18643: crazy UNCOMPRESS().
    - test-case
mysql-test/t/func_compress.test:
  Fix for bug #18643: crazy UNCOMPRESS().
    - test-case
sql/item_strfunc.cc:
  Fix for bug #18643: crazy UNCOMPRESS().
    - set null_value.
2006-04-13 16:19:21 +05:00
unknown
31ff9e9a10 A fix for Bug#13944 "libmysqlclient exporting sha1_result function":
rename sha1_* to mysql_sha1_*


include/sha1.h:
  rename sha1_* to mysql_sha1_*
mysys/sha1.c:
  rename sha1_* to mysql_sha1_*
sql/item_strfunc.cc:
  rename sha1_* to mysql_sha1_*
sql/password.c:
  rename sha1_* to mysql_sha1_*
2006-01-11 17:31:52 +03:00
unknown
72d19611d1 Bug#10446 Illegal mix of collations:
item_strfunc.h, item_strfunc.cc, item.cc:
  Try to convert a const item into destination 
  character set. If conversion happens without
  data loss, then cache the converted value
  and return it during val_str().
  Otherwise, if conversion loses data, return
  Illeral mix of collations error, as it happened
  previously.
ctype_recoding.result, ctype_recoding.test:
  Fixing tests accordingly.


sql/item.cc:
  Bug#10446 Illegal mix of collations
  Try to convert a const item into destination 
  character set. If conversion happens without
  data loss, then cache the converted value
  and return it during val_str().
  Otherwise, if conversion loses data, return
  Illeral mix of collations error, as it happened
  previously.
sql/item_strfunc.cc:
  Return cached value when it's possible.
mysql-test/t/ctype_recoding.test:
  Fixing tests accordingly.
mysql-test/r/ctype_recoding.result:
  Fixing tests accordingly.
2005-11-21 17:26:31 +04:00
unknown
041123bade Handle errors returned by system crypt() in ENCRYPT(). (Bug #13619)
mysql-test/r/func_crypt.result:
  Add new results
mysql-test/t/func_crypt.test:
  Add new regression test
sql/item_strfunc.cc:
  Handle NULL result from call to crypt().
2005-10-06 16:15:53 -07:00
unknown
6c555e7db5 Fix crash in DES_DECRYPT(NULL). (Bug #12757)
sql/item_strfunc.cc:
  Don't call res->length() when res may be NULL because args[0] is a NULL.
2005-08-25 12:34:42 -07:00
unknown
058d5bff6e Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/bar/mysql-4.1.b12351


sql/item_strfunc.cc:
  Auto merged
2005-08-12 15:44:03 +05:00
unknown
7a3cf49389 merge
BitKeeper/deleted/.del-query_cache_notembedded.result:
  Delete: mysql-test/r/query_cache_notembedded.result
BitKeeper/deleted/.del-query_cache_notembedded.test:
  Delete: mysql-test/t/query_cache_notembedded.test
mysql-test/r/func_str.result:
  Auto merged
mysql-test/t/func_str.test:
  Auto merged
2005-08-11 10:20:06 +03:00
unknown
10805ec234 item_strfunc.cc:
BUG #11104 
      Took out the offset-=delimiter_length-1 out of the for loop. It was causing
      basically this: 
      select substring_index('the king of the the hill', 'the', -2) to not work.
      The first iteration, offset would be initialised to 24, then strstr would 
      point at 'the king of the the* hill' ('*'means right before the 
      character following), returning a offset of 16. The for loop would then 
      decrement offset by two (3 - 1), to 14, now pointing at 
      "the king of th*e the hill", _skipping_ past the 'e' in the second to last
      'the', and therefore strstr would never have a chance of matching the 
      second to last 'the', then moving on to the 'the' at the begginning of the 
      string!
      In a nutshell, offset was being decremented by too great a value, preventing
      the second to last 'the' from being ever found, hence the result of 
      'king of the the hill' from the query that is reported in the bug report
func_str.test:
  BUG #11104
  Added tests to make sure fix addresses issues in original bug report
func_str.result:
  BUG #11104 
  New results for new tests


mysql-test/r/func_str.result:
  BUG #11104 
  
  New results for new tests
mysql-test/t/func_str.test:
  BUG #11104
  
  Added tests to make sure fix addresses issues in original bug report
sql/item_strfunc.cc:
  BUG #11104 
      Took out the offset-=delimiter_length-1 out of the for loop. It was causing
      basically this: 
      select substring_index('the king of the the hill', 'the', -2) to not work.
      The first iteration, offset would be initialised to 24, then strstr would 
      point at 'the king of the the* hill' ('*'means right before the 
      character following), returning a offset of 16. The for loop would then 
      decrement offset by two (3 - 1), to 14, now pointing at 
      "the king of th*e the hill", _skipping_ past the 'e' in the second to last
      'the', and therefore strstr would never have a chance of matching the 
      second to last 'the', then moving on to the 'the' at the begginning of the 
      string!
  
      In a nutshell, offset was being decremented by too great a value, preventing
      the second to last 'the' from being ever found, hence the result of 
      'king of the the hill' from the query that is reported in the bug report
2005-08-08 13:46:13 -07:00
unknown
d3a6f4082f func_system.result, func_system.test:
adding test case
item_strfunc.cc:
  Bug#12351
  CONCAT with USER()/DATEBASE() and
  a column gets strange results.
  Mark created Item_str as constant, so CONCAT
  cannot reuse it for optimization purposes.


sql/item_strfunc.cc:
  Bug#12351
  CONCAT with USER()/DATEBASE() and
  a column gets strange results
mysql-test/t/func_system.test:
  adding test case
mysql-test/r/func_system.result:
  adding test case
2005-08-08 19:09:54 +05:00
unknown
16c4593089 BUG 11104 (same as changeset 1.1891 on the 5.0 tree, but realised this
needed to be fixed in earlier versions)
Fixed the iteration of how substrings are handled with negative indexes in 
SUBSTRING_INDEX


mysql-test/r/func_str.result:
  New results for the fix to substring_index
mysql-test/t/func_str.test:
  Added tests for fix to substring_index, various lenth search patterns. Also included
  are the queuries the user who reported the bug listed in the bug report
sql/item_strfunc.cc:
  Fix to BUG 11104 
      Took out the offset-=delimiter_length-1 out of the for loop. It was causing
      basically this: 
      select substring_index('the king of the the hill', 'the', -2) to not work.
      The first iteration, offset would be initialised to 24, then strstr would 
      point at 'the king of the the* hill' ('*'means right before the 
      character following), returning a offset of 16. The for loop would then 
      decrement offset by two (3 - 1), to 14, now pointing at 
      "the king of th*e the hill", _skipping_ past the 'e' in the second to last
      'the', and therefore strstr would never have a chance of matching the 
      second to last 'the', then moving on to the 'the' at the begginning of the 
      string!
  
      In a nutshell, offset was being decremented by too great a value, preventing
      the second to last 'the' from being ever found, hence the result of 
      'king of the the hill' from the query that is reported in the bug report
2005-07-31 21:28:52 -07:00
unknown
657a5346e4 Fix calculation for length of LPAD() and RPAD() reported to
client via mysql_fetch_fields(). (Bug #11311)


mysql-test/r/func_str.result:
  Add new results
mysql-test/t/func_str.test:
  Add new regression test
sql/item_strfunc.cc:
  Fix length reported for LPAD() and RPAD() -- they always truncate to the
  length that is given.
2005-07-22 11:46:29 -07:00
unknown
3a31f7b91f Simple fixes during review of new code
include/my_global.h:
  Added floatget() to read unaligned flaot
mysql-test/r/select.result:
  Added test for found_rows()
mysql-test/t/select.test:
  Added test for found_rows()
sql/des_key_file.cc:
  Moved initalization of LOCK_des_key_file to mysqld to make simpler code and avoid theoretical race condition
sql/field_conv.cc:
  Added optimizzed varsion of do_cut_string (for simple character sets)
sql/item_func.cc:
  Simplify code (and ensure DBUG_ENTER is excuted before main code)
sql/item_strfunc.cc:
  Safe calculation of max_length
  This was needed as max_length can now be 1<<32-1 (after konstantins recent patch to fix BLOB_LENGTH)
  Remove init_des_key_file() as this is not initialized in mysqld.cc
sql/item_timefunc.cc:
  Safe calculation of max_length
  This was needed as max_length can now be 1<<32-1 (after konstantins recent patch to fix BLOB_LENGTH)
sql/log_event.cc:
  Simplify code
sql/mysql_priv.h:
  Moved initalization of LOCK_des_key_file to mysqld to make simpler code and avoid theoretical race condition
sql/mysqld.cc:
  Moved initalization of LOCK_des_key_file to mysqld to make simpler code and avoid theoretical race condition
  Revert wrong patch of calling close_connection() in first close_connections() loop. (Bug #7403)
  Instead we now print a warning for closed connections only if mysqld is sarted with --warnings
  Added comments to make the close_connections() logic clearer
sql/sql_prepare.cc:
  Use floatget() and doubleget() to protect against unaligned data
sql/sql_select.cc:
  Fixed some cases unlikely cases where found_rows() would return wrong for queries that would return 0 or 1 rows
2005-07-19 19:25:05 +03:00
unknown
3ae23d5b9e Bug #9854 hex() and out of range handling
added out of range handling
2005-07-13 14:23:09 +05:00
unknown
41b038b548 Merge mysql.com:/home/jimw/my/mysql-4.1-11643
into  mysql.com:/home/jimw/my/mysql-4.1-clean


sql/item_strfunc.cc:
  Auto merged
BitKeeper/etc/config:
  Resolve conflict
2005-07-12 09:31:07 -07:00
unknown
01b66f3f34 Fix crash caused by calling DES_ENCRYPT() without the --des-key-file
option having been passed to the server. (Bug #11643)


sql/des_key_file.cc:
  Split initialization of mutex to new function, and make sure static
  initialization variable is initialized.
sql/item_strfunc.cc:
  Make sure to initialize mutex before using it
sql/mysql_priv.h:
  Add init_des_key_file() declaration
mysql-test/r/func_des_encrypt.result:
  New BitKeeper file ``mysql-test/r/func_des_encrypt.result''
mysql-test/t/func_des_encrypt.test:
  New BitKeeper file ``mysql-test/t/func_des_encrypt.test''
BitKeeper/etc/config:
  Disable openlogging
2005-07-07 11:49:44 -07:00
unknown
2637338014 fixed substring() length calculation in case of constant negative argument (BUG#10269)
mysql-test/r/func_str.result:
  Correct length reporting from substring()
mysql-test/t/func_str.test:
  Correct length reporting from substring()
sql/item_strfunc.cc:
  fixed substring() length calculation in case of constant negative argument
2005-06-28 21:45:11 +03:00
unknown
76d444fcb6 Portability fixes
Fixes while reviewing new pushed code
NULL as argument to encrypt/decrypt should return NULL without a warning


client/mysqldump.c:
  Cleanup
  Ensure we free allocated memory
  Portability fixes
client/mysqltest.c:
  Cleanup of code during review
  Portability fixes (Don't use 'bool')
mysql-test/r/func_encrypt.result:
  NULL as argument to encrypt/decrypt should return NULL without a warning
mysql-test/r/func_encrypt_nossl.result:
  Added test of NULL argument
mysql-test/t/func_encrypt_nossl.test:
  Added test of NULL argument
sql/handler.cc:
  Cleanup during code review
sql/item_strfunc.cc:
  NULL as argument to encrypt/decrypt should return NULL without a warning
sql/sql_parse.cc:
  Fix wrong merge (fix was not needed as the previous code was reverted)
sql/sql_table.cc:
  Removed extra new line
2005-06-27 20:31:00 +03:00
unknown
2e0ac6d642 BUG#10589: des_encrypt functionality always return NULL
- Push warnings if des_encrypt or des_descrypt function fails because of out of resources or wrong params.
 - Push warning if des_encrypt or des_decrypt function is used when server is missing support for openssl.
 - Add test func_encrypt_nossl that is tun when the server is missing support for openssl. 


mysql-test/r/func_encrypt.result:
  Add tests for use of des_* function with invalid parameters
mysql-test/t/func_encrypt.test:
  Add tests for use of des_* function with invalid parameters
sql/item_strfunc.cc:
  Push warning if invalid paremeters are used
  Push warning if out of resources
  Push warning if user tries to use des_* function when the server has been compiled without support for openssl.
2005-06-17 18:07:46 +02:00
unknown
062a1b8b4e a compiler must see '#pragma implementation' *before*
'#pragma interface' (that comes with the #include'd header file)
2005-06-05 19:38:52 +02:00
unknown
72dd44b9de Move USE_PRAGMA_IMPLEMENTATION to proper place
Ensure that 'null_value' is not accessed before val() is called in FIELD() functions
Fixed initialization of key maps. This fixes some problems with keys when you have more than 64 keys
Fixed that ROLLUP don't always create a temporary table. This fix ensures that func_gconcat.test results are now predictable


mysql-test/r/func_gconcat.result:
  Move innodb specific test to innodb.test
  Changed table name r2 -> t2
  More test to see how ROLLUP was optimized
mysql-test/r/innodb.result:
  Moved test here form func_gconcat
mysql-test/r/olap.result:
  New test results after optimization
mysql-test/t/func_gconcat.test:
  Move innodb specific test to innodb.test
  Changed table name r2 -> t2
  More test to see how ROLLUP was optimized
mysql-test/t/innodb.test:
  Moved test here form func_gconcat
sql/field.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_berkeley.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_blackhole.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_heap.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_innodb.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_isam.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_isammrg.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_myisam.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_myisammrg.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_ndbcluster.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/handler.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/hash_filo.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_cmpfunc.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_func.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
  Ensure that 'null_value' is not accessed before val() is called
sql/item_geofunc.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_strfunc.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_subselect.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_sum.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_timefunc.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_uniq.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/log_event.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/mysql_priv.h:
  Change key_map_full to not be const as we are giving it a proper value on startup
sql/mysqld.cc:
  Move key_map variables here and initialize key_map_full properly
sql/opt_range.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/opt_range.h:
  Fix that test_quick_select() works with any ammount of keys
sql/procedure.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/protocol.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/protocol_cursor.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/set_var.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_analyse.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_class.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_crypt.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_insert.cc:
  Fixed that max_rows is ulong
sql/sql_list.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_map.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_olap.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_select.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
  Fixed that ROLLUP don't have to always create a temporary table
  Added new argument to remove_const() to make above possible
  Fixed some errors that creapt up when we don't always do a temporary table for ROLLUP
sql/sql_string.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_table.cc:
  Simple optimizations
  Fixed wrong checking of build_table_path() in undef-ed code
sql/sql_udf.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_yacc.yy:
  removed extra {}
2005-06-03 23:46:03 +03:00
unknown
cee10f979e tztime.cc:
Set #pragma implementation" earlier
Many files:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION


client/sql_string.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
mysys/raid.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/field.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/ha_berkeley.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/ha_blackhole.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/ha_heap.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/ha_innodb.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/ha_isam.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/ha_isammrg.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/ha_myisam.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/ha_myisammrg.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/ha_ndbcluster.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/handler.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/hash_filo.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/item.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/item_cmpfunc.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/item_func.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/item_geofunc.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/item_strfunc.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/item_subselect.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/item_sum.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/item_timefunc.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/item_uniq.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/log_event.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/opt_range.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/procedure.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/protocol.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/protocol_cursor.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/set_var.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/sql_analyse.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/sql_class.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/sql_crypt.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/sql_list.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/sql_map.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/sql_olap.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/examples/ha_archive.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/sql_select.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/sql_string.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/sql_udf.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/examples/ha_example.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/examples/ha_tina.cc:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
sql/tztime.cc:
  Set #pragma implementation" earlier
2005-06-02 02:43:32 +02:00
unknown
22944a9563 Add ifdefs to control when "#pragma implementation" should be used
Added some more ifdefs for "#pragma interface"


client/sql_string.cc:
  USE_PRAGMA_IMPLEMENTATION
client/sql_string.h:
  USE_PRAGMA_INTERFACE
include/my_global.h:
  Use pragma implementation for gcc pre version 3
mysys/raid.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/field.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/ha_berkeley.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/ha_blackhole.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/ha_heap.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/ha_innodb.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/ha_isam.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/ha_isammrg.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/ha_myisam.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/ha_myisammrg.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/ha_ndbcluster.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/handler.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/hash_filo.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/item.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/item_cmpfunc.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/item_func.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/item_geofunc.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/item_strfunc.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/item_subselect.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/item_sum.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/item_timefunc.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/item_uniq.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/item_uniq.h:
  USE_PRAGMA_INTERFACE
sql/log_event.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/log_event.h:
  USE_PRAGMA_INTERFACE
sql/opt_range.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/procedure.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/protocol.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/protocol_cursor.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/set_var.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/sql_analyse.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/sql_analyse.h:
  USE_PRAGMA_INTERFACE
sql/sql_class.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/sql_crypt.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/sql_crypt.h:
  USE_PRAGMA_IMPLEMENTATION
sql/sql_list.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/sql_map.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/sql_map.h:
  USE_PRAGMA_INTERFACE
sql/sql_olap.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/sql_select.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/sql_string.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/sql_udf.cc:
  USE_PRAGMA_IMPLEMENTATION
sql/tztime.cc:
  USE_PRAGMA_IMPLEMENTATION
2005-05-26 12:09:14 +02:00
unknown
66446b31b7 SUBSTR with negative argument didn't work
with multi-byte strings, length() instead
of numchars() where used in a mistake.
2005-05-09 20:55:06 +05:00
unknown
b3a5e5b1fd Bugs#9129: CHARSET(), COLLATION(), COERCIBILITY()
not always correct for NULL values.
Now they always result a non NULL value even
the argument is NULL. It is more usefull for 
debugging purposes.


mysql-test/r/func_str.result:
  Bugs#9129: CHARSET(), COLLATION(), COERCIBILITY()
  not always correct for NULL values.
  
  Also, a mistake in EXPORT_SET was fixed.
mysql-test/t/func_str.test:
  Bugs#9129: CHARSET(), COLLATION(), COERCIBILITY()
  not always correct for NULL values.
sql/item_func.cc:
  Bugs#9129: CHARSET(), COLLATION(), COERCIBILITY()
  not always correct for NULL values.
sql/item_strfunc.cc:
  Bugs#9129: CHARSET(), COLLATION(), COERCIBILITY()
  not always correct for NULL values.
  
  A minor mistake in EXPORT_SET() was fixed.
2005-03-16 17:44:29 +04:00
unknown
c703954578 # Bug#8785 Problem with nested concats and
character set conversion of a string constant.


mysql-test/r/ctype_utf8.result:
  Adding test
mysql-test/t/ctype_utf8.test:
  Addign test
sql/item_strfunc.cc:
  Remove previous fix: it was not 100% correct.
  A non const_item() can return a constant String.
sql/sql_string.h:
  A new method to cut Alloced_length to str_length for
  string constants, to avoid reusing them as a buffer
  in things like CONCAT().
2005-03-15 17:15:47 +04:00
unknown
85be2e57ab Manual merge
sql/item_strfunc.cc:
  Auto merged
2005-03-09 10:58:52 -08:00
unknown
44d66d26dc func_str.result, func_str.test:
Added a test case for bug #8669.
item_strfunc.cc:
  Fixed bug #8669.
  Function AES_DECRYPT can return NULL value.


sql/item_strfunc.cc:
  Fixed bug #8669.
  Function AES_DECRYPT can return NULL value.
mysql-test/t/func_str.test:
  Added a test case for bug #8669.
mysql-test/r/func_str.result:
  Added a test case for bug #8669.
2005-03-09 00:15:51 -08:00
unknown
295dedd11c Manual merge, no effect on 4.1.
Build-tools/Do-compile:
  Change in 4.0 was backport, no effect on 4.1
configure.in:
  No change in 4.1 on merging.
sql/item_strfunc.cc:
  No change in 4.1
2005-03-08 14:17:57 +01:00
unknown
fd35e7870a Fix for bug#8978 : Crash on 'select format ...' 2005-03-07 18:56:18 +03:00
unknown
c56d0283dd type_blob.result, func_system.result, func_str.result, ctype_collate.result:
fixing test results accordingly.
func_system.test:
  New test that illegal mix of collations does not happen anymore.
item_strfunc.h:
    safe_charset_converter() was added for system constants.
item_strfunc.cc:
  safe_charset_converter() was added for system constants.
item_func.cc, item.h, item.cc:
  Bug#8291: Illegal collation mix with USER() function.
  After discussion with PeterG and Serge, a new coercibility
  level for "system constants" was introduced, between
  COERRIBLE and IMPLICIT. Thus:
  SELECT col1 = USER() FROM t1; - is done according to col1 collation.
  SELECT 'string' = USER(); - is done according to USER() collation.
  At the same time, "nagg" and "strong" members were removed as unused.
item_create.cc:
  Version is a system constant too.


sql/item.cc:
  Bug#8291: Illegal collation mix with USER() function.
  After discussion with PeterG and Serge, a new coercibility
  level for "system constants" was introduced, between
  COERRIBLE and IMPLICIT. Thus:
  SELECT col1 = USER() FROM t1; - is done according to col1 collation.
  SELECT 'string' = USER(); - is done according to USER() collation.
  At the same time, "nagg" and "strong" members were removed as unused.
sql/item.h:
  Bug#8291: Illegal collation mix with USER() function.
  After discussion with PeterG and Serge, a new coercibility
  level for "system constants" was introduced, between
  COERRIBLE and IMPLICIT. Thus:
  SELECT col1 = USER() FROM t1; - is done according to col1 collation.
  SELECT 'string' = USER(); - is done according to USER() collation.
  At the same time, "nagg" and "strong" members were removed as unused.
sql/item_create.cc:
  Version is a system constant too.
sql/item_func.cc:
  Bug#8291: Illegal collation mix with USER() function.
  After discussion with PeterG and Serge, a new coercibility
  level for "system constants" was introduced, between
  COERRIBLE and IMPLICIT. Thus:
  SELECT col1 = USER() FROM t1; - is done according to col1 collation.
  SELECT 'string' = USER(); - is done according to USER() collation.
  At the same time, "nagg" and "strong" members were removed as unused.
sql/item_strfunc.cc:
  safe_charset_converter() was added for system constants.
sql/item_strfunc.h:
    safe_charset_converter() was added for system constants.
mysql-test/t/func_system.test:
  New test that illegal mix of collations does not happen anymore.
mysql-test/r/ctype_collate.result:
  fixing test results accordingly.
mysql-test/r/func_str.result:
  fixing test results accordingly.
mysql-test/r/func_system.result:
  fixing test results accordingly.
mysql-test/r/type_blob.result:
  fixing test results accordingly.
2005-03-04 14:20:49 +04:00
unknown
f443992e66 Fix for bug#6317: string function CHAR, parameter is NULL, wrong result 2005-02-23 18:15:45 +03:00
unknown
cb8d9c3ad4 Backport my_strntod() from 5.0
Change string->float conversion to delay division as long as possible.
This gives us more exact integer->float conversion for numbers of type '123.45E+02' (Bug #7740)




client/mysql.cc:
  Fix wront usage of charset (found during review of pushed code)
include/m_string.h:
  Backported my_strtod() from 5.0
mysql-test/mysql-test-run.sh:
  Run also mysql_client_test with --debug
mysql-test/r/ps_1general.result:
  Safety fix (if mysql_client_test.test fails)
mysql-test/r/type_float.result:
  More test
mysql-test/t/mysql_client_test.test:
  Comments for what to do if this test fails
mysql-test/t/ps_1general.test:
  Safety fix (if mysql_client_test.test fails)
mysql-test/t/type_float.test:
  More test to better test new strtod() function
  Test also bug #7740 (wrong comparsion between integer and float-in-integer-range)
sql/field.cc:
  Backport my_strntod() from 5.0
sql/item.cc:
  Backport my_strntod() from 5.0
sql/item.h:
  Backport my_strntod() from 5.0
sql/item_func.h:
  Backport my_strntod() from 5.0
sql/item_strfunc.cc:
  Backport my_strntod() from 5.0
sql/item_sum.cc:
  Backport my_strntod() from 5.0
sql/item_sum.h:
  Backport my_strntod() from 5.0
sql/procedure.h:
  Backport my_strntod() from 5.0
strings/ctype-simple.c:
  Backport my_strntod() from 5.0
strings/ctype-ucs2.c:
  Backport my_strntod() from 5.0
strings/strtod.c:
  Backport my_strntod() from 5.0
  Change conversion to delay division as long as possible.
  This gives us more exact integer-> float conversion for numbers of type '123.45E+02'
2005-02-22 12:51:23 +02:00
unknown
1d633f645a A fix. "(int) var" type cast doesn't work correctly for uint32 var
on some 64-bit platforms (e.g. IRIX, non-debug build).
2005-02-15 15:01:20 +04:00
unknown
63982db93c Better bugfix for "HAVING when refering to RAND()" (Bug #8216)
Ensure that references in HAVING, ORDER BY or GROUP BY are calculated after fields in SELECT.
This will ensure that any reference to these has a valid value.
Generalized the code for split_sum_func()


BitKeeper/etc/ignore:
  added support-files/ndb-config-2-node.ini
mysql-test/r/group_by.result:
  More complicated test to assure that rand() is only calulated once
mysql-test/r/user_var.result:
  Back to old results :(  (ok but not perfect)
mysql-test/t/group_by.test:
  More complicated test to assure that rand() is only calulated once
sql/item.cc:
  Better bugfix for "HAVING when refering to RAND()"
  This will ensure that when refering to things like RAND() in HAVING through an alias we will not recalculate that rand() value in the HAVING part but use the value in the row
  Generalize split_sum_func()
sql/item.h:
  Better bugfix for "HAVING when refering to RAND()"
  T
sql/item_cmpfunc.cc:
  Better bugfix for "HAVING when refering to RAND()"
  Use generalized split_sum_func2() function
sql/item_func.cc:
  Better bugfix for "HAVING when refering to RAND()"
  Use generalized split_sum_func2() function
sql/item_row.cc:
  Better bugfix for "HAVING when refering to RAND()"
  Use generalized split_sum_func2() function
sql/item_strfunc.cc:
  Better bugfix for "HAVING when refering to RAND()"
  Use generalized split_sum_func2() function
sql/sql_list.h:
  Add functions to concatenate lists
sql/sql_select.cc:
  Better bugfix for "HAVING when refering to RAND()"
  Ensure that references in HAVING, ORDER BY or GROUP BY are calculated after fields in SELECT.
  This will ensure that any reference to these has a valid value.
2005-02-08 14:41:09 +02:00
unknown
d6ed8cd709 Fixed bug in HAVING when refering to RAND() through alias
(BUG 8216)


mysql-test/r/group_by.result:
  New test case
mysql-test/r/user_var.result:
  Test changed (to be more correct) with bug fix
mysql-test/t/group_by.test:
  Added test for HAVING bug
sql/item_cmpfunc.cc:
  Fixed bug in HAVING when refering to RAND()
sql/item_func.cc:
  Fixed bug in HAVING when refering to RAND()
sql/item_row.cc:
  Fixed bug in HAVING when refering to RAND()
sql/item_strfunc.cc:
  Fixed bug in HAVING when refering to RAND()
sql/unireg.h:
  Added PSEUDO_TABLES_BITS for easy testing of real table reference
2005-02-07 18:13:57 +02:00
unknown
33e74b1427 Merge fixes for #8248, #5569.
mysql-test/r/func_str.result:
  Update results
mysql-test/t/func_str.test:
  Merge test
sql/item_strfunc.cc:
  Set charset on output string
sql/item_strfunc.h:
  Merge
sql/sql_parse.cc:
  Merge
vio/viosocket.c:
  Merge
2005-02-02 08:21:11 -08:00
unknown
4c76152b35 func_str.result, func_str.test:
Added a test case for bug #7751.
item_strfunc.cc:
  Fixed bug #7751.
  The function Item_func_conv::val_str did not update
  the unsigned_flag value.


sql/item_strfunc.cc:
  Fixed bug #7751.
  The function Item_func_conv::val_str did not update
  the unsigned_flag value.
mysql-test/t/func_str.test:
  Added a test case for bug #7751.
mysql-test/r/func_str.result:
  Added a test case for bug #7751.
2005-02-01 23:34:31 -08:00
unknown
6d0d03dab9 Fix QUOTE() to not reuse the input field for output, which resulted in
incorrect results when the input was a constant across a multi-row SELECT
statement. (Bug #8248)


sql/item_strfunc.h:
  Add tmp_value member
sql/item_strfunc.cc:
  Always allocate a new string for QUOTE(), in case the field is being reused
  for multiple rows.
mysql-test/t/func_str.test:
  Add regression test
mysql-test/r/func_str.result:
  Add test results
2005-02-01 18:29:10 -08:00
unknown
8bdb500105 fixes/cleanups according to Coverity report 2005-01-24 15:48:25 +01:00
unknown
ec0daa744f #7874: CONCAT() gives wrong results mixing latin1 field and utf8 string literals
We should not overwrite res if it is returned from a const item.
2005-01-18 10:42:29 +04:00
unknown
b25fcad4a7 user_var.result, func_str.result, item_strfunc.cc:
bug#7839 ncorrect collation for char(ascii('a'))


sql/item_strfunc.cc:
  bug#7839 ncorrect collation for char(ascii('a'))
mysql-test/r/func_str.result:
  bug#7839 ncorrect collation for char(ascii('a'))
mysql-test/r/user_var.result:
  bug#7839 ncorrect collation for char(ascii('a'))
2005-01-17 10:38:35 +04:00