Commit graph

382 commits

Author SHA1 Message Date
unknown
3baf203483 Merge polly.local:/tmp/maint/bug11655/my41-bug11655
into  polly.local:/home/kaa/src/maint/m41-maint--07OGk


sql/field.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
mysql-test/r/func_time.result:
  Manually merged
mysql-test/t/func_time.test:
  Manually merged
2006-10-11 14:55:23 +04:00
unknown
634d3ff2c6 Fixes a number of problems with time/datetime <-> string conversion functions:
- bug #11655 "Wrong time is returning from nested selects - maximum time exists
- input and output TIME values were not validated properly in several conversion functions
- bug #20927 "sec_to_time treats big unsigned as signed"
- integer overflows were not checked in several functions. As a result, input values like 2^32 or 3600*2^32 were treated as 0
- BIGINT UNSIGNED values were treated as SIGNED in several functions
- in cases where both input string truncation and out-of-range TIME value occur, only 'truncated incorrect time value' warning was produced


include/my_time.h:
  Added defines for the TIME limits
  Added defines for the warning flags set by str_to_time() and check_time_range()
  Added check_time_range() declaration
mysql-test/r/func_sapdb.result:
  Fixed testcases which relied on incorrect TIMEDIFF() behaviour
mysql-test/r/func_time.result:
  Fixed testcase which relied on incorrect behaviour
  Added testcases for out-of-range values in SEC_TO_TIME(), TIME_TO_SEC(), ADDTIME(), SUBTIME() and EXTRACT()
mysql-test/t/func_time.test:
  Added testcases for out-of-range values in SEC_TO_TIME(), TIME_TO_SEC(), ADDTIME(), SUBTIME() and EXTRACT()
sql-common/my_time.c:
  Added check_time_range() to be used from str_to_time() and item_timefunc.cc
  Added new out-of-range flag to str_to_time() warnings
  Use '%u' instead of '%d' in my_*_to_str() because the arguments are unsigned
sql/field.cc:
  Replaced out-of-range checks with checks for flags returned by str_to_time()
sql/item_timefunc.cc:
  Added wrappers over make_datetime() and make_time() which perform out-of-range checks on input values
  Moved common code in Item_func_sec_to_time::val_str() and Item_func_sec_to_time::val_int() into a separate function sec_to_time()
  Replaced calls to make_datetime() with make_datetime_with_warn() in Item_func_add_time and Item_func_timediff
  Checks for 'unsigned int' overflows in Item_func_maketime
  Use make_time_with_warn() instead of make_time() in Item_func_maketime
  Fixed incorrect sizeof() in Item_func_str_to_date::get_time()
sql/time.cc:
  Check for return value of str_to_time() along with warning flags
2006-10-04 17:13:32 +04:00
unknown
75220954bf Merge trift2.:/M41/clone-4.1
into  trift2.:/M41/push-4.1


sql/field.cc:
  Auto merged
sql/sql_locale.cc:
  Changes were already present (and even better) == Null-merge == "ul".
2006-07-24 19:18:30 +02:00
unknown
9d5b76eba9 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b16327


sql/field.cc:
  Auto merged
mysql-test/r/func_time.result:
  merging
mysql-test/t/func_time.test:
  merging
2006-07-23 14:17:01 +05:00
unknown
d7c0c66706 Bug #21135 Crash in test "func_time"
- backport patch from 5.0
 - "table" can be NULL in temporary fields used for type conversion


sql/field.cc:
  table can be NULL in temporary fields used for type conversion.
  Store value in field as if db_low_byte_first was set.
sql/field.h:
  table can be NULL in temporary fields used for type conversion.
  Store value in field as if db_low_byte_first was set.
2006-07-19 15:55:04 +02:00
unknown
822e8866c7 Fixed bug #14896.
This bug in Field_string::cmp resulted in a wrong comparison 
with keys in partial indexes over multi-byte character fields.
Given field a is declared as a varchar(16) collate utf8_unicode_ci
INDEX(a(4)) gives us an example of such an index.
  
Wrong key comparisons could lead to wrong result sets if 
the selected query execution plan used a range scan by 
a partial index over a utf8 character field.
This also caused wrong results in many other cases.


mysql-test/t/ctype_utf8.test:
  Added test cases for bug #14896.
mysql-test/r/ctype_utf8.result:
  Added test cases for bug #14896.
sql/field.cc:
  Fixed bug #14896.
  This bug in Field_string::cmp resulted in a wrong comparison 
  with keys in partial indexes over multi-byte character fields.
  Given field a is declared as a varchar(16) collate utf8_unicode_ci
  INDEX(a(4)) gives us an example of such an index.
       
  Wrong key comparisons could lead to wrong result sets if 
  the selected query execution plan used a range scan by 
  a partial index over a utf8 character field.
  This also caused wrong results in many other cases.
2006-06-22 00:29:04 +04:00
unknown
47311e8e87 Fixed bug#16377: result of DATE/TIME functions were compared as strings which
can lead to a wrong result.

All date/time functions has the STRING result type thus their results are
compared as strings. The string date representation allows a user to skip 
some of leading zeros. This can lead to wrong comparison result if a date/time 
function result is compared to such a string constant.

The idea behind this bug fix is to compare results of date/time functions
and data/time constants as ints, because that date/time representation is 
more exact. To achieve this the agg_cmp_type() is changed to take in the
account that a date/time field or an date/time item should be compared 
as ints.

This bug fix is partially back ported from 5.0.

The agg_cmp_type() function now accepts THD as one of parameters. 
In addition, it now checks if a date/time field/function is present in the
list. If so, it tries to coerce all constants to INT to make date/time
comparison return correct result. The field for the constant coercion is
taken from the Item_field or constructed from the Item_func. In latter case
the constructed field will be freed after conversion of all constant items.
Otherwise the result is same as before - aggregated with help of the
item_cmp_type() function.

From the Item_func_between::fix_length_and_dec() function removed the part
which was converting date/time constants to int if possible. Now this is 
done by the agg_cmp_type() function.

The new function result_as_longlong() is added to the Item class. 
It indicates that the item is a date/time item and result of it can be
compared as int. Such items are date/time fields/functions.

Correct val_int() methods are implemented for classes Item_date_typecast, 
Item_func_makedate, Item_time_typecast, Item_datetime_typecast. All these
classes are derived from Item_str_func and Item_str_func::val_int() converts
its string value to int without regard to the date/time type of these items.

Arg_comparator::set_compare_func() and Arg_comparator::set_cmp_func()
functions are changed to substitute result type of an item with the INT_RESULT
if the item is a date/time item and another item is a constant. This is done
to get a correct result of comparisons like date_time_function() = string_constant.


mysql-test/r/cast.result:
  Fixed wrong test case result after bug fix#16377.
sql/item_timefunc.h:
  Fixed bug#16377: result of DATE/TIME functions were compared as strings which
  can lead to a wrong result.
  The result_as_longlong() function is set to return TRUE for these classes:
  Item_date, Item_date_func, Item_func_curtime, Item_func_sec_to_time,
  Item_date_typecast, Item_time_typecast, Item_datetime_typecast,
  Item_func_makedate.
sql/item_timefunc.cc:
  Fixed bug#16377: result of DATE/TIME functions were compared as strings which
  can lead to a wrong result.Correct val_int() methods are implemented for classes Item_date_typecast, 
  Item_func_makedate, Item_time_typecast, Item_datetime_typecast.
sql/item_cmpfunc.h:
  Fixed bug#16377: result of DATE/TIME functions were compared as strings which
  can lead to a wrong result.
  Arg_comparator::set_compare_func() and Arg_comparator::set_cmp_func()
  functions are changed to substitute result type of an item with the INT_RESULT
  if the item is a date/time item and another item is a constant.
sql/field.cc:
  Fixed bug#16377: result of DATE/TIME functions were compared as strings which
  can lead to a wrong result.
  Field::set_warning(), Field::set_datetime_warning() now use current_thd to get thd if table isn't set.
sql/item_cmpfunc.cc:
  Fixed bug#16377: result of DATE/TIME functions were compared as strings which
  can lead to a wrong result.
  The agg_cmp_type() function now accepts THD as one of parameters. 
  In addition, it now checks if a date/time field/function is present in the
  list. If so, it tries to coerce all constants to INT to make date/time
  comparison return correct result. The field for the constant coercion is
  taken from the Item_field or constructed from the Item_func. In latter case
  the constructed field will be freed after conversion of all constant items.
  Otherwise the result is same as before - aggregated with help of the
  item_cmp_type() function.
sql/item.h:
  The new function result_as_longlong() is added to the Item class. 
  It indicates that the item is a date/time item and result of it can be
  compared as int. Such items are date/time fields/functions.
mysql-test/t/func_time.test:
  Added test case fot bug#16377: result of DATE/TIME functions were compared as strings which
  can lead to a wrong result.
mysql-test/r/func_time.result:
  Added test case fot bug#16377: result of DATE/TIME functions were compared as strings which
  can lead to a wrong result.
2006-06-13 19:09:24 +04:00
unknown
23006f9b54 Fix for #16327: invalid TIMESTAMP values retrieved
mysql-test/r/func_time.result:
  Fix for #16327: invalid TIMESTAMP values retrieved
    - test result
mysql-test/t/func_time.test:
  Fix for #16327: invalid TIMESTAMP values retrieved
    - test case
sql/field.cc:
  Fix for #16327: invalid TIMESTAMP values retrieved
    - let 1969 as well
2006-05-17 17:00:30 +05:00
unknown
a8c9bbd4be Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/bar/mysql-4.1.b15098


sql/field.cc:
  Auto merged
2006-03-28 18:32:58 +05:00
unknown
9cf3f255bd A fix and a test case for Bug#13134 "Length of VARCHAR() utf8
column is increasing when table is recreated with PS/SP":
make use of create_field::char_length more consistent in the code.
Reinit create_field::length from create_field::char_length
for every execution of a prepared statement (actually fixes the 
bug).


mysql-test/r/ps.result:
  Test results fixed (Bug#13134)
mysql-test/t/ps.test:
  A test case for Bug#13134 "Length of VARCHAR() utf8 column is 
  increasing when table is recreated with PS/SP"
sql/field.cc:
  Move initialization of create_field::char_length to the constructor
  of create_field.
sql/field.h:
  Rename chars_length to char_length (to be consistent with
  how this term is used throughout the rest of the code).
sql/sql_parse.cc:
  Initialize char_length in add_field_to_list. This function
  effectively works as another create_field constructor.
sql/sql_table.cc:
  Reinit length from char_length for every field in 
  mysql_prepare_table. This is not needed if we're executing
  a statement for the first time, however, at subsequent executions
  length contains the number of bytes, not characters (as it's expected 
  to).
2006-02-21 19:52:20 +03:00
unknown
e1c6141340 Bug#15581: COALESCE function truncates mutli-byte TINYTEXT values
field.cc:
  BLOB variations have number-in-bytes limit,
  unlike CHAR/VARCHAR which have number-of-characters limits.
  A tinyblob column can store up to 255 bytes.
  In the case of basic Latin letters (which use 1 byte per character)
  we can store up to 255 characters in a tinyblob column.
  When passing an utf8 tinyblob column as an argument into
  a function (e.g. COALESCE) we need to reserve 3*255 bytes.
  I.e. multiply length in bytes to mbcharlen for the character set.
  Although in reality a tinyblob column can never be 3*255 bytes long,
  we need to set max_length to multiply to make fix_length_and_dec()
  of the function-caller (e.g. COALESCE) calculate the correct max_length
  for the column being created.

ctype_utf8.result, ctype_utf8.test:
  Adding test case.


mysql-test/t/ctype_utf8.test:
  Adding test case.
mysql-test/r/ctype_utf8.result:
  Adding test case.
sql/field.cc:
  Bug#15581: COALESCE function truncates mutli-byte TINYTEXT values
  BLOB variations have byte limits,
  unlike CHAR/VARCHAR which have number-of-character limits.
  It means tinyblob can store up to 255 bytes.
  All of them can be basic latin letters which use 1 byte
  per character.
  I.e. we can store up to 255 characters in a tinyblob column.
  When passing a tinyblob column as an argument into
  a function (for example COALESCE or CONCAT) we
  need to reserve 3*255 bytes in the case of utf-8.
  I.e. multiply length in bytes to mbcharlen for the
  character set.
2005-12-19 15:52:10 +04:00
unknown
4ccd376100 Bug#15098 CAST(column double TO signed int), wrong result
field.cc:
  Adding longlong range checking to return
  LONGLONG_MIN or LONGLONG_MAX when out of range. 
  Using (longlong) cast only when range is ok.
cast.test:
  Adding test case.
cast.result:
  Fixing results accordingly.


sql/field.cc:
  Bug#15098 CAST(column double TO signed int), wrong result
  Adding longlong range checking.
mysql-test/t/cast.test:
  Bug#15098 CAST(column double TO signed int), wrong result
  Adding longlong range checking.
mysql-test/r/cast.result:
  Fixing results accordingly.
2005-12-06 16:54:13 +04:00
unknown
a006453fad Merge bk@192.168.21.1:/usr/home/bk/mysql-4.1
into deer.(none):/home/hf/work/mysql-4.1.12839


sql/field.cc:
  Auto merged
2005-10-31 12:24:43 +04:00
unknown
b47f1efb25 Additional fix for #12839
sql/field.cc:
  This code still could work for VERY out-of-dated databases
sql/spatial.cc:
  small syntax fixes
2005-10-31 12:05:27 +04:00
unknown
115bf43602 BUG#14139: When handling "CREATE TABLE(field_X type_spec,...) SELECT smth AS field_X, ...."
avoid multiplying length of field_X by charset->mbmaxlen twice when calculating space 
required for field_X in the new table.


mysql-test/r/create.result:
  Testcase for BUG#14139
mysql-test/t/create.test:
  Testcase for BUG#14139
sql/field.cc:
  BUG#14139: Make create_length_to_internal_length() save length-in-characters in 
  create_field::chars_length.
sql/field.h:
  BUG#14139: Add create_length::chars_length where we save length-in-characters, added comments.
sql/sql_table.cc:
  BUG#14139: When handling "CREATE TABLE(field_X type_spec,...) SELECT smth AS field_X, ...."
  we get two instances of create_field: (1) is occurence of field_X in create list, and (2) is
  in select list. If we figure they both refer to the same field, we "join" them according to
  some rule that is not explicitly specified anywhere.
  When we do this "join", create_field::length already contains length-in-bytes for both, so
  when we transfer field length (in characters) from (1) to (2), use length-in-characters that
  we have saved in create_length::chars_length.
2005-10-26 00:56:17 +04:00
unknown
8fdef257ae Fix for bug #12839 (Endian support is absurd)
mysql-test/r/gis.result:
  test result fixed
mysql-test/t/gis.test:
  test case added
sql/field.cc:
  ::construct calls added
sql/item_geofunc.cc:
  ::construct calls added
sql/spatial.cc:
  Geometry_*::init_from_wkb implemented
sql/spatial.h:
  init_from_wkb methods declared
2005-09-21 14:35:01 +05:00
unknown
d2810c56cf Fixed compiler warnings
client/mysqldump.c:
  Fixed wrong argument to printf()
client/mysqltest.c:
  Fixed compiler warning
myisam/ft_boolean_search.c:
  Fixed compiler warning
myisammrg/myrg_static.c:
  Fixed compiler warning
mysql-test/r/rpl_drop_temp.result:
  Drop used database
mysql-test/t/rpl_drop_temp.test:
  Drop used database
ndb/src/common/logger/LogHandler.cpp:
  Fixed compiler warning
sql/field.cc:
  Fixed compiler warning
sql/ha_ndbcluster.cc:
  Fixed compiler warning
sql/sql_base.cc:
  Fixed compiler warning
tests/mysql_client_test.c:
  Fixed compiler warning
2005-07-28 21:25:05 +03:00
unknown
a16a61d959 A fix and a test case for Bug#9735.
No separate typecode for MEDIUMTEXT/LONGTEXT is added, as we
have no sound decision yet what typecodes and for what types are
sent by the server (aka what constitutes a distinct type in MySQL).



mysql-test/r/ps_2myisam.result:
  Test results fixed: new longtext/longblob length (2^32)
mysql-test/r/ps_3innodb.result:
  Test results fixed: new longtext/longblob length (2^32)
mysql-test/r/ps_4heap.result:
  Test results fixed: new longtext/longblob length (2^32)
mysql-test/r/ps_5merge.result:
  Test results fixed: new longtext/longblob length (2^32)
mysql-test/r/ps_6bdb.result:
  Test results fixed: new longtext/longblob length (2^32)
mysql-test/r/ps_7ndb.result:
  Test results fixed: new longtext/longblob length (2^32)
sql/field.cc:
  A fix for Bug#9735 "mysql_fetch_fields() acts strange on 
  LONGBLOB/LONGTEXT": fix wrong initialization of field_length
  in case of BLOB fields.
tests/mysql_client_test.c:
  A test case for Bug#9735  "mysql_fetch_fields() acts strange on 
  LONGBLOB/LONGTEXT"
2005-07-14 15:13:23 +04:00
unknown
27478af9d5 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1
into rurik.mysql.com:/home/igor/mysql-4.1


sql/field.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2005-06-28 03:20:00 -07:00
unknown
98253bd64d func_str.result, func_str.test:
Added a test case for bug #10124.
sql_select.h, item_subselect.cc, sql_select.cc:
  Fixed bug #10124.
  The copy method of the store_key classes can return
  STORE_KEY_OK=0, STORE_KEY_FATAL=1, STORE_KEY_CONV=2 now.
field.cc:
  Fixed bug #10124.
  When ussuing a warning the store methods return 2 instead of 1 now.


sql/field.cc:
  Fixed bug #10124.
  When ussuing a warning the store methods return 2 instead of 1 now.
sql/sql_select.cc:
  Fixed bug #10124.
  The copy method of the store_key classes can return
  STORE_KEY_OK=0, STORE_KEY_FATAL=1, STORE_KEY_CONV=2 now.
sql/item_subselect.cc:
  Fixed bug #10124.
  The copy method of the store_key classes can return
  STORE_KEY_OK=0, STORE_KEY_FATAL=1, STORE_KEY_CONV=2 now.
sql/sql_select.h:
  Fixed bug #10124.
  The copy method of the store_key classes can return
  STORE_KEY_OK=0, STORE_KEY_FATAL=1, STORE_KEY_CONV=2 now.
mysql-test/t/func_str.test:
  Added a test case for bug #10124.
mysql-test/r/func_str.result:
  Added a test case for bug #10124.
2005-06-23 06:15:50 -07:00
unknown
280b1c33e3 Cleanup during review of new code
Fixed wrong allocation that could cause buffer overrun when using join cache


myisam/mi_open.c:
  Fixed indentation
mysql-test/r/lowercase_table2.result:
  Drop tables and databases used in the test
mysql-test/t/lowercase_table2.test:
  Drop tables and databases used in the test
mysys/my_fopen.c:
  Cleanup of comments and parameter names
  Simple optimization
  Removed compiler warnings
sql/field.cc:
  Fixed wrong allocation that could cause buffer overrun
sql/mysqld.cc:
  Removed not needed code
sql/set_var.cc:
  Simply code
sql/sql_select.cc:
  Use int2store/int2korr to store length of cached VARCHAR fields
  (Not dependent on type and faster code as we avoid one possible call)
2005-06-21 18:18:58 +03: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
52b70ceff7 ctype_utf8.result, ctype_utf8.test:
adding test
field.cc:
  bug#10714 Inserting double value into utf8 column crashes server:
  sprintf was executed with too big length, which caused
  crash on some Windows platforms.


sql/field.cc:
  bug#10714 Inserting double value into utf8 column crashes server
  sprintf was executed with too long length, which cau
  crashe on Windows.
mysql-test/t/ctype_utf8.test:
  adding test
mysql-test/r/ctype_utf8.result:
  adding test
2005-06-03 09:37:53 +05: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
3683fc3453 Minor clean-ups for the previous commit.
sql/field.cc:
  Use a separate variable. Otherwise "error" value gets lost
  after well_formed_length call.
strings/ctype-mb.c:
  Don't return an error if we reached end of line.
2005-04-06 15:12:44 +05:00
unknown
5687fe36bf Adding a new parameter for well_formed_length to
return error. We'll use it for better warnign reporting.
2005-04-06 11:53:15 +05:00
unknown
5a42525027 fixed union types merging and table related metadata (BUG#8824)
mysql-test/r/func_group.result:
  new result
mysql-test/r/metadata.result:
  new result
  test of metadata of variables, unions and derived tables
mysql-test/r/union.result:
  new results
  test of union of enum
mysql-test/t/metadata.test:
  test of metadata of variables, unions and derived tables
mysql-test/t/union.test:
  test of union of enum
sql/field.cc:
  Field type merging rules added
  Fixed table name/alias returting for field made from temporary tables
sql/field.h:
  removed unned field type reporting
sql/item.cc:
  fixed bug in NEW_DATE type field creartion
  replaced mechanism of merging types of UNION
sql/item.h:
  replaced mechanism of merging types of UNION
sql/item_func.h:
  new item type to make correct field type detection possible
sql/item_subselect.cc:
  added table name parameter to prepare() to show right table alias for derived tables
sql/sql_derived.cc:
  added table name parameter to prepare() to show right table alias for derived tables
sql/sql_lex.h:
  added table name parameter to prepare() to show right table alias for derived tables
sql/sql_parse.cc:
  made function for enum/set pack length calculation
sql/sql_prepare.cc:
  added table name parameter to prepare() to show right table alias for derived tables
sql/sql_select.cc:
  new temporary table field creation by Item_type_holder
  fixed table alias for temporary table
sql/sql_union.cc:
  added table name parameter to prepare() to show right table alias for derived tables
2005-03-23 08:36:48 +02:00
unknown
7e028f994a Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/my/mysql-4.1


sql/field.cc:
  Auto merged
2005-02-22 12:51:54 +02: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
1329f063c0 field.cc:
optimize test_if_minus() when not UCS2 support is compiled.


sql/field.cc:
  optimize test_if_minus() when not UCS2 support is compiled.
2005-02-22 08:35:15 +04:00
unknown
2d619d7cad Bug#8235 Connection collation change & table create with default result in crash
mysql-test/r/ctype_ucs.result:
  Test case
mysql-test/t/ctype_ucs.test:
  Test case
sql/field.cc:
  Fixed minus check to be UCS2-compatible
strings/ctype-ucs2.c:
  Missing my_scan_ucs2() was added.
2005-02-12 16:27:22 +04:00
unknown
38114e1c97 Merge mysql.com:/home/jimw/my/mysql-4.1-6067
into mysql.com:/home/jimw/my/mysql-4.1-clean


sql/field.cc:
  Auto merged
2005-02-04 10:39:13 -08:00
unknown
66eb71f3fc A fix: bug#6931: Date Type column problem when using UNION-Table
bug#7833:  Wrong datatype of aggregate column is returned


mysql-test/r/func_group.result:
  Test case for bug 7833:  Wrong datatype of aggregate column is returned
mysql-test/r/union.result:
  Test case for bug 6931: Date Type column problem when using UNION-Table.
mysql-test/t/func_group.test:
  Test case for bug 7833:  Wrong datatype of aggregate column is returned
mysql-test/t/union.test:
  Test case for bug 6931: Date Type column problem when using UNION-Table.
2005-02-04 15:31:36 +03:00
unknown
6162c4a6eb Fix value of YEAR field when set from a non-numeric string. (Bug #6067)
mysql-test/t/type_date.test:
  Add new regression test
mysql-test/r/type_date.result:
  Add result
sql/field.cc:
  Set YEAR to 0 when set to a non-numeric string, not 2000,
  and issue a warning.
2005-02-01 15:08:31 -08:00
unknown
ebe1e8a9e6 Merge jwinstead2@wwwtst1.mysql.com:mysql-4.1-7774
into mysql.com:/home/jimw/my/mysql-4.1-clean


sql/field.cc:
  Auto merged
2005-01-13 09:07:21 -08:00
unknown
9842aca3ef bug#7284: strnxfrm returns different results for equal strings 2005-01-13 18:12:04 +04:00
unknown
7682d6c9cf Small fix for Field_str::store() to avoid trying to read past beginning
of log_10 array.


sql/field.cc:
  Avoid pointless calculation for really short fields, and what could be
  an attempt to access outside the bounds of the log_10 array.
2005-01-13 00:52:19 +01:00
unknown
8b077c2b9f Fix conversion of floating point values to character fields when the
absolute value of the float is less than 1, and also fix calculation of
length for negative values. (Bug #7774)


sql/field.cc:
  Fix handling of negative values and fabs(values> < 1 in Field_str::store
mysql-test/r/type_float.result:
  Add results
mysql-test/r/type_float.result.es:
  Add results
mysql-test/t/type_float.test:
  Add test for conversion of floats to character field
2005-01-13 00:41:45 +01:00
unknown
0c57a67ce0 Correctly truncate integers inserted into field and double columns
with a number of decimals specified. (Bug #7361)


mysql-test/t/type_float.test:
  Add test for maximum values of float and double columns with number of decimals
mysql-test/r/type_float.result:
  Add results for new test
mysql-test/r/type_float.result.es:
  Add results for new test
sql/field.cc:
  Use ::store(double nr) from ::store(longlong nr) so we get the same range checking
2005-01-07 17:44:18 +01:00
unknown
abaeea4993 merge
mysql-test/r/ps_1general.result:
  Auto merged
mysql-test/t/key_cache.test:
  Auto merged
sql/field.cc:
  Auto merged
2004-12-07 13:56:48 +03:00
unknown
8ec6cf2cd5 UCS2 support in ENUM and SET, which also fixes:
Bug #5174 SHOW CREATE TABLE hangs up if the table contains half-with katakana enum values
UCS2 values are stored in HEX encoding in FRM file
2004-12-06 20:45:32 +04:00
unknown
21f2d3aa3f Fixed thar proper charset was not set in Field_set::val_str() 2004-12-06 16:22:51 +04:00
unknown
374252c686 merge (new code fixed the ALTER TABLE problem) 2004-12-02 15:14:01 +02:00
unknown
35f9ecc1ce merged on pull
mysql-test/r/rpl_start_stop_slave.result:
  Auto merged
sql/field.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_table.cc:
  Auto merged
mysql-test/r/type_enum.result:
  merged test cases
mysql-test/t/type_enum.test:
  merged test cases
2004-12-02 14:47:14 +02:00
unknown
93cf297fcb Cleanups during review stage
Added auto-correct of field length for enum/set tables for ALTER TABLE
This is becasue of a bug in previous MySQL 4.1 versions where the length for enum/set was set incorrectly after ALTER TABLE


mysql-test/r/rpl_start_stop_slave.result:
  Fixed wrong test
mysql-test/r/type_enum.result:
  Added test for wrong enum/set length after alter table
mysql-test/t/ps.test:
  removed empty line
mysql-test/t/type_enum.test:
  Added test for wrong enum/set length after alter table
sql/field.cc:
  Added auto-correct of field length for enum/set tables.
  This is becasue of a bug in previous MySQL 4.1 versions where the length for enum/set was set incorrectly after ALTER TABLE
sql/item_cmpfunc.cc:
  Simple optimization
sql/mysql_priv.h:
  Made local function global
sql/set_var.cc:
  Simple cleanup
sql/sql_table.cc:
  Simple cleanups & optimizations
2004-12-02 14:43:51 +02:00
unknown
32fa7e0f4d Portability fix. Why not to use UINT_MAX32 here? 2004-11-30 15:10:48 +04:00
unknown
7368b14719 Manual merge of fix for bug #6266 "Invalid DATETIME value is not handled
properly" with main tree.


libmysql/libmysql.c:
  Auto merged
sql-common/my_time.c:
  Auto merged
sql/field.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
tests/client_test.c:
  Manual merge.
2004-11-19 18:35:36 +03:00
unknown
5d9f7edd6d Fix for bug #6266 "Invalid DATETIME value is not handled properly".
In server we assume that datetime values stored in MYSQL_TIME struct
are normalized (and year is not greater than 9999), so we should 
perform range checks in all places then we convert something to
MYSQL_TIME. 


include/my_time.h:
  Added one more argument to set_zero_time() function to make it more 
  convinient.
  Added comment clarifying why MAX_DATE_STRING_REP_LENGTH value is 30.
include/mysql_time.h:
  Documented MySQL's internal assumptions for members of MYSQL_TIME
  structure.
libmysql/libmysql.c:
  It does not make sense to set MYSQL_TIME::time_type twice in case of 
  errors.
mysql-test/r/type_datetime.result:
  Added test for bug #6266 "Invalid DATETIME value not handled properly".
mysql-test/t/type_datetime.test:
  Added test for bug #6266 "Invalid DATETIME value not handled properly".
sql-common/my_time.c:
  str_to_datetime(): Added missing check for too big year values.
  set_zero_time(): added time_type argument, since MYSQL_TIMESTAMP_NONE
    is not the value that we want in most cases.
sql/field.cc:
  Field_datetime::store_time():
    clarified why we don't perform any range checks here.
sql/item.cc:
  Item_param::set_time():
   Added comment describing this method and range checking for TIME
   values.
sql/sql_prepare.cc:
  Removed comments about range checking for TIME values in prepared 
  statements, which are no longer true.
  set_zero_time() has one more argument now.
tests/client_test.c:
  Added test for bug #6266 "Invalid DATETIME value not handled properly"
2004-11-15 15:44:29 +03:00