Commit graph

1161 commits

Author SHA1 Message Date
unknown
952556b345 MWL#89
Merge 5.3 with 5.3-mwl89.
2011-03-30 10:10:59 +03:00
Sergei Golubchik
e016a2f5f0 lp:705210 Compiling with BUILD/compile-pentium64-debug fails 2011-03-26 11:59:34 +01:00
unknown
ec23949158 Fix LP BUG#715738
Analysis:
A query with implicit grouping is one with aggregate functions and
no GROUP BY clause. MariaDB inherits from MySQL an SQL extenstion
that allows mixing aggregate functions with non-aggregate fields.
If a query with such mixed select clause produces an empty result
set, the meaning of aggregate functions is well defined - either
NULL (MIN, MAX, etc.), or 0 (count(*)). However the non-aggregated
fields must also have some value, and the only reasonable value in
the case of empty result is NULL.

The cause of the many wrong results was that if a field is declared
as non-nullable (e.g. because it is a PK or NOT NULL), the semantic
analysis and the optimization phases treat this field as non-nullable,
and generate all related query plan elements based on this assumption.

Later during execution, these incorrectly configured/generated query
plan elements result in a wrong result because the selected fields
are not null due to the not-null assumption during optimization.

Solution:
Detect before the context analysys phase that a query uses implicit
grouping with mixed aggregates/non-aggregates, and set all fields
as nullable. The parser already walks the SELECT clause, and
already sets Item::with_sum_func for Items that reference aggreagate
functions. The patch adds a symmetric Item::with_field so that all
Items that reference an Item_field are marked during their
construction at parse time in the same way as with aggregate function
use.
2011-03-24 16:34:06 +02:00
Sergei Golubchik
c629477981 lp:737474 Wrong result with DAY(COALESCE(NULL)) in 5.1-micro
fix the return value of Item_func_coalesce::get_date()
2011-03-18 19:29:52 +01:00
Sergei Golubchik
db9c46de40 number to time comparison 2011-03-18 13:50:39 +01:00
Sergei Golubchik
684405e741 lp:737092 Assertion `item->null_value' failed in get_datetime_value in 5.1-micro
Implement Item_func_coalesce::get_date()
2011-03-17 22:04:45 +01:00
Igor Babaev
f1cc6dd401 Merge. 2011-03-12 05:14:10 -08:00
Igor Babaev
81316aac3a Fixed LP bugs BUG#729067/730466.
Do not reset the value of the item_equal field in the Item_field object
once it has been set.
2011-03-12 00:49:03 -08:00
Michael Widenius
139a2b64bf Merge with 5.2 2011-03-09 15:47:59 +02:00
Sergei Golubchik
8b7fd8f577 lp:731124 Loss of precision on DISTINCT
many changes:
* NOT_FIXED_DEC now create hires fields, not old ones.
  As a result, temp tables preserve microseconds (on DISTINCT, GROUP BY)
* I_S tables force decimals=0 on temporal types (backward compatibility)
* Item_func_coalesce calculates decimals for temporal types
* no precision for TIME/DATETIME in CAST means 0, not NOT_FIXED_DEC
* addtime/timediff calculate decimals from arguments (not NOT_FIXED_DEC)

sql/field.h:
  NOT_FIXED_DEC now create hires fields, not old ones
sql/item.h:
  force decimals=0 for I_S tables
sql/item_cmpfunc.cc:
  Item_func_coalesce calculates decimals for temporal types
sql/item_create.cc:
  no precision for TIME/DATETIME in CAST means 0, not NOT_FIXED_DEC
sql/item_timefunc.cc:
  addtime calculates decimals from arguments (not NOT_FIXED_DEC)
sql/item_timefunc.h:
  timediff calculates decimals from arguments (not NOT_FIXED_DEC)
2011-03-08 19:41:58 +01:00
Sergei Golubchik
30e5b4d719 lp:730637 - Valgrind warnings in 5.1-micro
sql/field.cc:
  initialize ltime completely
sql/filesort.cc:
  don't pack MYSQL_TIME if it's not initialized
  (safe here, but valgrind complains)
sql/item_cmpfunc.cc:
  don't pack MYSQL_TIME if it's not initialized
  (safe here, but valgrind complains)
sql/item_timefunc.cc:
  don't check MYSQL_TIME members if it's uninitialized
  (safe here, but valgrind complains)
sql/time.cc:
  use c_ptr_safe() instead of c_ptr()
  (make valgrind happy)
2011-03-07 21:57:17 +01:00
Sergei Golubchik
a8a757c6bb wl#173 - temporal types with sub-second resolution
and collateral changes.

* introduce my_hrtime_t, my_timediff_t, and conversion macros
* inroduce TIME_RESULT, but it can only be returned from Item::cmp_type(),
  never from Item::result_type()
* pack_time/unpack_time function for "packed" representation of
  MYSQL_TIME in a longlong that can be compared
* ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
* numbers aren't quoted in EXPLAIN EXTENDED
* new column I_S.COLUMNS.DATETIME_PRECISION
* date/time values are compares to anything as date/time, not as strings or numbers.
* old timestamp(X) is no longer supported
* MYSQL_TIME to string conversion functions take precision as an argument
* unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
* Field_timestamp_hires, Field_datetime_hires, Field_time_hires
* Field_temporal
* Lazy_string class to pass a value (string, number, time) polymorphically down the stack
* make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
* removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
* introduced Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
* in many cases date/time types are treated like other types, not as special cases
* greatly simplified Arg_comparator (regarding date/time/year code)
* SEC_TO_TIME is real function, not integer.
* microsecond precision in NOW, CURTIME, etc
* Item_temporal. All items derived from it only provide get_date, but no val* methods
* replication of NOW(6)
* Protocol::store(time) now takes the precision as an argument
* @@TIMESTAMP is a double

client/mysqlbinlog.cc:
  remove unneded casts
include/my_sys.h:
  introduce my_hrtime_t, my_timediff_t, and conversion macros
include/my_time.h:
  pack_time/unpack_time, etc.
  convenience functions to work with MYSQL_TIME::second_part
libmysql/libmysql.c:
  str_to_time() is gone. str_to_datetime() does it now.
  my_TIME_to_str() takes the precision as an argument
mysql-test/include/ps_conv.inc:
  time is not equal to datetime anymore
mysql-test/r/distinct.result:
  a test for an old MySQL bug
mysql-test/r/explain.result:
  numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_default.result:
  numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_sapdb.result:
  when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/func_test.result:
  numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/func_time.result:
  ADDTIME()/SUBTIME()/+- INTERVAL now work with TIME values
mysql-test/r/having.result:
  numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/information_schema.result:
  new column I_S.COLUMNS.DATETIME_PRECISION
mysql-test/r/join_outer.result:
  numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/metadata.result:
  TIMESTAMP no longer has zerofill flag
mysql-test/r/range.result:
  invalid datetime is not compared with as a string
mysql-test/r/select.result:
  NO_ZERO_IN_DATE, etc only affect storage - according to the manual
  numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/subselect.result:
  numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/sysdate_is_now.result:
  when decimals=NOT_FIXED_DEC it means "not fixed" indeed
mysql-test/r/type_blob.result:
  TIMESTAMP(N) is not deprecated
mysql-test/r/type_timestamp.result:
  old TIMESTAMP(X) semantics is not supported anymore
mysql-test/r/union.result:
  numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/r/varbinary.result:
  numbers aren't quoted in EXPLAIN EXTENDED
mysql-test/t/distinct.test:
  test for an old MySQL bug
mysql-test/t/func_time.test:
  +- INTERVAL now works with TIME values
mysql-test/t/select.test:
  typo
mysql-test/t/subselect.test:
  only one error per statement, please
mysql-test/t/system_mysql_db_fix40123.test:
  old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50030.test:
  old timestamp(X) is no longer supported
mysql-test/t/system_mysql_db_fix50117.test:
  old timestamp(X) is no longer supported
mysql-test/t/type_blob.test:
  old timestamp(X) is no longer supported
mysql-test/t/type_timestamp.test:
  old timestamp(X) is no longer supported
mysys/my_getsystime.c:
  functions to get the time with microsecond precision
mysys/my_init.c:
  move the my_getsystime.c initialization code to my_getsystime.c
mysys/my_static.c:
  no need to make these variables extern
mysys/my_static.h:
  no need to make these variables extern
scripts/mysql_system_tables.sql:
  old timestamp(X) is no longer supported
scripts/mysql_system_tables_fix.sql:
  old timestamp(X) is no longer supported
scripts/mysqlhotcopy.sh:
  old timestamp(X) is no longer supported
sql-common/my_time.c:
  * call str_to_time from str_to_datetime, as appropriate
  * date/time to string conversions take precision as an argument
  * number_to_time()
  * TIME_to_double()
  * pack_time() and unpack_time()
sql/event_data_objects.cc:
  cast is not needed
  my_datetime_to_str() takes precision as an argument
sql/event_db_repository.cc:
  avoid dangerous downcast (because the pointer is
  not always Field_timestamp, see events_1.test)
sql/event_queue.cc:
  avoid silly double-work for cond_wait
  (having an endpoint of wait, subtract the current time to get the timeout,
  and use set_timespec() macro to fill in struct timespec, by adding the current
  time to the timeout)
sql/field.cc:
  * remove virtual Field::get_time(), everyone should use only Field::get_date()
  * remove lots of #ifdef WORDS_BIGENDIAN
  * unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
  * Field_timestamp_hires, Field_datetime_hires, Field_time_hires
  * Field_temporal
  * make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
sql/field.h:
  * remove virtual Field::get_time(), everyone should use only Field::get_date()
  * remove lots of #ifdef WORDS_BIGENDIAN
  * unified the warnings from Field_timestamp/datetime/time/date/newdate store methods
  * Field_timestamp_hires, Field_datetime_hires, Field_time_hires
  * Field_temporal
  * make_truncated_value_warning and Field::set_datetime_warning use Lazy_string as an argument, removed char*/int/double variants
  * removed Field::can_be_compared_as_longlong(). Use Field::cmp_type() == INT_RESULT instead
sql/filesort.cc:
  TIME_RESULT, cmp_time()
sql/item.cc:
  * numbers aren't quoted in EXPLAIN EXTENDED
  * Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
  * virtual Item::get_time() is gone
  * Item_param::field_type() is set correctly
  * Item_datetime, for a datetime constant
  * time to anything is compared as a time
  * Item_cache::print() prints the value is available
  * bug fixed in Item_cache_int::val_str()
sql/item.h:
  * Item::print_value(), to be used from Item_xxx::print() when needed
  * Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
  * virtual Item::get_time() is gone
  * Item_datetime, for a datetime constant
  * better default for cast_to_int_type()
  * Item_cache objects now *always* have the field_type() set
sql/item_cmpfunc.cc:
  * get_year_value, get_time_value are gone. get_datetime_value does it all
  * get_value_a_func, get_value_b_func are gone
  * can_compare_as_dates() is gone too, TIME_RESULT is used instead
  * cmp_type() instead or result_type() when doing a comparison
  * compare_datetime and compate_e_datetime in the comparator_matrix, is_nulls_eq is gone
  * Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
sql/item_cmpfunc.h:
  greatly simplified Arg_comparator
sql/item_create.cc:
  * fix a bug in error messages in CAST
sql/item_func.cc:
  Item::cmp_result() instead of Item::is_datetime() and Item::result_as_longlong()
  mention all possibitiles in switch over Item_result values, or use default:
sql/item_row.h:
  overwrite the default cmp_type() for Item_row,
  as no MYSQL_TYPE_xxx value corresponds to ROW_RESULT
sql/item_timefunc.cc:
  rewrite make_datetime to support precision argument
  SEC_TO_TIME is real function, not integer.
  many functions that returned temporal values had duplicate code in val_* methods,
  some of them did not have get_date() which resulted in unnecessary date->str->date conversions. 
  Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
  many fixes to set decimals (datetime precision) correctly.
sql/item_timefunc.h:
  SEC_TO_TIME is real function, not integer.
  many functions that returned temporal values had duplicate code in val_* methods,
  some of them did not have get_date() which resulted in unnecessary date->str->date conversions. 
  Now they all are derived from Item_temporal_func and *only* provide get_date, not val* methods.
  many fixes to set decimals (datetime precision) correctly.
sql/log_event.cc:
  replication of NOW(6)
sql/log_event.h:
  replication of NOW(6)
sql/mysql_priv.h:
  Lazy_string class to pass a value (string, number, time) polymorphically down the stack.
  make_truncated_value_warning() that uses it.
sql/mysqld.cc:
  datetime in Arg_comparator::comparator_matrix
sql/opt_range.cc:
  cleanup: don't disable warnings before calling save_in_field_no_warnings()
sql/protocol.cc:
  Protocol::store(time) now takes the precision as an argument
sql/protocol.h:
  Protocol::store(time) now takes the precision as an argument
sql/rpl_rli.cc:
  small cleanup
sql/set_var.cc:
  SET TIMESTAMP=double
sql/set_var.h:
  @@TIMESTAMP is a double
sql/share/errmsg.txt:
  precision and scale are unsigned
sql/slave.cc:
  replication of NOW(6)
sql/sp_head.cc:
  cleanup
sql/sql_class.cc:
  support for NOW(6)
sql/sql_class.h:
  support for NOW(6)
sql/sql_insert.cc:
  support for NOW(6)
sql/sql_select.cc:
  use item->cmp_type().
  move a comment where it belongs
sql/sql_show.cc:
  new column I_S.COLUMNS.DATETIME_PRECISION
sql/sql_yacc.yy:
  TIME(X), DATETIME(X), cast, NOW(X), CURTIME(X), etc
sql/time.cc:
  fix date_add_interval() to support MYSQL_TIMESTAMP_TIME argument
storage/myisam/ha_myisam.cc:
  TIMESTAMP no longer carries ZEROFIELD flag, still we keep MYI file compatible.
strings/my_vsnprintf.c:
  warnings
tests/mysql_client_test.c:
  old timestamp(X) does not work anymore
  datetime is no longer equal to time
2011-03-01 13:24:36 +01:00
unknown
7895c35874 MWL#89
Merge MWL#89 with 5.3.
2011-03-01 14:16:28 +02:00
Alexander Barkov
14263b222a Bug#11753363 (bug#44793) CHARACTER SETS: CASE CLAUSE, UCS2 OR UTF32, FAILURE
Problem: in case of string CASE/WHEN arguments with different
character sets, Item_func_case::find_item() called comparator
cmp_items[x] on mixed character set Items, so a 8-bit value could
be errouneously referenced to as being utf16/utf32 value,
which led to crash on DBUG_ASSERT() because of wrong value length.
This was wrong, as string comparator expects arguments in the same
character set.

Fix: modify Item_func_case's argument list after calling
agg_arg_charsets_for_comparison() - put the Items in "agg" array
back to "args", because some of the Items in the "agg" array might
have been changed to character set converters:
- to Item_func_conv_charset for non-constant items
- to Item_string for constant items

In other words, perform the same substitution which is done in
all other operations string comparison or string result operations:

Replace
  CASE         latin1_item              WHEN utf16_item THEN ... END
to
  CASE CONVERT(latin1_item USING utf16) WHEN utf16_item THEN ... END

Replace
  CASE utf16_item WHEN         latin1_item              THEN ... END
to
  CASE utf16_item WHEN CONVERT(latin1_item USING utf16) THEN ... END


  @ mysql-test/r/ctype_utf16.result
  @ mysql-test/r/ctype_utf32.result
  @ mysql-test/t/ctype_utf16.test
  @ mysql-test/t/ctype_utf32.test
  Adding tests

  @ sql/item_cmpfunc.cc
  Put "agg" back to "args".

  @ sql/sql_string.cc
  Backporting a fix for String::set_or_copy_aligned() from 5.6,
  for better test coverage:
  "SELECT _utf16 0x61" should expand the string to 0x0061 rather
  than to 0x000061.
  This fix was made in 5.6 under terms of "WL#4616 Implement UTF16-LE".
2011-03-01 15:09:37 +03:00
Michael Widenius
3358cdd504 Merge with 5.1 to get in changes from MySQL 5.1.55 2011-02-28 19:39:30 +02:00
Michael Widenius
58bb0769bd Merge with MySQL 5.1.55
- Fixed some issues with partitions and connection_string, which also fixed lp:716890 "Pre- and post-recovery crash in Aria"
- Fixed wrong assert in Aria

Now need to merge with latest xtradb before pushing 

sql/ha_partition.cc:
  Ensure that m_ordered_rec_buffer is not freed before close.
sql/mysqld.cc:
  Changed to use opt_stack_trace instead of opt_pstack.
  Removed references to pstack
sql/partition_element.h:
  Ensure that connect_string is initialized
storage/maria/ma_key_recover.c:
  Fixed wrong assert
2011-02-20 18:51:43 +02:00
Alexander Barkov
0db53b19b7 Bug#60101 COALESCE with cp1251 tables causes [Err] 1267 - Illegal mix of collations
Problem:
  IF() did not copy collation derivation and repertoire from
  an argument if the opposite argument was NULL:
    IF(cond, res1, NULL)
    IF(cond, NULL, res2)
  only CHARSET_INFO pointer was copied.
  This resulted in illegal mix of collations error.

Fix:
  copy all collation parameters from the non-NULL argument:
  CHARSET_INFO pointer, derivation, repertoire.
2011-02-18 10:32:40 +03:00
Sergey Petrunya
cdccdea951 MWL#90: Merge (4) 2011-02-15 22:25:10 +03:00
Sergey Petrunya
e4325ff60b MWL#90: Subqueries: Inside-out execution for materialized non-sj subqueries
- Merge with 5.3 (3)
2011-02-15 20:29:57 +03:00
unknown
17fe23e46c Merge from mysql-5.1.55-release 2011-02-08 12:52:33 +01:00
Igor Babaev
cbeab25085 Fixed LP bug #702403 that caused a crash on the tree for mwl#128
with the test case added by this patch.
The bug cannot be reproduced with the same test case for the main
5.3 tree because the backported fix for bug 59696 masks the 
problem that causes the crash in the mentioned test case. It's not
clear weather this fix masks this problem in all possible cases. 

Anyway the patch for bug 698882 introduced some inconsistent data
structures that could contain indirect references to deleted object.
It happened when two Item_equal objects were merged and the Item_field
list of the second object was joined to such list of the first object.
This operation required adjustment of the backward pointers in 
Item fields from the joined list. However the adjustment was missing 
and this caused crashes in the tree for mwl#128.

Now the backward pointers are set only when Item_equal items are
completely built and are not changed anymore.
2011-02-05 20:57:03 -08:00
Karen Langford
de3c4428b8 Updating header copyright/README in source for 2011 2011-01-25 15:42:40 +01:00
unknown
902a307df1 Fix of reverting changes in depend_on list. 2011-01-21 09:56:55 +02:00
Martin Hansson
03db0de64f Bug#59173: Failure to handle DATE(TIME) values where Year, Month or Day is
ZERO
      
When dates are represented internally as strings, i.e. when a string constant
is compared to a date value, both values are converted to long integers,
ostensibly for fast comparisons. DATE typed integer values are converted to
DATETIME by multiplying by 1,000,000 (each digit pair representing hour,
minute and second, respectively). But the mechanism did not distuinguish
cached INTEGER values, already in correct format, from newly converted
strings.

Fixed by marking the INTEGER cache as being of DATETIME format.
2011-01-19 15:09:32 +01:00
Igor Babaev
84a0c9b2a2 Fixed LP bug #698882.
Made sure that the optimal fields are used by TABLE_REF objects
when building index access keys to joined tables.
Fixed a bug in the template function that sorts the elements of
a list using the bubble sort algorithm. The bug caused poor
performance of the function. Also added an optimization that
skips comparison with the most heavy elements that has been 
already properly placed in the list.
Made the comparison of the fields belonging to the same Item_equal
more granular: fields belonging to the same table are also ordered
according to some rules.
2011-01-15 11:14:36 -08:00
Oystein Grovlen
651313bf91 Bug#59211: Select Returns Different Value for min(year) Function
get_year_value() contains code to convert 2-digits year to
4-digits.  The fix for Bug#49910 added a check on the size of
the underlying field so that this conversion is not done for
YEAR(4) values. (Since otherwise one would convert invalid
YEAR(4) values to valid ones.)

The existing check does not work when Item_cache is used, since
it is not detected when the cache is based on a Field.  The
reported change in behavior is due to Bug#58030 which added
extra cached items in min/max computations.

The elegant solution would be to implement
Item_cache::real_item() to return the underlying Item.
However, some side effects are observed (change in explain
output) that indicates that such a change is not straight-
forward, and definitely not appropriate for an MRU.

Instead, a Item_cache::field() method has been added in order
to get access to the underlying field.  (This field() method
eliminates the need for Item_cache::eq_def() used in
test_if_ref(), but in order to limit the scope of this fix,
that code has been left as is.)


mysql-test/r/type_year.result:
  Added test case for Bug#59211.
mysql-test/t/type_year.test:
  Added test case for Bug#59211.
sql/item.h:
  Added function Item_cache::field() to get access to the
  underlying Field of a cached field Value.
sql/item_cmpfunc.cc:
  Also check underlying fields of Item_cache, not just Item_Field,
  when checking whether the value is of type YEAR(4) or not.
2011-01-12 10:37:15 +01:00
Jonathan Perkin
f13788c9fd Merge from mysql-5.5.9-release 2011-02-08 14:59:03 +01:00
Martin Hansson
4073411145 Merge of fix for Bug#59173. 2011-01-19 15:12:43 +01:00
Oystein Grovlen
17cd0bccdb Merge fix for Bug#59211 to mysql-5.5-security 2011-01-12 11:27:31 +01:00
unknown
b0be3e2c68 Merge MWL#89 into 5.3 main. 2011-01-11 14:04:08 +02:00
Tor Didriksen
7bf234032a Bug #59241 invalid memory read in do_div_mod with doubly assigned variables
Fix: copy my_decimal by value, to avoid dangling pointers.


mysql-test/r/func_math.result:
  New test case.
mysql-test/t/func_math.test:
  New test case.
sql/item_cmpfunc.cc:
  No need to call fix_buffer_pointer() anymore.
sql/item_func.cc:
  Copy my_decimal by value, to avoid dangling pointers.
sql/my_decimal.h:
  Implement proper copy constructor and assignment operator for my_decimal.
sql/sql_analyse.cc:
  No need to call fix_buffer_pointer() anymore.
strings/decimal.c:
  Remove #line directive: it messes up TAGS and it confuses gdb when debugging.
2011-01-14 10:05:14 +01:00
Ole John Aske
a6c4129150 Fix for Bug#57034 incorrect OUTER JOIN result when joined on unique key
Item_equal::val_int() checked for NULL-values by checking Item::null_value
*before* the respective ::store_value() and ::cmp(Item*) metods where called.

As Item::null_value is set by these metods, the value of 'null_value' 
is not valid until *after* ::store_value() or ::cmp() has
been called for the Item object.
      
Fix is to swap order of ::store_value()/::cmp() and checking of Item::null_value.
This pattern is widely used other places inside item_cmpfunc.cc .
2011-01-13 09:33:30 +01:00
Kent Boortz
be6c3fd8aa Merge 2010-12-29 01:26:31 +01:00
Kent Boortz
4acfdb9df1 Merge 2010-12-29 00:47:05 +01:00
Kent Boortz
85323eda8a - Added/updated copyright headers
- Removed files specific to compiling on OS/2
- Removed files specific to SCO Unix packaging
- Removed "libmysqld/copyright", text is included in documentation
- Removed LaTeX headers for NDB Doxygen documentation
- Removed obsolete NDB files
- Removed "mkisofs" binaries
- Removed the "cvs2cl.pl" script
- Changed a few GPL texts to use "program" instead of "library"
2010-12-28 19:57:23 +01:00
Georgi Kodinov
74e2520cd9 merge mysql-5.5->mysql-5.5-bugteam 2010-12-16 18:44:17 +02:00
Georgi Kodinov
b908a74bc9 merge 2010-12-16 16:40:52 +02:00
Sergey Glukhov
fcb83cbf15 Fixed following problems:
--Bug#52157 various crashes and assertions with multi-table update, stored function
--Bug#54475 improper error handling causes cascading crashing failures in innodb/ndb
--Bug#57703 create view cause Assertion failed: 0, file .\item_subselect.cc, line 846
--Bug#57352 valgrind warnings when creating view
--Recently discovered problem when a nested materialized derived table is used
  before being populated and it leads to incorrect result

We have several modes when we should disable subquery evaluation.
The reasons for disabling are different. It could be
uselessness of the evaluation as in case of 'CREATE VIEW'
or 'PREPARE stmt', or we should disable subquery evaluation
if tables are not locked yet as it happens in bug#54475, or
too early evaluation of subqueries can lead to wrong result
as it happened in Bug#19077.
Main problem is that if subquery items are treated as const
they are evaluated in ::fix_fields(), ::fix_length_and_dec()
of the parental items as a lot of these methods have
Item::val_...() calls inside.
We have to make subqueries non-const to prevent unnecessary
subquery evaluation. At the moment we have different methods
for this. Here is a list of these modes:

1. PREPARE stmt;
We use UNCACHEABLE_PREPARE flag.
It is set during parsing in sql_parse.cc, mysql_new_select() for
each SELECT_LEX object and cleared at the end of PREPARE in
sql_prepare.cc, init_stmt_after_parse(). If this flag is set
subquery becomes non-const and evaluation does not happen.

2. CREATE|ALTER VIEW, SHOW CREATE VIEW, I_S tables which
   process FRM files
We use LEX::view_prepare_mode field. We set it before
view preparation and check this flag in
::fix_fields(), ::fix_length_and_dec().
Some bugs are fixed using this approach,
some are not(Bug#57352, Bug#57703). The problem here is
that we have a lot of ::fix_fields(), ::fix_length_and_dec()
where we use Item::val_...() calls for const items.

3. Derived tables with subquery = wrong result(Bug19077)
The reason of this bug is too early subquery evaluation.
It was fixed by adding Item::with_subselect field
The check of this field in appropriate places prevents
const item evaluation if the item have subquery.
The fix for Bug19077 fixes only the problem with
convert_constant_item() function and does not cover
other places(::fix_fields(), ::fix_length_and_dec() again)
where subqueries could be evaluated.

Example:
CREATE TABLE t1 (i INT, j BIGINT);
INSERT INTO t1 VALUES (1, 2), (2, 2), (3, 2);
SELECT * FROM (SELECT MIN(i) FROM t1
WHERE j = SUBSTRING('12', (SELECT * FROM (SELECT MIN(j) FROM t1) t2))) t3;
DROP TABLE t1;

4. Derived tables with subquery where subquery
   is evaluated before table locking(Bug#54475, Bug#52157)

Suggested solution is following:

-Introduce new field LEX::context_analysis_only with the following
 possible flags:
 #define CONTEXT_ANALYSIS_ONLY_PREPARE 1
 #define CONTEXT_ANALYSIS_ONLY_VIEW    2
 #define CONTEXT_ANALYSIS_ONLY_DERIVED 4
-Set/clean these flags when we perform
 context analysis operation
-Item_subselect::const_item() returns
 result depending on LEX::context_analysis_only.
 If context_analysis_only is set then we return
 FALSE that means that subquery is non-const.
 As all subquery types are wrapped by Item_subselect
 it allow as to make subquery non-const when
 it's necessary.


mysql-test/r/derived.result:
  test case
mysql-test/r/multi_update.result:
  test case
mysql-test/r/view.result:
  test case
mysql-test/suite/innodb/r/innodb_multi_update.result:
  test case
mysql-test/suite/innodb/t/innodb_multi_update.test:
  test case
mysql-test/suite/innodb_plugin/r/innodb_multi_update.result:
  test case
mysql-test/suite/innodb_plugin/t/innodb_multi_update.test:
  test case
mysql-test/t/derived.test:
  test case
mysql-test/t/multi_update.test:
  test case
mysql-test/t/view.test:
  test case
sql/item.cc:
  --removed unnecessary code
sql/item_cmpfunc.cc:
  --removed unnecessary checks
  --THD::is_context_analysis_only() is replaced with LEX::is_ps_or_view_context_analysis()
sql/item_func.cc:
  --refactored context analysis checks
sql/item_row.cc:
  --removed unnecessary checks
sql/item_subselect.cc:
  --removed unnecessary code
  --added DBUG_ASSERT into Item_subselect::exec()
    which asserts that subquery execution can not happen
    if LEX::context_analysis_only is set, i.e. at context
    analysis stage.
  --Item_subselect::const_item()
    Return FALSE if LEX::context_analysis_only is set.
    It prevents subquery evaluation in ::fix_fields &
    ::fix_length_and_dec at context analysis stage.
sql/item_subselect.h:
  --removed unnecessary code
sql/mysql_priv.h:
  --Added new set of flags.
sql/sql_class.h:
  --removed unnecessary code
sql/sql_derived.cc:
  --added LEX::context_analysis_only analysis intialization/cleanup
sql/sql_lex.cc:
  --init LEX::context_analysis_only field
sql/sql_lex.h:
  --New LEX::context_analysis_only field
sql/sql_parse.cc:
  --removed unnecessary code
sql/sql_prepare.cc:
  --removed unnecessary code
  --added LEX::context_analysis_only analysis intialization/cleanup
sql/sql_select.cc:
  --refactored context analysis checks
sql/sql_show.cc:
  --added LEX::context_analysis_only analysis intialization/cleanup
sql/sql_view.cc:
  --added LEX::context_analysis_only analysis intialization/cleanup
2010-12-14 12:33:03 +03:00
Sergey Petrunya
1bf3964fbe MWL#90: Subqueries: Inside-out execution for materialized non-sj subqueries
- Merge into 5.3-main
2010-12-09 18:07:59 +03:00
Sergey Glukhov
e6bf102466 5.1-bugteam->5.5-bugteam merge 2010-12-14 13:46:00 +03:00
Michael Widenius
eb70e64cea Fixed test results for windows builds
Fixed compiler warning

mysql-test/r/named_pipe.result:
  Fixed test results for windows builds
mysql-test/r/shm.result:
  Fixed test results for windows builds
sql/item_cmpfunc.cc:
  Fixed compiler warning about uninitialized "first"
2010-12-08 16:16:32 +02:00
Michael Widenius
b7b25dc666 Merge with 5.1-release.
- Fixed problem with oqgraph and 'make dist'

Note that after this merge we have a problem show in join_outer where we examine too many rows in one specific case (related to BUG#57024).
This will be fixed when mwl#128 is merged into 5.3.
2010-12-06 10:25:44 +02:00
Michael Widenius
1e5061fe3b merge with 5.1 2010-11-30 23:11:03 +02:00
Sergei Golubchik
65ca700def merge.
checkpoint.
does not compile.
2010-11-25 18:17:28 +01:00
Michael Widenius
b52020221e Merge with MySQL 5.1.52 2010-11-23 23:39:59 +02:00
Sergey Glukhov
52e8885269 5.1-security->5.5-security merge 2010-11-18 12:14:27 +03:00
Sergey Glukhov
1c94d43bbb Bug#58022 ... like ... escape export_set ( ... ) crashes when export_set returns warnings
ESCAPE argument might be empty string. It leads
to server crash under some circumstances.
The fix:
-added check if ESCAPE argument result is not empty string

mysql-test/r/ctype_latin1.result:
  test case
mysql-test/t/ctype_latin1.test:
  test case
sql/item_cmpfunc.cc:
  -added check if ESCAPE argument result is not empty string
2010-11-18 11:53:08 +03:00
unknown
bc7369b74b MWL#89: Cost-based choice between Materialization and IN->EXISTS transformation
Merge 5.3-mwl89 into 5.3 main.

There is one remaining test failure in this merge:
innodb_mysql_lock2. All other tests have been checked to
deliver the same results/explains as 5.3-mwl89, including
the few remaining wrong results.
2010-11-05 14:42:58 +02:00
Sergei Golubchik
8e7ebfbce8 5.2 merge 2010-10-28 19:04:23 +02:00
Sergei Golubchik
04a4b43346 merge with 5.1 2010-10-25 15:21:16 +02:00
Sergei Golubchik
745cc74c33 5.1.51 merge 2010-10-19 15:58:35 +02:00
Sergey Petrunya
72dd7575cd Merge 5.2->5.3
- Re-commit Monty's merge, partially fixed by Igor and SergeyP, 
  but still broken
2010-10-10 17:18:11 +03:00
Alexander Barkov
401e6c909c Bug#55744 GROUP_CONCAT + CASE + ucs return garbage
Problem: CASE didn't work with a mixture of different character
sets in THEN/ELSE in some cases.
This happened because after character set aggregation
newly created Item_func_conv_charset items corresponding
to THEN/ELSE arguments were not put back to args[] array.

Fix:
put all Item_func_conv_charset back to args[].


  @ mysql-test/include/ctype_numconv.inc
  @ mysql-test/r/ctype_ucs.result
  Adding tests

  @ sql/item_cmpfunc.cc
  Put "agg" back to args[] after character set aggregation.
2010-10-06 16:15:59 +04:00
Michael Widenius
ca672e6b61 Automatic merge 2010-10-01 18:27:32 +03:00
Konstantin Osipov
7a30a12228 Merge 5.5 -> 5.5-merge. 2010-09-24 17:18:45 +04:00
Michael Widenius
5ce4825b63 Fix usage of mysqld option --new, --old, --safe and --skip_new to not disable things that are proven stable or enable things that are not usefull.
sql/field.cc:
  Remove feature of 'new_mode' that was never implemtented in a newer MySQL version.
sql/item_cmpfunc.cc:
  Boyer more is stable; Don't have to be protected by --skip-new anymore
sql/mysqld.cc:
  Don't disable some proven stable functions with --skip-new
sql/records.cc:
  Don't disable record caching with --safe-mode anymore
sql/sql_delete.cc:
  Do fast truncate even if --skip-new or --safe is used
sql/sql_parse.cc:
  Use always mysql_optimizer() for optimizer (instead of mysql_recreate_table() in case of --safe or --skip-new)
sql/sql_select.cc:
  Don't disable 'only_eq_ref_tables' if --safe is used.
sql/sql_yacc.yy:
  Removed not meaningfull test of --old
2010-09-23 19:30:44 +03:00
Igor Babaev
b969df8bbd Merge of the mwl106 tree into the latest 5.3 tree.
Resolved conflicts. Adjusted some test results
2010-09-23 08:10:53 -07:00
unknown
35f0faf4c7 MWL#89: Cost-based choice between Materialization and IN->EXISTS transformation
- Corrected a wrong result that was recorded by the MySQL fix for BUG#39069.

- Removed Item_func_isnull::cached_value and all the logic around this custom-made
  caching of the NULL result because MWL#89 optimizes subqueries before the outer
  query is being executed, and this cache cannot be made easily to work for all
  kinds of Items (specifically Item_sum_sum, but others too).
2010-09-16 16:49:20 +03:00
Sergei Golubchik
b170b126b0 merge with 5.1 2010-09-16 09:58:57 +02:00
Igor Babaev
577b7345c7 Fixed bug #49600.
The problem could be demonstrated with an outer join of two single-row
tables where the values of the join attributes were null. Any query
with such a join could return a wrong result set if the where
condition of the query was not empty. For queries with empty
where conditions the result sets were correct.
This was the consequence of two bugs in the code:
 - Item_equal objects for on conditions of outer joins were
   not built if the processed query had no where condition
 - the check for null values in the code that evaluated constant 
   Item_equal objects was incorrect.
Fixed both above problems.
Added a test case for the bug and adjusted results for some other
test cases.
2010-09-11 08:20:35 -07:00
Alexey Kopytov
56d2940186 Manual merge of the fix for bug #54190 and the addendum patch
to 5.5 (removed one test case as it is no longer valid).

mysql-test/r/select.result:
  Removed a part of the test case for bug#48291 since it is not
  valid anymore. The comments for the removed part were actually
  describing a side-effect from the problem addressed by the
  addendum patch for bug #54190.
mysql-test/t/select.test:
  Removed a part of the test case for bug#48291 since it is not
  valid anymore. The comments for the removed part were actually
  describing a side-effect from the problem addressed by the
  addendum patch for bug #54190.
2010-09-09 19:00:33 +04:00
Alexey Kopytov
3ce925bfe7 Automerge. 2010-09-09 16:48:06 +04:00
Alexey Kopytov
453107bc56 Bug #54190: Comparison to row subquery produces incorrect
result

Row subqueries producing no rows were not handled as UNKNOWN
values in row comparison expressions.

That was a result of the following two problems:

1. Item_singlerow_subselect did not mark the resulting row
value as NULL/UNKNOWN when no rows were produced.

2. Arg_comparator::compare_row() did not take into account that
a whole argument may be NULL rather than just individual scalar
values.

Before bug#34384 was fixed, the above problems were hidden
because an uninitialized (i.e. without any stored value) cached
object would appear as NULL for scalar values in a row subquery
returning an empty result. After the fix
Arg_comparator::compare_row() would try to evaluate
uninitialized cached objects.

Fixed by removing the aforementioned problems.


mysql-test/r/row.result:
  Added a test case for bug #54190.
mysql-test/r/subselect.result:
  Updated the result for a test relying on wrong behavior.
mysql-test/t/row.test:
  Added a test case for bug #54190.
sql/item_cmpfunc.cc:
  If either of the argument rows is NULL, return NULL as the
  result of comparison.
sql/item_subselect.cc:
  Adjust null_value for Item_singlerow_subselect depending on
  whether a row has been produced by the row subquery.
2010-09-09 16:46:13 +04:00
Martin Hansson
32065d2258 Merge of fix for Bug#51070. 2010-09-07 12:17:12 +02:00
Martin Hansson
4f4d03a416 Bug#51070: Query with a NOT IN subquery predicate returns a wrong result set
The EXISTS transformation has additional switches to catch the known corner
cases that appear when transforming an IN predicate into EXISTS. Guarded
conditions are used which are deactivated when a NULL value is seen in the
outer expression's row. When the inner query block supplies NULL values,
however, they are filtered out because no distinction is made between the
guarded conditions; guarded NOT x IS NULL conditions in the HAVING clause that
filter out NULL values cannot be de-activated in isolation from those that
match values or from the outer expression or NULL's.

The above problem is handled by making the guarded conditions remember whether
they have rejected a NULL value or not, and index access methods are taking
this into account as well. 

The bug consisted of 

1) Not resetting the property for every nested loop iteration on the inner
   query's result.

2) Not propagating the NULL result properly from inner query to IN optimizer.

3) A hack that may or may not have been needed at some point. According to a
   comment it was aimed to fix #2 by returning NULL when FALSE was actually
   the result. This caused failures when #2 was properly fixed. The hack is
   now removed.

The fix resolves all three points.
2010-09-07 11:21:09 +02:00
unknown
d6a9b52269 Fixed LP BUG#615760: Check on double cache assignment added into the transformation methods.
Cache parameters print added in EXPLAIN EXTENDED output.

mysql-test/r/compare.result:
  Cache parameters print added in EXPLAIN EXTENDED output.
mysql-test/r/group_by.result:
  Cache parameters print added in EXPLAIN EXTENDED output.
mysql-test/r/subselect.result:
  Cache parameters print added in EXPLAIN EXTENDED output.
mysql-test/r/subselect3.result:
  Cache parameters print added in EXPLAIN EXTENDED output.
mysql-test/r/subselect3_jcl6.result:
  Cache parameters print added in EXPLAIN EXTENDED output.
mysql-test/r/subselect4.result:
  Cache parameters print added in EXPLAIN EXTENDED output.
mysql-test/r/subselect_cache.result:
  Added test suite for LP BUG#615760
mysql-test/r/subselect_mat.result:
  Cache parameters print added in EXPLAIN EXTENDED output.
mysql-test/r/subselect_no_mat.result:
  Cache parameters print added in EXPLAIN EXTENDED output.
mysql-test/r/subselect_no_opts.result:
  Cache parameters print added in EXPLAIN EXTENDED output.
mysql-test/r/subselect_no_semijoin.result:
  Cache parameters print added in EXPLAIN EXTENDED output.
mysql-test/r/subselect_sj.result:
  Cache parameters print added in EXPLAIN EXTENDED output.
mysql-test/r/subselect_sj_jcl6.result:
  Cache parameters print added in EXPLAIN EXTENDED output.
mysql-test/suite/pbxt/r/subselect.result:
  Cache parameters print added in EXPLAIN EXTENDED output.
mysql-test/t/subselect_cache.test:
  Cache parameters print added in EXPLAIN EXTENDED output.
sql/item.cc:
  Item::set_expr_cache result fixed according to its description.
  
  Cache parameters print added in EXPLAIN EXTENDED output.
sql/item.h:
  Cache parameters print added in EXPLAIN EXTENDED output.
sql/item_cmpfunc.cc:
  Check on double cache assignment added into the transformation methods.
sql/item_cmpfunc.h:
  Check on double cache assignment added into the transformation methods.
sql/item_subselect.cc:
  Check on double cache assignment added into the transformation methods.
sql/item_subselect.h:
  Check on double cache assignment added into the transformation methods.
sql/sql_expression_cache.cc:
  Cache parameters print added.
sql/sql_expression_cache.h:
  Cache parameters print added.
sql/sql_select.cc:
  Removed unused method (now it is impossible to make double transformation with the cache).
sql/sql_select.h:
  Removed unused method.
2010-09-06 15:34:24 +03:00
unknown
ccc8dabc9c MWL#89: Cost-based choice between Materialization and IN->EXISTS transformation
Fixed a crash in Item_equal::fix_length_and_dec that was a result of the
architecture of the MWL#89 subquery optimization.

The injection of IN->EXISTS predicates for subqueries happened inside
make_join_statistics, after constant substitution, but before multiple
equality substitution done by substitute_for_best_equal_field. As a
result, when we called fix_fields for the WHERE clause after the injection
of IN->EXISTS predicates, Item_equal was not fixed, and it was in a state
not anticipated by Item_equal::fix_length_and_dec - the Item_equal
containted only a constant, and no fields at all.

The fix takes into account this new possible state when calling fix_fields.
2010-09-06 13:19:47 +03:00
unknown
18ad3bdc2f MWL#89: Cost-based choice between Materialization and IN->EXISTS transformation
Fixes for multiple problems/bugs/test failures that resulted from moving
subquery optimization from the execution phase to the optimization phase.
2010-09-05 18:43:47 +03:00
Alexey Kopytov
04ae1aa954 Bug#55077: Assertion failed: width > 0 && to != ((void *)0),
file .\dtoa.c

The assertion failure was correct because the 'width' argument
of my_gcvt() has the signed integer type, whereas the unsigned
value UINT_MAX32 was being passed by the caller
(Field_double::val_str()) leading to a negative width in
my_gcvt().

The following chain of problems was found by further analysis:

1. The display width for a floating point number is calculated
in Field_double::val_str() as either field_length or the
maximum possible length of string representation of a floating
point number, whichever is greater. Since in the bug's test
case field_length is UINT_MAX32, we get the same value as the
display width. This does not make any sense because for numeric
values field_length only matters for ZEROFILL columns,
otherwise it does not make sense to allocate that much memory
just to print a number. Field_float::val_str() has a similar
problem.

2. Even if the above wasn't the case, we would still get a
crash on a slightly different test case when trying to allocate
UINT_MAX32 bytes with String::alloc() because the latter does
not handle such large input values correctly due to alignment
overflows.

3. Even when String::alloc() is fixed to return an error when
an alignment overflow occurs, there is still a problem because
almost no callers check its return value, and
Field_double::val_str() is not an exception (same for
Field_float::val_str()).

4. Even if all of the above wasn't the case, creating a
Field_double object with UINT_MAX32 as its field_length does
not make much sense either, since the .frm code limits it to
MAX_FIELD_CHARLENGTH (255) bytes. Such a beast can only be
created by create_tmp_field_from_item() from an Item with
REAL_RESULT as its result_type() and UINT_MAX32 as its
max_length.

5. For the bug's test case, the above condition (REAL_RESULT
Item with max_length = UINT_MAX32) was a result of
Item_func_if::fix_length_and_dec() "shortcutting" aggregation
of argument types when one of the arguments was a constant
NULL. In this case, the attributes of the aggregated type were
simply copied from the other, non-NULL argument, but max_length
was still calculated as per the general, non-shortcut case, by
choosing the greatest of argument's max_length, which is
obviously not correct.

The patch addresses all of the above problems, even though
fixing the assertion failure for the particular test case would
require only a subset of the above problems to be solved.


client/sql_string.cc:
  Return an error in case of uint32 overflow in alignment.
  Also assert there was no overflow to help find such conditions
  in debug builds, since almost no callers check the return value
  of String::alloc().
mysql-test/r/func_if.result:
  Add a test case for bug #55077.
mysql-test/t/func_if.test:
  Add a test case for bug #55077.
sql/field.cc:
  - Assert we don't operate with fields wider than 255 
  (MAX_FIELD_CHARLENGTH) bytes in both Field_float and  
  Field_double. 
  - Don't take field_length into account when calculating the 
  output buffer length.
  - Check the return value of String::alloc()
sql/item_cmpfunc.cc:
  When shortcutting type aggregation, don't take the NULL 
  argument's max_length into account.
sql/sql_string.cc:
  Return an error in case of uint32 overflow in alignment.
  Also assert there was no overflow to help find such conditions
  in debug builds, since almost no callers check the return value
  of String::alloc().
2010-08-25 19:57:53 +04:00
Alexander Barkov
7f98714247 Bug#54916 GROUP_CONCAT + IFNULL truncates output
Problem: a few functions did not calculate their max_length correctly.
This is an after-fix for WL#2649 Number-to-string conversions".

Fix: changing the buggy functions to calculate max_length
using fix_char_length() introduced in WL#2649,
instead of setting max_length directly

  mysql-test/include/ctype_numconv.inc
     Adding new tests

  mysql-test/r/ctype_binary.result
     Adding new tests

  mysql-test/r/ctype_cp1251.result
     Adding new tests

  mysql-test/r/ctype_latin1.result
     Adding new tests

  mysql-test/r/ctype_ucs.result
     Adding new tests

  mysql-test/r/ctype_utf8.result
     Adding new tests

  mysql-test/t/ctype_utf8.test
    Including ctype_numconv

  sql/item.h
    - Introducing new method fix_char_length_ulonglong(),
    for the cases when length is potentially greater
    than UINT_MAX32. This method removes a few
    instances of duplicate code, e.g. in item_strfunc.cc.
    - Setting collation in Item_copy properly. This change
    fixes wrong metadata on client side in some cases, when
    "binary" instead of the real character set was reported.

  sql/item_cmpfunc.cc
    - Using fix_char_length() and max_char_length() methods,
    instead of direct access to max_length, to calculate
    item length properly.
    - Moving count_only_length() in COALESCE after
    agg_arg_charsets_for_string_result(). The old
    order was incorrect and led to wrong length
    calucation in case of multi-byte character sets.
    
  sql/item_func.cc
    Fixing that count_only_length() didn't work
    properly for multi-byte character sets.
    Using fix_char_length() and max_char_length()
    instead of direct access to max_length.

  sql/item_strfunc.cc
    - Using fix_char_length(), fix_char_length_ulonglong(),
    max_char_length() instead of direct access to max_length.
    - Removing wierd condition: "if (collation.collation->mbmaxlen > 0)",
    which is never FALSE.
2010-08-19 15:55:35 +04:00
Michael Widenius
d042146e5b Merge with MariaDB 5.1.49
Removed references to HA_END_SPACE_KEY (which has been 0 for a long time)
2010-08-05 22:56:11 +03:00
Georgi Kodinov
ae64b6f7ab merge 2010-08-05 15:34:19 +03:00
Martin Hansson
0c81dcf332 Bug#54568: create view cause Assertion failed: 0,
file .\item_subselect.cc, line 836

IN quantified predicates are never executed directly. They are rather wrapped
inside nodes called IN Optimizers (Item_in_optimizer) which take care of the
execution. However, this is not done during query preparation. Unfortunately
the LIKE predicate pre-evaluates constant right-hand side arguments even
during name resolution. Likely this is meant as an optimization.

Fixed by not pre-evaluating LIKE arguments in view prepare mode.
2010-08-05 12:42:14 +02:00
Michael Widenius
e0a6b02c5d Merge with MySQL 5.1.49
Fixed Bug#52005 'JOIN_TAB->dependent' may be incorrectly propageted for multilevel outer joins' in a better way (patch from Sergey Petrunya)
2010-08-02 12:01:24 +03:00
Davi Arnaut
75e2212397 WL#5498: Remove dead and unused source code
Remove unused macros or macro which are always defined.

include/my_global.h:
  Remove unused macros and move macros which aren't used globally.
2010-07-23 17:16:29 -03:00
Evgeny Potemkin
4777370bb3 Bug#49771: Incorrect MIN/MAX for date/time values.
This bug is a design flaw of the fix for the bug#33546. It assumed that an
item can be used only in one comparison context, but actually it isn't the
case. Item_cache_datetime is used to store result for MIX/MAX aggregate
functions. Because Arg_comparator always compares datetime values as INTs when
possible the Item_cache_datetime most time caches only INT value. But
since all datetime values has STRING result type MIN/MAX functions are asked
for a STRING value when the result is being sent to a client. The
Item_cache_datetime was designed to avoid conversions and get INT/STRING
values from an underlying item, but at the moment the values is asked
underlying item doesn't hold it anymore thus wrong result is returned.
Beside that MIN/MAX aggregate functions was wrongly initializing cached result
and this led to a wrong result.

The Item::has_compatible_context helper function is added. It checks whether
this and given items has the same comparison context or can be compared as
DATETIME values by Arg_comparator. The equality propagation optimization is
adjusted to take into account that items which being compared as DATETIME
can have different comparison contexts.
The Item_cache_datetime now converts cached INT value to a correct STRING
DATETIME value by means of number_to_datetime & my_TIME_to_str functions.
The Arg_comparator::set_cmp_context_for_datetime helper function is added. 
It sets comparison context of items being compared as DATETIMEs to INT if
items will be compared as longlong.
The Item_sum_hybrid::setup function now correctly initializes its result
value.
In order to avoid unnecessary conversions Item_sum_hybrid now states that it
can provide correct longlong value if the item being aggregated can do it
too.

mysql-test/r/group_by.result:
  Added a test case for the bug#49771.
sql/item.cc:
  Bug#49771: Incorrect MIN/MAX for date/time values.
  The equality propagation mechanism is adjusted to take into account that
  items which being compared as DATETIME can have different comparison
  contexts.
  The Item_cache_datetime now converts cached INT value to a correct STRING
  DATETIME/TIME value.
sql/item.h:
  Bug#49771: Incorrect MIN/MAX for date/time values.
  The Item::has_compatible_context helper function is added. It checks whether
  this and given items has the same comparison context or can be compared as
  DATETIME values by Arg_comparator.
  Added Item_cache::clear helper function.
sql/item_cmpfunc.cc:
  Bug#49771: Incorrect MIN/MAX for date/time values.
  The Arg_comparator::set_cmp_func now sets the correct comparison context
  for items being compared as DATETIME values.
sql/item_cmpfunc.h:
  Bug#49771: Incorrect MIN/MAX for date/time values.
  The Arg_comparator::set_cmp_context_for_datetime helper function is added. 
  It sets comparison context of items being compared as DATETIMEs to INT if
  items will be compared as longlong.
sql/item_sum.cc:
  Bug#49771: Incorrect MIN/MAX for date/time values.
  The Item_sum_hybrid::setup function now correctly initializes its result
  value.
sql/item_sum.h:
  Bug#49771: Incorrect MIN/MAX for date/time values.
  In order to avoid unnecessary conversions Item_sum_hybrid now states that it
  can provide correct longlong value if the item being aggregated can do it
  too.
2010-07-19 21:11:47 +04:00
Igor Babaev
452860dfde Fixed bug #604503.
If the expression for a virtual column of table contained datetime
comparison then the execution of the second query that used this
virtual column caused a crash. It happened because the execution
of the first query that used this virtual column inserted a cached
item into the expression tree. The cached tree was allocated in
the statement memory while the expression tree was allocated in
the table memory.
Now the cached items that are inserted into expressions for virtual
columns with datetime comparisons are always allocated in the same
mem_root as the expressions for virtual columns. So now the inserted
cached items are valid for any queries that use these virtual columns.
2010-07-17 11:16:16 -07:00
Michael Widenius
ecbcddc03d Improved speed of thr_alarm from O(N) to O(1). thr_alarm is used to handle timeouts and kill of connections.
Fixed compiler warnings.
queues.h and queues.c are now based on the UNIREG code and thus made BSD.
Fix code to use new queue() interface. This mostly affects how you access elements in the queue.
If USE_NET_CLEAR is not set, don't clear connection from unexpected characters. This should give a speed up when doing a lot of fast queries.
Fixed some code in ma_ft_boolean_search.c that had not made it from myisam/ft_boolean_search.c


include/queues.h:
  Use UNIREG code base (BSD)
  Changed init_queue() to take all initialization arguments.
  New interface to access elements in queue
include/thr_alarm.h:
  Changed to use time_t instead of ulong (portability)
  Added index_in_queue, to be able to remove random element from queue in O(1)
mysys/queues.c:
  Use UNIREG code base (BSD)
  init_queue() and reinit_queue() now takes more initialization arguments. (No need for init_queue_ex() anymore)
  Now one can tell queue_insert() to store in the element a pointer to where element is in queue. This allows one to remove elements from queue in O(1) instead of O(N)
mysys/thr_alarm.c:
  Use new option in queue() to allow fast removal of elements.
  Do less inside LOCK_alarm mutex.
  This should give a major speed up of thr_alarm usage when there is many threads
sql/create_options.cc:
  Fixed wrong printf
sql/event_queue.cc:
  Use new queue interface()
sql/filesort.cc:
  Use new queue interface()
sql/ha_partition.cc:
  Use new queue interface()
sql/ha_partition.h:
  Fixed compiler warning
sql/item_cmpfunc.cc:
  Fixed compiler warning
sql/item_subselect.cc:
  Use new queue interface()
  Removed not used variable
sql/net_serv.cc:
  If USE_NET_CLEAR is not set, don't clear connection from unexpected characters.
  This should give a speed up when doing a lot of fast queries at the disadvantage that if there is a bug in the client protocol the connection will be dropped instead of being unnoticed.
sql/opt_range.cc:
  Use new queue interface()
  Fixed compiler warnings
sql/uniques.cc:
  Use new queue interface()
storage/maria/ma_ft_boolean_search.c:
  Copy code from myisam/ft_boolean_search.c
  Use new queue interface()
storage/maria/ma_ft_nlq_search.c:
  Use new queue interface()
storage/maria/ma_sort.c:
  Use new queue interface()
storage/maria/maria_pack.c:
  Use new queue interface()
  Use queue_fix() instead of own loop to fix queue.
storage/myisam/ft_boolean_search.c:
  Use new queue interface()
storage/myisam/ft_nlq_search.c:
  Use new queue interface()
storage/myisam/mi_test_all.sh:
  Remove temporary file from last run
storage/myisam/myisampack.c:
  Use new queue interface()
  Use queue_fix() instead of own loop to fix queue.
storage/myisam/sort.c:
  Use new queue interface()
storage/myisammrg/myrg_queue.c:
  Use new queue interface()
storage/myisammrg/myrg_rnext.c:
  Use new queue interface()
storage/myisammrg/myrg_rnext_same.c:
  Use new queue interface()
storage/myisammrg/myrg_rprev.c:
  Use new queue interface()
2010-07-16 10:33:01 +03:00
psergey
3a9aabaa26 MWL#90: Subqueries: Inside-out execution for materialized non-sj subqueries
- Merge with MariaDB 5.3 -main
2010-07-11 19:18:43 +04:00
psergey
946aef4a58 MWL#90: code cleanup
- Remove deadcode
- Improve comments 
- Do small several small TODOs
2010-07-10 20:51:12 +03:00
unknown
ceb5468fd8 Subquery cache (MWL#66) added.
libmysqld/Makefile.am:
  The new file added.
mysql-test/r/index_merge_myisam.result:
  subquery_cache optimization option added.
mysql-test/r/myisam_mrr.result:
  subquery_cache optimization option added.
mysql-test/r/subquery_cache.result:
  The subquery cache tests added.
mysql-test/r/subselect3.result:
  Subquery cache switched off to avoid changing read statistics.
mysql-test/r/subselect3_jcl6.result:
  Subquery cache switched off to avoid changing read statistics.
mysql-test/r/subselect_no_mat.result:
  subquery_cache optimization option added.
mysql-test/r/subselect_no_opts.result:
  subquery_cache optimization option added.
mysql-test/r/subselect_no_semijoin.result:
  subquery_cache optimization option added.
mysql-test/r/subselect_sj.result:
  subquery_cache optimization option added.
mysql-test/r/subselect_sj_jcl6.result:
  subquery_cache optimization option added.
mysql-test/t/subquery_cache.test:
  The subquery cache tests added.
mysql-test/t/subselect3.test:
  Subquery cache switched off to avoid changing read statistics.
sql/CMakeLists.txt:
  The new file added.
sql/Makefile.am:
  The new files added.
sql/item.cc:
  Expression cache item (Item_cache_wrapper) added.
  Item_ref and Item_field fixed for correct usage of result field and fast resolwing in SP.
sql/item.h:
  Expression cache item (Item_cache_wrapper) added.
  Item_ref and Item_field fixed for correct usage of result field and fast resolwing in SP.
sql/item_cmpfunc.cc:
  Subquery cache added.
sql/item_cmpfunc.h:
  Subquery cache added.
sql/item_subselect.cc:
  Subquery cache added.
sql/item_subselect.h:
  Subquery cache added.
sql/item_sum.cc:
  Registration of subquery parameters added.
sql/mysql_priv.h:
  subquery_cache optimization option added.
sql/mysqld.cc:
  subquery_cache optimization option added.
sql/opt_range.cc:
  Fix due to subquery cache.
sql/opt_subselect.cc:
  Parameters of the function cahnged.
sql/procedure.h:
  .h file guard added.
sql/sql_base.cc:
  Registration of subquery parameters added.
sql/sql_class.cc:
  Option to allow add indeces to temporary table.
sql/sql_class.h:
  Item iterators added.
  Option to allow add indeces to temporary table.
sql/sql_expression_cache.cc:
  Expression cache for caching subqueries added.
sql/sql_expression_cache.h:
  Expression cache for caching subqueries added.
sql/sql_lex.cc:
  Registration of subquery parameters added.
sql/sql_lex.h:
  Registration of subqueries and subquery parameters added.
sql/sql_select.cc:
  Subquery cache added.
sql/sql_select.h:
  Subquery cache added.
sql/sql_union.cc:
  A new parameter to the function added.
sql/sql_update.cc:
  A new parameter to the function added.
sql/table.cc:
  Procedures to manage temporarty tables index added.
sql/table.h:
  Procedures to manage temporarty tables index added.
storage/maria/ha_maria.cc:
  Fix of handler to allow destoy a table in case of error during the table creation.
storage/maria/ha_maria.h:
  .h file guard added.
storage/myisam/ha_myisam.cc:
  Fix of handler to allow destoy a table in case of error during the table creation.
2010-07-10 13:37:30 +03:00
Sergey Petrunya
27f9fc063c MariaDB 5.2 -> MariaDB 5.3 merge 2010-06-26 14:05:41 +04:00
Ramil Kalimullin
a23729ad38 Automerge. 2010-06-24 15:29:53 +04:00
Ramil Kalimullin
f4420a3b90 Automerge. 2010-06-24 15:26:14 +04:00
Alexey Kopytov
4b0305626c Automerge. 2010-06-24 14:43:39 +04:00
Alexey Kopytov
0e6560398c Bug#54477: Crash on IN / CASE with NULL arguments
Incorrect handling of NULL arguments could lead to a crash on
the IN or CASE operations when either NULL arguments were
passed explicitly as arguments (IN) or implicitly generated by
the WITH ROLLUP modifier (both IN and CASE).

Item_func_case::find_item() assumed all necessary comparators
to be instantiated in fix_length_and_dec(). However, in the
presence of WITH ROLLUP modifier, arguments could be
substituted with an Item_null leading to an "unexpected"
STRING_RESULT comparator being invoked.

In addition to the problem identical to the above,
Item_func_in::val_int() could crash even with explicitly passed
NULL arguments due to an optimization in fix_length_and_dec()
leading to NULL arguments being ignored during comparators
creation.


mysql-test/r/func_in.result:
  Test cases for bug#54477.
mysql-test/t/func_in.test:
  Test cases for bug#54477.
sql/item_cmpfunc.cc:
  Added additional checks for Item_nulls in 
  Item_func_case::find_item() and Item_func_in::val_int().
2010-06-22 22:53:08 +04:00
Ramil Kalimullin
1614c3c128 Fix for bug #54575: crash when joining tables with unique set column
Problem: a flaw (derefencing a NULL pointer) in the LIKE optimization
code may lead to a server crash in some rare cases.

Fix: check the pointer before its dereferencing.


mysql-test/r/func_like.result:
  Fix for bug #54575: crash when joining tables with unique set column
    - test result.
mysql-test/t/func_like.test:
  Fix for bug #54575: crash when joining tables with unique set column
    - test case.
sql/item_cmpfunc.cc:
  Fix for bug #54575: crash when joining tables with unique set column
    - check res2 buffer pointer before its dereferencing 
  as it may be NULL in some cases.
2010-06-20 02:02:58 +04:00
Sergey Petrunya
26c3dc455b MWL#90: Subqueries: Inside-out execution for non-semijoin materialized subqueries that are AND-parts of the WHERE
- Address feedback
- Code cleanup (not finished)
2010-06-08 18:22:31 +04:00
Sergey Petrunya
dad93f2c82 MWL#90, code movearound to unify merged and non-merged semi-join materialization processing
- First code, needs cleanup.
2010-06-04 17:40:57 +04:00
Gleb Shchepa
fefbd756db Bug #38745: MySQL 5.1 optimizer uses filesort for ORDER BY
when it should use index

Sometimes the LEFT/RIGHT JOIN with an empty table caused an
unnecessary filesort.

Sample query, where t1.i1 is indexed and t3 is empty:

  SELECT t1.*, t2.* FROM t1 JOIN t2 ON t1.i1 = t2.i2
                       LEFT JOIN t3 ON t2.i2 = t3.i3
    ORDER BY t1.i1 LIMIT 5;

The server erroneously used an item of empty outer-joined
table as a common constant of a Item_equal (multi-equivalence
expression).
By the fix for the bug 16590 the constant status of such
an item has been propagated to st_table::const_key_parts
map bits related to other Item_equal argument-related
key parts (those are obviously not constant in our case).
As far as test_if_skip_sort_order function skips constant
prefixes of testing keys, this caused an ignorance of
available indices, since some prefixes were marked as
constant by mistake.


mysql-test/r/order_by.result:
  Test case for bug #38745.
mysql-test/t/order_by.test:
  Test case for bug #38745.
sql/item.h:
  Bug #38745: MySQL 5.1 optimizer uses filesort for ORDER BY
              when it should use index
  
  Item::is_outer_field() has been added and overloaded for
  Item_field and Item_ref classes.
sql/item_cmpfunc.cc:
  Bug #38745: MySQL 5.1 optimizer uses filesort for ORDER BY
              when it should use index
  
  Item_equal::update_const() and Item_equal::update_used_tables()
  have been updated to not take into account the constantness
  of outer-joined table items.
2010-05-31 16:52:19 +04:00
Igor Babaev
709a0a1310 MWL#106: Backport optimizations for derived tables and views.
The main consolidated patch.
2010-05-26 13:18:18 -07:00
Sergey Petrunya
62bf7f6124 MWL#90: Subqueries: Inside-out execution for non-semijoin materialized subqueries that are AND-parts of the WHERE
- Code cleanu.
- Make MWL#90 code require @@optimizer_switch='semijoin=on'
- Update test results with the above
- Fork subselect_mat.test - we want to check both semi-join materialization, 
  which now has broader scope and non-semijoin materialization.
2010-05-25 10:32:15 +04:00
unknown
b1e00b6be8 Merge MySQL 5.1.46 into MariaDB.
Still two test failures to be solved: main.myisam and main.subselect.
2010-04-28 14:52:24 +02:00
Mats Kindahl
23d8586dbf WL#5030: Split and remove mysql_priv.h
This patch:

- Moves all definitions from the mysql_priv.h file into
  header files for the component where the variable is
  defined
- Creates header files if the component lacks one
- Eliminates all include directives from mysql_priv.h
- Eliminates all circular include cycles
- Rename time.cc to sql_time.cc
- Rename mysql_priv.h to sql_priv.h
2010-03-31 16:05:33 +02:00
Michael Widenius
1fec5af772 Fixed compiler warnings and sporadic failures in test cases
mysql-test/extra/rpl_tests/rpl_tmp_table_and_DDL.test:
  Added missing sync_slave_with_master; Fixes random failures
mysql-test/include/default_mysqld.cnf:
  default-character-set -> character-set-server (removes warning in error files for usage of deprecated options)
mysql-test/lib/My/SafeProcess/safe_process.cc:
  Fixed compiler warning
mysql-test/lib/v1/mysql-test-run.pl:
  default-character-set -> character-set-server (removes warning in error files for usage of deprecated options)
mysql-test/suite/rpl/r/rpl_do_grant.result:
  Updated test results
mysql-test/suite/rpl/t/rpl_do_grant.test:
  Added missing sync_slave_with_master; Fixes random failures
  Had to explictely do stop slave before DROP USER to avoid failure on slave as the user is already dropped on slave.
mysql-test/suite/rpl/t/rpl_name_const.test:
  Added missing sync_slave_with_master; Fixes random failures
mysql-test/suite/rpl/t/rpl_row_basic_11bugs.test:
  Added missing sync_slave_with_master; Fixes random failures
mysql-test/t/bug47671-master.opt:
  default-character-set -> character-set-server (removes warning in error files for usage of deprecated options)
mysql-test/t/ctype_latin1_de-master.opt:
  default-character-set -> character-set-server (removes warning in error files for usage of deprecated options)
mysql-test/t/ctype_ucs2_def-master.opt:
  default-character-set -> character-set-server (removes warning in error files for usage of deprecated options)
sql-common/client.c:
  Fixed compiler warning
sql/item.cc:
  Renamed function to remove compiler warnings (with gcc)
sql/item.h:
  Renamed function to remove compiler warnings (with gcc)
sql/item_cmpfunc.cc:
  Renamed function to remove compiler warnings (with gcc)
sql/item_create.cc:
  Renamed function to remove compiler warnings (with gcc)
sql/item_create.h:
  Renamed function to remove compiler warnings (with gcc)
sql/item_sum.cc:
  Renamed function to remove compiler warnings (with gcc)
sql/item_sum.h:
  Renamed function to remove compiler warnings (with gcc)
sql/set_var.cc:
  Don't use bit_do_set() / bot_is_set() / bit_do_clear() as this generates compiler warnings
  (They are also of no use as we know the value can hold the bits)
sql/sql_yacc.yy:
  Renamed function to remove compiler warnings (with gcc)
storage/example/ha_example.h:
  Fixed old read_time() prototype
storage/maria/ma_search.c:
  Added extra variables to remove compiler warnings
storage/maria/maria_def.h:
  Added extra variables to remove compiler warnings
storage/myisam/ft_stopwords.c:
  Added cast to get rid of compiler warning
storage/xtradb/fil/fil0fil.c:
  Added cast to get rid of compiler warning
storage/xtradb/include/page0page.h:
  Added const to get rid of compiler warning
storage/xtradb/include/page0page.ic:
  Added const to get rid of compiler warning
support-files/compiler_warnings.supp:
  Added suppression of strict-aliasing
2010-03-28 21:10:00 +03:00
Alexey Kopytov
d95c1e3b47 Manual merge of mysql-trunk into mysql-trunk-merge.
Conflicts:

Text conflict in client/mysqlbinlog.cc
Text conflict in mysql-test/Makefile.am
Text conflict in mysql-test/collections/default.daily
Text conflict in mysql-test/r/mysqlbinlog_row_innodb.result
Text conflict in mysql-test/suite/rpl/r/rpl_typeconv_innodb.result
Text conflict in mysql-test/suite/rpl/t/rpl_get_master_version_and_clock.test
Text conflict in mysql-test/suite/rpl/t/rpl_row_create_table.test
Text conflict in mysql-test/suite/rpl/t/rpl_slave_skip.test
Text conflict in mysql-test/suite/rpl/t/rpl_typeconv_innodb.test
Text conflict in mysys/charset.c
Text conflict in sql/field.cc
Text conflict in sql/field.h
Text conflict in sql/item.h
Text conflict in sql/item_func.cc
Text conflict in sql/log.cc
Text conflict in sql/log_event.cc
Text conflict in sql/log_event_old.cc
Text conflict in sql/mysqld.cc
Text conflict in sql/rpl_utility.cc
Text conflict in sql/rpl_utility.h
Text conflict in sql/set_var.cc
Text conflict in sql/share/Makefile.am
Text conflict in sql/sql_delete.cc
Text conflict in sql/sql_plugin.cc
Text conflict in sql/sql_select.cc
Text conflict in sql/sql_table.cc
Text conflict in storage/example/ha_example.h
Text conflict in storage/federated/ha_federated.cc
Text conflict in storage/myisammrg/ha_myisammrg.cc
Text conflict in storage/myisammrg/myrg_open.c
2010-03-24 18:03:44 +03:00
Gleb Shchepa
8feadddbe4 Bug #49910: Behavioural change in SELECT/WHERE on YEAR(4) data type
(Original patch by Sinisa Milivojevic)

The YEAR(4) value of 2000 was equal to the "bad" YEAR(4) value of 0000.                              

The get_year_value() function has been modified to not adjust bad                                    
YEAR(4) value to 2000.


mysql-test/r/type_year.result:
  Test case for bug #49910.
mysql-test/t/type_year.test:
  Test case for bug #49910.
sql/item_cmpfunc.cc:
  Bug #49910: Behavioural change in SELECT/WHERE on YEAR(4) data type                                  
  
  The get_year_value() function has been modified to not adjust bad                                    
  YEAR(4) value to 2000.
2010-03-22 12:33:25 +04:00
Sergey Petrunya
7df026676b Merge MariaDB-5.2 -> MariaDB 5.3 2010-03-20 15:01:47 +03:00
Sergey Petrunya
02e9fa62e7 BUG#45174: XOR in subqueries produces differing results in 5.1 and 5.4
BUG#50019: Wrong result for IN-subquery with materialization
- Fix equality substitution in presense of semi-join materialization, lookup and scan variants
  (started off from fix by Evgen Potemkin, then modified it to work in all cases)
2010-03-13 23:04:52 +03:00
Staale Smedseng
c7fad393fd Bug #49829 Many "hides virtual function" warnings with
SunStudio
      
SunStudio compilers of late warn about methods that might hide
methods in base classes due to the use of overloading combined
with overriding. SunStudio also warns about variables defined
in local socpe or method arguments that have the same name as
a member attribute of the class.
      
This patch renames methods that might hide base class methods,
to make it easier both for humans and compilers to see what is
actually called. It also renames variables in local scope.


sql/field.cc:
  Local scope variable or method argument same as class 
  attribute.
sql/item_cmpfunc.cc:
  Local scope variable or method argument same as class 
  attribute.
sql/item_create.cc:
  Renaming base class create() to create_func().
sql/item_create.h:
  Renaming base class create() to create_func().
sql/protocol.cc:
  Local scope variable or method argument same as class 
  attribute.
sql/sql_profile.cc:
  Local scope variable or method argument same as class 
  attribute.
sql/sql_select.cc:
  Local scope variable or method argument same as class 
  attribute.
sql/sql_yacc.yy:
  Renaming base class create() to create_func().
storage/federated/ha_federated.cc:
  Local scope variable or method argument same as class 
  attribute.
storage/myisammrg/ha_myisammrg.cc:
  Local scope variable or method argument same as class 
  attribute.
2010-03-14 17:01:45 +01:00
unknown
4bf849c23c Merge MySQL 5.1.44 into MariaDB. 2010-03-04 09:03:07 +01:00
Alexander Barkov
7a83782f1c Mergine from mysql-next-me 2010-02-27 11:43:32 +04:00
Vladislav Vaintroub
e451c5023d Bug#43201 : Stack overrun when running sp-error test.
It appears that stack overflow checks for recusrive stored procedure
calls, that run in the normal server, did not work in embedded and were
 dummified with preprocessor magic( #ifndef EMBEDDED_SERVER ).
      
 The fix is to remove ifdefs, there is no reason not to run overflow checks
 and crash in deeply recursive calls. 
      
 Note: Start of the stack (thd->thread_stack variable) in embedded is not
necessarily exact but stil provides the best guess. Unless the caller of 
mysql_read_connect()   is already deep in the stack, thd->thread_stack 
variable should approximate stack  start address well.
2010-02-23 12:48:26 +01:00
Sergey Petrunya
fdd19a6c63 Subquery optimizations backport:
- Update test results
- More comments
- Add Item_in_optimizer::transform() which was lost in backport
2010-02-17 13:05:27 +03:00
Alexander Barkov
702166bcde WL#2649 Number-to-string conversions
added:
  include/ctype_numconv.inc
  mysql-test/include/ctype_numconv.inc
  mysql-test/r/ctype_binary.result
  mysql-test/t/ctype_binary.test
  Adding tests

modified:

  mysql-test/r/bigint.result
  mysql-test/r/case.result
  mysql-test/r/create.result
  mysql-test/r/ctype_cp1251.result
  mysql-test/r/ctype_latin1.result
  mysql-test/r/ctype_ucs.result
  mysql-test/r/func_gconcat.result
  mysql-test/r/func_str.result
  mysql-test/r/metadata.result
  mysql-test/r/ps_1general.result
  mysql-test/r/ps_2myisam.result
  mysql-test/r/ps_3innodb.result
  mysql-test/r/ps_4heap.result
  mysql-test/r/ps_5merge.result
  mysql-test/r/show_check.result
  mysql-test/r/type_datetime.result
  mysql-test/r/type_ranges.result
  mysql-test/r/union.result
  mysql-test/suite/ndb/r/ps_7ndb.result
  mysql-test/t/ctype_cp1251.test
  mysql-test/t/ctype_latin1.test
  mysql-test/t/ctype_ucs.test
  mysql-test/t/func_str.test
    Fixing tests


  @ sql/field.cc
     - Return str result using my_charset_numeric.
     - Using real multi-byte aware str_to_XXX functions
       to handle tricky charset values propely (e.g. UCS2)
  @ sql/field.h
     - Changing derivation of non-string field types to DERIVATION_NUMERIC.
     - Changing binary() for numeric/datetime fields to always
     return TRUE even if charset is not my_charset_bin. We need
     this to keep ha_base_keytype() return HA_KEYTYPE_BINARY.
     - Adding BINARY_FLAG into some fields, because it's not
     being set automatically anymore with
     "my_charset_bin to my_charset_numeric" change.
    - Changing derivation for numeric/datetime datatypes to a weaker
      value, to make "SELECT concat('string', field)" use character
      set of the string literal for the result of the function.
  @ sql/item.cc
     - Implementing generic val_str_ascii().
     - Using max_char_length() instead of direct read of max_length
       to make "tricky" charsets like UCS2 work.
       NOTE: in the future we'll possibly remove all direct reads of max_length
     - Fixing Item_num::safe_charset_converter().
       Previously it alligned binary string to
       character string (for example by adding leading 0x00
       when doing binary->UCS2 conversion). Now it just
       converts from my_charset_numbner to "tocs".
     - Using val_str_ascii() in Item::get_time() to make UCS2 arguments work.
     - Other misc changes
  @ sql/item.h
     - Changing MY_COLL_CMP_CONV and MY_COLL_ALLOW_CONV to
       bit operations instead of hard-coded bit masks.
     - Addding new method DTCollation.set_numeric().
     - Adding new methods to Item.
     - Adding helper functions to make code look nicer:
       agg_item_charsets_for_string_result()
       agg_item_charsets_for_comparison()
     - Changing charset for Item_num-derived items
       from my_charset_bin to my_charset_numeric
       (which is an alias for latin1).
  @ sql/item_cmpfunc.cc
     - Using new helper functions
     - Other misc changes
  @ sql/item_cmpfunc.h
     - Fixing strcmp() to return max_length=2.
       Previously it returned 1, which was wrong,
       because it did not fit '-1'.
  @ sql/item_func.cc
     - Using new helper functions
     - Other minor changes
  @ sql/item_func.h
     - Removing unused functions
     - Adding helper functions
       agg_arg_charsets_for_string_result()
       agg_arg_charsets_for_comparison()
     - Adding set_numeric() into constructors of numeric items.
     - Using fix_length_and_charset() and fix_char_length()
       instead of direct write to max_length.
  @ sql/item_geofunc.cc
     - Changing class for Item_func_geometry_type and
       Item_func_as_wkt from Item_str_func to
       Item_str_ascii_func, to make them return UCS2 result
       properly (when character_set_connection=ucs2).
  @ sql/item_geofunc.h
     - Changing class for Item_func_geometry_type and
       Item_func_as_wkt from Item_str_func to
       Item_str_ascii_func, to make them return UCS2 result
       properly (when @@character_set_connection=ucs2).
  @ sql/item_strfunc.cc
     - Implementing Item_str_func::val_str().
     - Renaming val_str to val_str_ascii for some items,
       to make them work with UCS2 properly.
     - Using new helper functions
     - All single-argument functions that expect string
       result now call this method:
       agg_arg_charsets_for_string_result(collation, args, 1);
       This enables character set conversion to @@character_set_connection
       in case of pure numeric input.
  @ sql/item_strfunc.h
     - Introducing Item_str_ascii_func - for functions
       which return pure ASCII data, for performance purposes,
       as well as for the cases when the old implementation
       of val_str() was heavily 8-bit oriented and implementing
       a UCS2-aware version is tricky.
  @ sql/item_sum.cc
     - Using new helper functions.
  @ sql/item_timefunc.cc
     - Using my_charset_numeric instead of my_charset_bin.
     - Using fix_char_length(), fix_length_and_charset()
       and fix_length_and_charset_datetime()
       instead of direct write to max_length.
     - Using tricky-charset aware function str_to_time_with_warn()
  @ sql/item_timefunc.h
     - Using new helper functions for charset and length initialization.
     - Changing base class for Item_func_get_format() to make
       it return UCS2 properly (when character_set_connection=ucs2).
  @ sql/item_xmlfunc.cc
     - Using new helper function
  @ sql/my_decimal.cc
     - Adding a new DECIMAL to CHAR converter
       with real multibyte support (e.g. UCS2)

  @ sql/mysql_priv.h
     - Introducing a new derivation level for numeric/datetime data types.
     - Adding macros for my_charset_numeric and MY_REPERTOIRE_NUMERIC.
     - Adding prototypes for str_set_decimal()
     - Adding prototypes for character-set aware str_to_xxx() functions.
  @ sql/protocol.cc
     - Changing charsetnr to "binary" client-side metadata for
       numeric/datetime data types.
  @ sql/time.cc
     - Adding to_ascii() helper function, to convert a string
       in any character set to ascii representation. In the
       future can be extended to understand digits written
       in various non-Latin word scripts.
     - Adding real multy-byte character set aware versions for str_to_XXXX,
       to make these these type of queries work correct:
         INSERT INTO t1 SET datetime_column=ucs2_expression;
   @  strings/ctype-ucs2.c
     - endptr was not calculated correctly. INSERTing of UCS2
       values into numeric columns returned warnings about
       truncated wrong data.
2010-02-11 08:17:25 +04:00
Sergey Petrunya
b83cb52e9e Backport of subquery optimizations to 5.3.
There are still test failures because of:
- Wrong query results in outer join + semi join
- EXPLAIN output differences
2010-01-17 17:51:10 +03:00
Michael Widenius
d8ecbbe634 Merge with MySQL 5.1.42
- Marked a couple of tests with --big
- Fixed xtradb/handler/ha_innodb.cc to call explain_filename()

storage/xtradb/handler/ha_innodb.cc:
  Call explain_filename() to get proper names for partitioned tables
2010-01-15 17:27:55 +02:00
Georgi Kodinov
6e72f4171f merge 5.1-main to 5.1-bugteam 2010-01-13 12:28:42 +02:00
Sergei Golubchik
1ad5bb1a69 WL#4738 streamline/simplify @@variable creation process
Bug#16565 mysqld --help --verbose does not order variablesBug#20413 sql_slave_skip_counter is not shown in show variables
Bug#20415 Output of mysqld --help --verbose is incomplete
Bug#25430 variable not found in SELECT @@global.ft_max_word_len;
Bug#32902 plugin variables don't know their names
Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting!
Bug#34829 No default value for variable and setting default does not raise error
Bug#34834 ? Is accepted as a valid sql mode
Bug#34878 Few variables have default value according to documentation but error occurs  
Bug#34883 ft_boolean_syntax cant be assigned from user variable to global var.
Bug#37187 `INFORMATION_SCHEMA`.`GLOBAL_VARIABLES`: inconsistent status
Bug#40988 log_output_basic.test succeeded though syntactically false.
Bug#41010 enum-style command-line options are not honoured (maria.maria-recover fails)
Bug#42103 Setting key_buffer_size to a negative value may lead to very large allocations 
Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
Bug#44797 plugins w/o command-line options have no disabling option in --help
Bug#46314 string system variables don't support expressions
Bug#46470 sys_vars.max_binlog_cache_size_basic_32 is broken
Bug#46586 When using the plugin interface the type "set" for options caused a crash.
Bug#47212 Crash in DBUG_PRINT in mysqltest.cc when trying to print octal number
Bug#48758 mysqltest crashes on sys_vars.collation_server_basic in gcov builds
Bug#49417 some complaints about mysqld --help --verbose output
Bug#49540 DEFAULT value of binlog_format isn't the default value
Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix)
Bug#49644 init_connect and \0
Bug#49645 init_slave and multi-byte characters
Bug#49646 mysql --show-warnings crashes when server dies


CMakeLists.txt:
  Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
client/mysql.cc:
  don't crash with --show-warnings when mysqld dies
config/ac-macros/plugins.m4:
  Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
include/my_getopt.h:
  comments
include/my_pthread.h:
  fix double #define
mysql-test/mysql-test-run.pl:
  run sys_vars suite by default
  properly recognize envirinment variables (e.g. MTR_MAX_SAVE_CORE) set to 0
  escape gdb command line arguments
mysql-test/suite/sys_vars/r/rpl_init_slave_func.result:
  init_slave+utf8 bug
mysql-test/suite/sys_vars/t/rpl_init_slave_func.test:
  init_slave+utf8 bug
mysys/my_getopt.c:
  Bug#34599 MySQLD Option and Variable Reference need to be consistent in formatting!
  Bug#46586 When using the plugin interface the type "set" for options caused a crash.
  Bug#49640 ambiguous option '--skip-skip-myisam' (double skip prefix)
mysys/typelib.c:
  support for flagset
sql/ha_ndbcluster.cc:
  backport from telco tree
sql/item_func.cc:
  Bug#49644 init_connect and \0
  Bug#49645 init_slave and multi-byte characters
sql/sql_builtin.cc.in:
  Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
sql/sql_plugin.cc:
  Bug#44691 Some plugins configured as MYSQL_PLUGIN_MANDATORY in can be disabled
  Bug#32902 plugin variables don't know their names
  Bug#44797 plugins w/o command-line options have no disabling option in --help
sql/sys_vars.cc:
  all server variables are defined here
storage/myisam/ft_parser.c:
  remove unnecessary updates of param->quot
storage/myisam/ha_myisam.cc:
  myisam_* variables belong here
strings/my_vsnprintf.c:
  %o and %llx
unittest/mysys/my_vsnprintf-t.c:
  %o and %llx tests
vio/viosocket.c:
  bugfix: fix @@wait_timeout to work with socket timeouts (vs. alarm thread)
2009-12-22 10:35:56 +01:00
Alexander Nozdrin
9e3caef632 Auto-merge from mysql-trunk-merge. 2009-12-16 21:37:10 +03:00
Alexander Nozdrin
7e15d855f1 Manual merge from mysql-5.1.
Conflicts:
  - mysql-test/r/select.result
  - mysql-test/t/select.test
  - sql/item_cmpfunc.h
  - sql/sql_show.cc
2009-12-16 21:35:25 +03:00
Alexander Nozdrin
5f0c09dd72 Manual merge from mysql-trunk-merge.
Conflicts:
  - include/my_no_pthread.h
  - mysql-test/r/sp-ucs2.result
  - sql/log.cc
  - sql/sql_acl.cc
  - sql/sql_yacc.yy
2009-12-16 21:02:21 +03:00
Ramil Kalimullin
c5e6a11e14 Fix for bug#49517: Inconsistent behavior while using
NULLable BIGINT and INT columns in comparison

Problem: a consequence of the fix for 43668.
Some Arg_comparator inner initialization missed,
that may lead to unpredictable (wrong) comparison
results.

Fix: always properly initialize Arg_comparator
before its usage.


mysql-test/r/select.result:
  Fix for bug#49517: Inconsistent behavior while using 
  NULLable BIGINT and INT columns in comparison
    -test result.
mysql-test/t/select.test:
  Fix for bug#49517: Inconsistent behavior while using 
  NULLable BIGINT and INT columns in comparison
    -test case.
sql/item_cmpfunc.cc:
  Fix for bug#49517: Inconsistent behavior while using 
  NULLable BIGINT and INT columns in comparison
    - now all Arg_comparator::set_cmp_func() set
  Arg_comparator::set_null to ensure its proper initialization
  in all cases (by default it's set to TRUE in constructors).
sql/item_cmpfunc.h:
  Fix for bug#49517: Inconsistent behavior while using 
  NULLable BIGINT and INT columns in comparison
    - now all Arg_comparator::set_cmp_func() set
  Arg_comparator::set_null to ensure its proper initialization
  in all cases (by default it's set to TRUE in constructors).
2009-12-15 21:08:21 +04:00
Georgi Kodinov
838adcf2ff Bug#49489: Uninitialized cache led to a wrong result.
Merge the fix from 5.1-bugteam to 5.1-main
2009-12-15 10:54:53 +02:00
Georgi Kodinov
915cc3e9b0 Bug #49480: WHERE using YEAR columns returns unexpected results
Merge the fix from 5.1-bugteam to 5.1-main
2009-12-15 10:37:10 +02:00
Alexander Nozdrin
aceea2342f Manual merge from mysql-trunk-merge.
Conflicts:
  - extra/comp_err.c
  - mysql-test/collections/default.experimental
  - mysql-test/r/archive.result
  - mysql-test/r/select.result
  - mysql-test/suite/binlog/r/binlog_unsafe.result
  - mysql-test/suite/binlog/t/binlog_unsafe.test
  - mysql-test/suite/rpl/t/disabled.def
  - mysql-test/t/archive.test
  - mysql-test/t/select.test
  - sql/item.cc
  - sql/item.h
  - sql/item_timefunc.cc
  - sql/sql_base.cc
  - sql/sql_delete.cc
  - sql/sql_load.cc
  - sql/sql_partition.cc
  - sql/sql_table.cc
  - storage/innobase/handler/ha_innodb.cc
  - vio/vio.c
2009-12-12 23:38:59 +03:00
Evgeny Potemkin
684c7aba09 Auto-merged fix for bug#49489. 2009-12-11 16:08:29 +03:00
Ramil Kalimullin
e1d4ad3931 Auto-merge. 2009-12-10 11:03:23 +04:00
Ramil Kalimullin
c888a4a239 Manual merge. 2009-12-10 10:31:52 +04:00
Gleb Shchepa
3246383301 Bug #49480: WHERE using YEAR columns returns unexpected results
A few problems were found in the fix for bug 43668:
1) Comparison of the YEAR column with NULL always returned TRUE;
2) Comparison of the YEAR column with constants always returned
   unpredictable result;
3) Unnecessary conversion warnings when comparing a non-integer
   constant with a NULL value in the YEAR column;

The problems described above have been resolved with an
exception: zero (i.e. invalid) YEAR column value comparison
with 00 or 2000 still fail (it is not a regression and it was
not a regression), so MIN/MAX on YEAR column containing zero
value still fail.


mysql-test/r/type_year.result:
  Test case for bug #49480.
mysql-test/t/type_year.test:
  Test case for bug #49480.
sql/item_cmpfunc.cc:
  - The get_year_value() function has been modified to make its
    return value compatible with the get_datetime_value() return
    value (i.e. to convert numeric values into the YYYY0000000000
    (YYYY-00-00 00:00:00) form.
  
  - The Arg_comparator::set_cmp_func method has been modified to
    use the get_year_value function if get_datetime_value() is not
    applicable.
    From now only 2 cases have a special processing there:
    * both comparing items have MYSQL_TYPE_YEAR field type
            or
    * one item have is MYSQL_TYPE_YEAR and other one is
      is_datetime()-compliant.
  
  - New helper function try_year_cmp_func() has been
    added for the better code readability to call from
    Arg_comparator::set_cmp_func().
  
  - The Arg_comparator::compare_year method has been removed
    since get_year_value() is compatible with the old
    Arg_comparator::compare_datetime method that doesn't have
    problems #1-#3 (see whole patch entry commentary).
sql/item_cmpfunc.h:
  - New helper function try_year_cmp_func() has been
    added for the better code readability to call from
    Arg_comparator::set_cmp_func().
  
  - Unnecessary Arg_comparator::year_as_datetime and
    Arg_comparator::compare_year() declarations have been
    removed.
2009-12-10 10:05:44 +04:00
Evgeny Potemkin
1285ecd468 Bug#49489: Uninitialized cache led to a wrong result.
Arg_comparator uses Item_cache objects to store constants being compared when
they're need a type conversion. Because this cache wasn't initialized properly
Arg_comparator might produce wrong comparison result.

The Arg_comparator::cache_converted_constant function now initializes cache
prior to usage.

mysql-test/r/select.result:
  Added a test case for he bug#49489.
mysql-test/t/select.test:
  Added a test case for he bug#49489.
sql/item_cmpfunc.cc:
  Bug#49489: Uninitialized cache led to a wrong result.
  The Arg_comparator::cache_converted_constant function now initializes cache
  prior to usage.
2009-12-09 18:43:45 +03:00
Ramil Kalimullin
f5b51bc1e2 Fix for bug#49199: Optimizer handles incorrectly:
field='const1' AND field='const2' in some cases

Building multiple equality predicates containing
a constant which is compared as a datetime (with a field)
we should take this fact into account and compare the 
constant with another possible constatns as datetimes 
as well.

E.g. for the
SELECT ... WHERE a='2001-01-01' AND a='2001-01-01 00:00:00'
we should compare '2001-01-01' with '2001-01-01 00:00:00' as
datetimes but not as strings.


mysql-test/r/select.result:
  Fix for bug#49199: Optimizer handles incorrectly: 
  field='const1' AND field='const2' in some cases
    - test result.
mysql-test/t/select.test:
  Fix for bug#49199: Optimizer handles incorrectly: 
  field='const1' AND field='const2' in some cases
    - test case.
sql/item_cmpfunc.cc:
  Fix for bug#49199: Optimizer handles incorrectly: 
  field='const1' AND field='const2' in some cases
    - adding a constant to Item_equal compare it as
  a datetime value with stored one if there's a 
  date[time] field in a equality predicate.
sql/item_cmpfunc.h:
  Fix for bug#49199: Optimizer handles incorrectly: 
  field='const1' AND field='const2' in some cases
    - adding a constant to Item_equal compare it as
  a datetime value with stored one if there's a 
  date[time] field in a equality predicate.
sql/sql_select.cc:
  Fix for bug#49199: Optimizer handles incorrectly: 
  field='const1' AND field='const2' in some cases
    - adding a constant to Item_equal compare it as
  a datetime value with stored one if there's a 
  date[time] field in a equality predicate.
2009-12-04 21:58:40 +04:00
Evgeny Potemkin
1eda9dc777 Auto-merged. 2009-12-02 16:49:21 +03:00
Evgeny Potemkin
9e5d1bb664 Auto-merged fix for the bug#34384. 2009-12-01 22:41:39 +03:00
Evgeny Potemkin
7853f553be Bug#48508: Crash on prepared statement re-execution.
Actually there is two different bugs.
The first one caused crash on queries with WHERE condition over views
containing WHERE condition. A wrong check for prepared statement phase led
to items for view fields being allocated in the execution memory and freed
at the end of execution. Thus the optimized WHERE condition refers to
unallocated memory on the second execution and server crashed.
The second one caused by the Item_cond::compile function not saving changes
it made to the item tree. Thus on the next execution changes weren't
reverted and server crashed on dereferencing of unallocated space.

The new helper function called is_stmt_prepare_or_first_stmt_execute
is added to the Query_arena class.
The find_field_in_view function now uses
is_stmt_prepare_or_first_stmt_execute() to check whether
newly created view items should be freed at the end of the query execution.
The Item_cond::compile function now saves changes it makes to item tree.

mysql-test/r/ps.result:
  Added a test case for the bug#48508.
mysql-test/t/ps.test:
  Added a test case for the bug#48508.
sql/item_cmpfunc.cc:
  Bug#48508: Crash on prepared statement re-execution.
  The Item_cond::compile function now saves changes it makes to item tree.
sql/sql_base.cc:
  Bug#48508: Crash on prepared statement re-execution.
  The find_field_in_view function now uses
  is_stmt_prepare_or_first_stmt_execute() to check whether
  newly created view items should be freed at the end of the query execution.
sql/sql_class.h:
  Bug#48508: Crash on prepared statement re-execution.
  The Query_arena::is_stmt_prepare_or_first_sp_execute function now correctly
  do its check.
2009-12-01 21:28:45 +03:00
Evgeny Potemkin
0039944e0c Additional fix for the bug#43668.
Arg_comparator now takes into account that some of
optimizations aren't done in the PREPARE stmt.
2009-11-25 12:52:03 +03:00
Evgeny Potemkin
9f638f535e Manual merge of the fix for bug#43668. 2009-11-24 18:26:13 +03:00
Konstantin Osipov
9a9e8d2311 Backport of:
----------------------------------------------------------------------
ChangeSet@1.2571, 2008-04-08 12:30:06+02:00, vvaintroub@wva. +122 -0
  Bug#32082 : definition of VOID in my_global.h conflicts with Windows
  SDK headers
  
  VOID macro is now removed. Its usage is replaced with void cast.
  In some cases, where cast does not make much sense (pthread_*, printf, 
  hash_delete, my_seek), cast is ommited.


client/mysqladmin.cc:
  Bug#32082 : remove VOID macro
client/mysqldump.c:
  Bug#32082 : remove VOID macro
client/mysqlimport.c:
  Bug#32082 : remove VOID macro
client/mysqlslap.c:
  Bug#32082 : remove VOID macro
client/mysqltest.cc:
  Bug#32082 : remove VOID macro
client/sql_string.cc:
  Bug#32082 : remove VOID macro
extra/comp_err.c:
  Bug#32082 : remove VOID macro
extra/replace.c:
  Bug#32082 : remove VOID macro
include/my_alarm.h:
  Bug#32082 : remove VOID macro
include/my_global.h:
  Bug#32082 : remove VOID macro
libmysql/libmysql.c:
  Bug#32082 : remove VOID macro
mysys/errors.c:
  Bug#32082 : remove VOID macro
mysys/hash.c:
  Bug#32082 : remove VOID macro
mysys/mf_iocache2.c:
  Bug#32082 : remove VOID macro
mysys/mf_loadpath.c:
  Bug#32082 : remove VOID macro
mysys/mf_path.c:
  Bug#32082 : remove VOID macro
mysys/my_append.c:
  Bug#32082 : remove VOID macro
mysys/my_clock.c:
  Bug#32082 : remove VOID macro
mysys/my_copy.c:
  Bug#32082 : remove VOID macro
mysys/my_fstream.c:
  Bug#32082 : remove VOID macro
mysys/my_getwd.c:
  Bug#32082 : remove VOID macro
mysys/my_lib.c:
  Bug#32082 : remove VOID macro
mysys/my_lockmem.c:
  Bug#32082 : remove VOID macro
mysys/my_pthread.c:
  Bug#32082 : remove VOID macro
mysys/my_redel.c:
  Bug#32082 : remove VOID macro
mysys/stacktrace.c:
  Bug#32082 : remove VOID macro
mysys/thr_alarm.c:
  Bug#32082 : remove VOID macro
mysys/thr_lock.c:
  Bug#32082 : remove VOID macro
sql/derror.cc:
  Bug#32082 : remove VOID macro
sql/des_key_file.cc:
  Bug#32082 : remove VOID macro
sql/discover.cc:
  Bug#32082 : remove VOID macro
sql/field.cc:
  Bug#32082 : remove VOID macro
sql/filesort.cc:
  Bug#32082 : remove VOID macro
sql/ha_ndbcluster.cc:
  Bug#32082 : remove VOID macro
sql/ha_partition.cc:
  Bug#32082 : remove VOID macro
sql/handler.cc:
  Bug#32082 : remove VOID macro
sql/hostname.cc:
  Bug#32082 : remove VOID macro
sql/init.cc:
  Bug#32082 : remove VOID macro
sql/item.cc:
  Bug#32082 : remove VOID macro
sql/item_cmpfunc.cc:
  Bug#32082 : remove VOID macro
sql/item_strfunc.cc:
  Bug#32082 : remove VOID macro
sql/lock.cc:
  Bug#32082 : remove VOID macro
sql/log.cc:
  Bug#32082 : remove VOID macro
sql/log_event.cc:
  Bug#32082 : remove VOID macro
sql/mysqld.cc:
  Bug#32082 : remove VOID macro
sql/opt_range.h:
  Bug#32082 : remove VOID macro
sql/protocol.cc:
  Bug#32082 : remove VOID macro
sql/records.cc:
  Bug#32082 : remove VOID macro
sql/sp_head.cc:
  Bug#32082 : remove VOID macro
sql/sp_pcontext.cc:
  Bug#32082 : remove VOID macro
sql/sql_acl.cc:
  Bug#32082 : remove VOID macro
sql/sql_base.cc:
  Bug#32082 : remove VOID macro
sql/sql_cache.cc:
  Bug#32082 : remove VOID macro
sql/sql_connect.cc:
  Bug#32082 : remove VOID macro
sql/sql_db.cc:
  Bug#32082 : remove VOID macro
sql/sql_delete.cc:
  Bug#32082 : remove VOID macro
sql/sql_handler.cc:
  Bug#32082 : remove VOID macro
sql/sql_insert.cc:
  Bug#32082 : remove VOID macro
sql/sql_map.cc:
  Bug#32082 : remove VOID macro
sql/sql_parse.cc:
  Bug#32082 : remove VOID macro
sql/sql_select.cc:
  Bug#32082 : remove VOID macro
sql/sql_servers.cc:
  Bug#32082 : remove VOID macro
sql/sql_show.cc:
  Bug#32082 : remove VOID macro
sql/sql_string.cc:
  Bug#32082 : remove VOID macro
sql/sql_table.cc:
  Bug#32082 : remove VOID macro
sql/sql_test.cc:
  Bug#32082 : remove VOID macro
sql/sql_trigger.cc:
  Bug#32082 : remove VOID macro
sql/sql_update.cc:
  Bug#32082 : remove VOID macro
sql/sql_view.cc:
  Bug#32082 : remove VOID macro
sql/table.cc:
  Bug#32082 : remove VOID macro
sql/tztime.cc:
  Bug#32082 : remove VOID macro
sql/udf_example.c:
  Bug#32082 : remove VOID macro
sql/uniques.cc:
  Bug#32082 : remove VOID macro
sql/unireg.cc:
  Bug#32082 : remove VOID macro
storage/archive/ha_archive.cc:
  Bug#32082 : remove VOID macro
storage/blackhole/ha_blackhole.cc:
  Bug#32082 : remove VOID macro
storage/csv/ha_tina.cc:
  Bug#32082 : remove VOID macro
storage/csv/transparent_file.cc:
  Bug#32082 : remove VOID macro
storage/example/ha_example.cc:
  Bug#32082 : remove VOID macro
storage/federated/ha_federated.cc:
  Bug#32082 : remove VOID macro
storage/heap/hp_clear.c:
  Bug#32082 : remove VOID macro
storage/heap/hp_create.c:
  Bug#32082 : remove VOID macro
storage/heap/hp_test1.c:
  Bug#32082 : remove VOID macro
storage/heap/hp_test2.c:
  Bug#32082 : remove VOID macro
storage/innobase/handler/ha_innodb.cc:
  Bug#32082 : remove VOID macro
storage/myisam/ft_eval.c:
  Bug#32082 : remove VOID macro
storage/myisam/ha_myisam.cc:
  Bug#32082 : remove VOID macro
storage/myisam/mi_changed.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_check.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_close.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_create.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_dbug.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_delete.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_delete_all.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_dynrec.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_info.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_locking.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_log.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_open.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_packrec.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_panic.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_rsame.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_statrec.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_test1.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_test2.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_test3.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_update.c:
  Bug#32082 : remove VOID macro
storage/myisam/mi_write.c:
  Bug#32082 : remove VOID macro
storage/myisam/myisamchk.c:
  Bug#32082 : remove VOID macro
storage/myisam/myisamlog.c:
  Bug#32082 : remove VOID macro
storage/myisam/myisampack.c:
  Bug#32082 : remove VOID macro
storage/myisam/sort.c:
  Bug#32082 : remove VOID macro
storage/myisammrg/myrg_close.c:
  Bug#32082 : remove VOID macro
storage/myisammrg/myrg_create.c:
  Bug#32082 : remove VOID macro
storage/myisammrg/myrg_open.c:
  Bug#32082 : remove VOID macro
strings/str_test.c:
  Bug#32082 : remove VOID macro
tests/thread_test.c:
  Bug#32082 : remove VOID macro
2009-11-24 16:54:59 +03:00
Davi Arnaut
5aeeaaf507 Manual merge of mysql-next-mr-runtime upstream. 2009-11-19 21:48:08 -02:00
Evgeny Potemkin
bc43bff7ed Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
MySQL manual describes values of the YEAR(2) field type as follows:
values 00 - 69 mean 2000 - 2069 years and values 70 - 99 mean 1970 - 1999
years. MIN/MAX and comparison functions was comparing them as int values
thus producing wrong result.

Now the Arg_comparator class is extended with compare_year function which
performs correct comparison of the YEAR type.
The Item_sum_hybrid class now uses Item_cache and Arg_comparator objects to
correctly calculate its value.
To allow Arg_comparator to use func_name() function for Item_func and Item_sum
objects the func_name declaration is moved to the Item_result_field class.
A helper function is_owner_equal_func is added to the Arg_comparator class.
It checks whether the Arg_comparator object owner is the <=> function or not.
A helper function setup is added to the Item_sum_hybrid class. It sets up
cache item and comparator.

mysql-test/r/func_group.result:
  Added a test case for the bug#43668.
mysql-test/t/func_group.test:
  Added a test case for the bug#43668.
sql/item.cc:
  Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
  Now Item_cache_int returns the type of cached item.
sql/item.h:
  Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
  To allow Arg_comparator to use func_name() function for Item_func and Item_sum
  objects the func_name declaration is moved to the Item_result_field class.
sql/item_cmpfunc.cc:
  Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
  The Arg_comparator class is extended with compare_year function which
  performs correct comparison of the YEAR type.
sql/item_cmpfunc.h:
  Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
  The year_as_datetime variable is added to the Arg_comparator class.
  It's set to TRUE when YEAR value should be converted to the
  YYYY-00-00 00:00:00 format for correct YEAR-DATETIME comparison.
sql/item_geofunc.cc:
  Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
  Item_func_spatial_rel::val_int chenged to use Arg_comparator's string
  buffers.
sql/item_subselect.h:
  Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
  Added an implementation of the virtual func_name function.
sql/item_sum.cc:
  Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
  The Item_sum_hybrid class now uses Item_cache and Arg_comparator objects to
  correctly calculate its value.
  A helper function setup is added to the Item_sum_hybrid class. It sets up
  cache item and comparator.
sql/item_sum.h:
  Bug#43668: Wrong comparison and MIN/MAX for YEAR(2)
  The Item_sum_hybrid class now uses Item_cache and Arg_comparator objects to
  correctly calculate its value.
  Added an implementation of the virtual func_name function.
2009-11-17 17:06:46 +03:00
unknown
a962160eec Merge with MySQL 5.1, with following additions:
- Moved some code from innodb_plugin to xtradb, to ensure that all tests runs
- Did changes in pbxt and maria storage engines becasue of changes in thd->query
- Reverted wrong code in sql_table.cc for how ROW_FORMAT is used.

This is a re-commit of Monty's merge to eliminate an extra commit from
MySQL-5.1.42 that was accidentally included in the merge.

This is a merge of the MySQL 5.1.41 clone-off (clone-5.1.41-build). In
case there are any extra changes done before final MySQL 5.1.41
release, these will need to be merged later before MariaDB 5.1.41
release.
2009-11-16 21:49:51 +01:00
Evgeny Potemkin
c81e23457a Bug#34384: Slow down on constant conversion.
When values of different types are compared they're converted to a type that
allows correct comparison. This conversion is done for each comparison and
takes some time. When a constant is being compared it's possible to cache the
value after conversion to speedup comparison. In some cases (large dataset,
complex WHERE condition with many type conversions) query might be executed
7% faster.

A test case isn't provided because all changes are internal and isn't visible
outside.

The behavior of the Item_cache is changed to cache values on the first request
of cached value rather than at the moment of storing item to be cached.
A flag named value_cached is added to the Item_cache class. It's set to TRUE
when cache holds the value of the last stored item.
Function named cache_value() is added to the Item_cache class and derived classes.
This function actually caches the value of the saved item.
Item_cache_xxx::store functions now only store item to be cached and set
value_cached flag to FALSE.
Item_cache_xxx::val_xxx functions are changed to call cache_value function
prior to returning cached value if value_cached is FALSE.
The Arg_comparator::set_cmp_func function now calls cache_converted_constant
to cache constants if they need a type conversion.
The Item_cache::get_cache function is overloaded to allow setting of the
cache type.
The cache_converted_constant function is added to the Arg_comparator class.
It checks whether a value can and should be cached and if so caches it.

sql/item.cc:
  Bug#34384: Slow down on constant conversion.
  Function named cache_value() is added to the Item_cache class and derived classes.
  This function actually caches the value of the saved item.
  Item_cache_xxx::store functions now only store item to be cached and set
  value_cached flag to FALSE.
  Item_cache_xxx::val_xxx functions are changed to call cache_value function
  prior to returning cached value if value_cached is FALSE.
  The Item_cache::get_cache function is overloaded to allow setting of the
  cache type.
sql/item.h:
  Bug#34384: Slow down on constant conversion.
  A flag named value_cached is added to the Item_cache class. It's set to TRUE
  when we need to start caching values when the store method is called.
  Function named cache_value() is added to the Item_cache class and derived classes.
sql/item_cmpfunc.cc:
  Bug#34384: Slow down on constant conversion.
  A helper function cache_converted_constant is added to the Arg_comparator class.
  It checks whether a given item can and should be cached and caches it if so.
  The Arg_comparator::set_cmp_func function now calls cache_converted_constant
  to cache constants if they need a type conversion.
sql/item_cmpfunc.h:
  Bug#34384: Slow down on constant conversion.
  The cache_converted_constant function is added to the Arg_comparator class.
  It checks whether a value can and should be cached and if so caches it.
sql/item_subselect.cc:
  Bug#34384: Slow down on constant conversion.
  Force immediate caching of subselect result.
sql/item_xmlfunc.cc:
  Bug#34384: Slow down on constant conversion.
sql/sp_rcontext.cc:
  Bug#34384: Slow down on constant conversion.
  Force immediate caching of values of an SP CASE function.
2009-11-06 22:34:25 +03:00
Magne Mahre
a5d74eb1b4 Bug#42664: Sign ignored for TIME types when not comparing as longlong
Another code-path dropped sign of TIME, presuming all time is positive.
      
Minds sign now. Patch depends on ChangeSet for 42661.


mysql-test/r/type_time.result:
  Show we now no longer ignore sign of TIME-type
  in this code-path.
mysql-test/t/type_time.test:
  Show we now no longer ignore sign of TIME-type
  in this code-path.
sql/item_cmpfunc.cc:
  TIME_to_ulonglong() (somewhat obviously) loses sign
  of its argument, so we put it back in where needed.
2009-11-04 11:28:50 +01:00
Jorgen Loland
bec35067d3 Bug#48177 - SELECTs with NOT IN subqueries containing NULL
values return too many records

WHERE clauses with "outer_value_list NOT IN subselect" were
handled incorrectly if the outer value list contained multiple 
items where at least one of these could be NULL. The first 
outer record with NULL value was handled correctly, but if a 
second record with NULL value existed, the optimizer would 
choose to reuse the result it got on the last execution of the 
subselect. This is incorrect if the outer value list has 
multiple items.
     
The fix is to make Item_in_optimizer::val_int (in 
item_cmpfunc.cc) reuse the result of the latest execution
for NULL values only if all values in the outer_value_list 
are NULL.


mysql-test/r/subselect3.result:
  Added test for BUG#48177
mysql-test/t/subselect3.test:
  Added test for BUG#48177
sql/item_cmpfunc.cc:
  Make Item_in_optimizer::val_int (in item_cmpfunc.cc) reuse the result of the latest execution for NULL values only if all values in the outer_value_list are NULL.
2009-11-03 13:48:59 +01:00
Davi Arnaut
1ca80ed19e Bug#48370: Absolutely wrong calculations with GROUP BY and decimal fields when using IF
Bug#45261: Crash, stored procedure + decimal

Revert fix for Bug#45261 due to unforeseen bugs.
2009-11-02 09:21:39 -02:00
Martin Hansson
740b7c4e36 Bug#47925: regression of range optimizer and date comparison in 5.1.39!
When a query was using a DATE or DATETIME value formatted
using any other separator characters beside hyphen '-', a
query with a greater-or-equal '>=' condition matching only
the greatest value in an indexed column, the result was
empty if index range scan was employed.

The range optimizer got a new feature between 5.1.38 and
5.1.39 that changes a greater-or-equal condition to a
greater-than if the value matching that in the query was not
present in the table. But the value comparison function
compared the dates as strings instead of dates.

The bug was fixed by splitting the function
get_date_from_str in two: One part that parses and does
error checking. This function is now visible outside the
module. The old get_date_from_str now calls the new
function.


mysql-test/r/range.result:
  Bug#47925: Test result
mysql-test/t/range.test:
  Bug#47925: Test case
sql/item.cc:
  Bug#47925: Fix + some edit on the comments
sql/item.h:
  Bug#47925: Changed function signature
sql/item_cmpfunc.cc:
  Bug#47925: Split function in two
sql/item_cmpfunc.h:
  Bug#47925: Declaration of new function
sql/opt_range.cc:
  Bug#47925: Added THD to function call
sql/time.cc:
  Bug#47925: Added microsecond comparison
2009-11-02 13:24:07 +01:00
Evgeny Potemkin
5594215c58 Auto-merged fix for the bug#34384. 2009-11-06 22:42:24 +03:00
Georgi Kodinov
43d7fb43cd Bug #46175: NULL read_view and consistent read assertion
The SE API requires mysql to notify the storage engine that
it's going to read certain tables at the beginning of the 
statement (by calling start_stmt(), store_lock() or
external_lock()).
These are typically called by the lock_tables(). 
However SHOW CREATE TABLE is not pre-locking the tables
because it's not expected to access the data at all.
But for some view definitions (that include comparing a
date/datetime/timestamp column to a string returning
scalar subquery) the JOIN::prepare may still access data
when materializing the scalar non-correlated subquery
in Arg_comparator::can_compare_as_dates().
Fixed by not materializing the subquery when the function
is called in a SHOW/EXPLAIN/CREATE VIEW
2009-11-04 13:54:28 +02:00
unknown
6aad537a6a Merge MySQL 5.1.39 into MariaDB 5.1. 2009-10-15 23:38:29 +02:00
Gleb Shchepa
33cd911a16 Bug #44139: Table scan when NULL appears in IN clause
SELECT ... WHERE ... IN (NULL, ...) does full table scan,
even if the same query without the NULL uses efficient range scan.

The bugfix for the bug 18360 introduced an optimization:
if
  1) all right-hand arguments of the IN function are constants
  2) result types of all right argument items are compatible
     enough to use the same single comparison function to
     compare all of them to the left argument,

then

  we can convert the right-hand list of constant items to an array
  of equally-typed constant values for the further
  QUICK index access etc. (see Item_func_in::fix_length_and_dec()).

The Item_null constant item objects have STRING_RESULT
result types, so, as far as Item_func_in::fix_length_and_dec()
is aware of NULLs in the right list, this improvement efficiently
optimizes IN function calls with a mixed right list of NULLs and
string constants. However, the optimization doesn't affect mixed
lists of NULLs and integers, floats etc., because there is no
unique common comparator.


New optimization has been added to ignore the result type
of NULL constants in the static analysis of mixed right-hand lists.
This is safe, because at the execution phase we care about
presence of NULLs anyway.

1. The collect_cmp_types() function has been modified to optionally
   ignore NULL constants in the item list.
2. NULL-skipping code of the Item_func_in::fix_length_and_dec()
   function has been modified to work not only with in_string
   vectors but with in_vectors of other types.


mysql-test/r/func_in.result:
  Added test case for the bug #44139.
mysql-test/t/func_in.test:
  Added test case for the bug #44139.
sql/item_cmpfunc.cc:
  Bug #44139: Table scan when NULL appears in IN clause
  
  1. The collect_cmp_types() function has been modified to optionally
     ignore NULL constants in the item list.
  2. NULL-skipping code of the Item_func_in::fix_length_and_dec()
     function has been modified to work not only with in_string
     vectors but with in_vectors of other types.
2009-10-05 10:27:36 +05:00
Sergey Petrunya
d762bf21cc MWL#17: Table-elimination
- Addressing review feedback, generation 4.

include/my_global.h:
  Make ALIGN_PTR's action correspond to that of ALIGN_SIZE
sql/item.cc:
  MWL#17: Table-elimination
  - Review feedback: function renames, better comments
sql/item.h:
  MWL#17: Table-elimination
  - Review feedback: function renames, better comments
sql/item_cmpfunc.cc:
  MWL#17: Table-elimination
  - Review feedback: function renames, better comments
sql/item_subselect.cc:
  MWL#17: Table-elimination
  - Review feedback: function renames, better comments
sql/item_subselect.h:
  MWL#17: Table-elimination
  - Review feedback: function renames, better comments
sql/opt_table_elimination.cc:
  MWL#17: Table-elimination
  - Addressing review feedback, generation 4: abstract everything in case
    we would need to change it for something else in the future.
sql/sql_list.h:
  MWL#17: Table-elimination
  - Introduce exchange_sort(List<T> ...) template function
sql/sql_select.cc:
  MWL#17: Table-elimination
  - Review feedback: function renames, better comments
2009-09-01 00:02:09 +04:00
Staale Smedseng
5be4c38226 Merge from 5.0 for 43414 2009-08-28 18:21:54 +02:00
Staale Smedseng
1ba25ae47c Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2
      
This patch fixes a number of GCC warnings about variables used
before initialized. A new macro UNINIT_VAR() is introduced for
use in the variable declaration, and LINT_INIT() usage will be
gradually deprecated. (A workaround is used for g++, pending a
patch for a g++ bug.)
      
GCC warnings for unused results (attribute warn_unused_result)
for a number of system calls (present at least in later
Ubuntus, where the usual void cast trick doesn't work) are
also fixed.


client/mysqlmanager-pwgen.c:
  A fix for warn_unused_result, adding fallback to use of
  srand()/rand() if /dev/random cannot be used. Also actually
  adds calls to rand() in the second branch so that it actually
  creates a random password.
2009-08-28 17:51:31 +02:00
Davi Arnaut
fc39459504 Bug#45261: Crash, stored procedure + decimal
The problem was that creating a DECIMAL column from a decimal
value could lead to a failed assertion as decimal values can
have a higher precision than those attached to a table. The
assert could be triggered by creating a table from a decimal
with a large (> 30) scale. Also, there was a problem in
calculating the number of digits in the integral and fractional
parts if both exceeded the maximum number of digits permitted
by the new decimal type.

The solution is to ensure that truncation procedure is executed
when deducing a DECIMAL column from a decimal value of higher
precision. If the integer part is equal to or bigger than the
maximum precision for the DECIMAL type (65), the integer part
is truncated to fit and the fractional becomes zero. Otherwise,
the fractional part is truncated to fit into the space left
after the integer part is copied.

This patch borrows code and ideas from Martin Hansson's patch.

mysql-test/r/type_newdecimal.result:
  Add test case result for Bug#45261. Also, update test case to
  reflect that an additive operation increases the precision of
  the resulting type by 1.
mysql-test/t/type_newdecimal.test:
  Add test case for Bug#45261
sql/field.cc:
  Added DBUG_ASSERT to ensure object's invariant is maintained.
  Implement method to create a field to hold a decimal value
  from an item.
sql/field.h:
  Explain member variable. Add method to create a new decimal field.
sql/item.cc:
  The precision should only be capped when storing the value
  on a table. Also, this makes it impossible to calculate the
  integer part if Item::decimals (the scale) is larger than the
  precision.
sql/item.h:
  Simplify calculation of integer part.
sql/item_cmpfunc.cc:
  Do not limit the precision. It will be capped later.
sql/item_func.cc:
  Use new method for allocating a new decimal field.
  Add a specialized method for retrieving the precision
  of a user variable item.
sql/item_func.h:
  Add method to return the precision of a user variable.
sql/item_sum.cc:
  Use new method for allocating a new decimal field.
sql/my_decimal.h:
  The integer part could be improperly calculated for a decimal
  with 31 digits in the fractional part.
sql/sql_select.cc:
  Use new method which truncates the integer or decimal parts
  as needed.
2009-08-24 16:47:08 -03:00
Alexey Kopytov
2d4df13ef2 Manual merge. 2009-07-03 14:36:04 +04:00
Alexey Kopytov
096c12b2c4 Bug #45262: Bad effects with CREATE TABLE and DECIMAL
Using DECIMAL constants with more than 65 digits in CREATE 
TABLE ... SELECT led to bogus errors in release builds or 
assertion failures in debug builds. 
 
The problem was in inconsistency in how DECIMAL constants and 
fields are handled internally. We allow arbitrarily long 
DECIMAL constants, whereas DECIMAL(M,D) columns are limited to 
M<=65 and D<=30. my_decimal_precision_to_length() was used in 
both Item and Field code and truncated precision to 
DECIMAL_MAX_PRECISION when calculating value length without 
adjusting precision and decimals. As a result, a DECIMAL 
constant with more than 65 digits ended up having length less 
than precision or decimals which led to assertion failures. 
 
Fixed by modifying my_decimal_precision_to_length() so that 
precision is truncated to DECIMAL_MAX_PRECISION only for Field 
object which is indicated by the new 'truncate' parameter. 
 
Another inconsistency fixed by this patch is how DECIMAL 
constants and expressions are handled for CREATE ... SELECT. 
create_tmp_field_from_item() (which is used for constants) was 
changed as a part of the bugfix for bug #24907 to handle long 
DECIMAL constants gracefully. Item_func::tmp_table_field() 
(which is used for expressions) on the other hand was still 
using a simplistic approach when creating a Field_new_decimal 
from a DECIMAL expression. 

mysql-test/r/type_newdecimal.result:
  Added a test case for bug #45262.
mysql-test/t/type_newdecimal.test:
  Added a test case for bug #45262.
sql/item.cc:
  Use the new 'truncate' parameter in 
  my_decimal_precision_to_length().
sql/item_cmpfunc.cc:
  Use the new 'truncate' parameter in 
  my_decimal_precision_to_length().
sql/item_func.cc:
  1. Use the new 'truncate' parameter in 
  my_decimal_precision_to_length().
  
  2. Do not truncate decimal precision to DECIMAL_MAX_PRECISION
  for additive expressions involving long DECIMAL constants.
  
  3. Fixed an incosistency in how DECIMAL constants and 
  expressions are handled for CREATE ... SELECT.
sql/item_func.h:
  Use the new 'truncate' parameter in 
  my_decimal_precision_to_length().
sql/item_sum.cc:
  Use the new 'truncate' parameter in 
  my_decimal_precision_to_length().
sql/my_decimal.h:
  Do not truncate precision to DECIMAL_MAX_PRECISION
  when calculating length in 
  my_decimal_precision_to_length() if 'truncate' parameter
  is FALSE.
sql/sql_select.cc:
  1. Use the new 'truncate' parameter in 
  my_decimal_precision_to_length().
  
  2. Use a more correct logic when adjusting value's length.
2009-07-03 11:41:19 +04:00
Staale Smedseng
62bb2beb92 Merge from 5.0-bugteam for 43414 2009-06-09 18:44:26 +02:00
Staale Smedseng
a073ee45c2 Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2
      
Compiling MySQL with gcc 4.3.2 and later produces a number of 
warnings, many of which are new with the recent compiler
versions.
      
This bug will be resolved in more than one patch to limit the
size of changesets. This is the first patch, fixing a number 
of the warnings, predominantly "suggest using parentheses 
around && in ||", and empty for and while bodies.
2009-06-09 18:11:21 +02:00
Staale Smedseng
a092ed1afe Bug #43414 Parenthesis (and other) warnings compiling MySQL
with gcc 4.3.2

Compiling MySQL with gcc 4.3.2 and later produces a number of 
warnings, many of which are new with the recent compiler
versions.

This bug will be resolved in more than one patch to limit the
size of changesets. This is the first patch, fixing a number 
of the warnings, predominantly "suggest using parentheses 
around && in ||", and empty for and while bodies.
2009-06-09 14:55:30 +02:00
Georgi Kodinov
7348140465 Bug #44399 : crash with statement using TEXT columns, aggregates, GROUP BY, and
HAVING
            
When calculating GROUP BY the server caches some expressions. It does
that by allocating a string slot (Item_copy_string) and assigning the 
value of the expression to it. This effectively means that the result
type of the expression can be changed from whatever it was to a string.
As this substitution takes place after the compile-time result type 
calculation for IN but before the run-time type calculations, 
it causes the type calculations in the IN function done at run time 
to get unexpected results different from what was prepared at compile time.
                  
In the CASE ... WHEN ... THEN ... statement there was a similar problem
and it was solved by artificially adding a STRING argument to the set of 
types of the IN/CASE arguments at compile time, so if any of the 
arguments of the CASE function changes its type to a string it will 
still be covered by the information prepared at compile time.

mysql-test/include/mix1.inc:
  Bug #44399: extended the test to cover the different types
mysql-test/r/func_in.result:
  Bug #44399: test case
mysql-test/r/innodb_mysql.result:
  Bug #44399: extended the test to cover the different types
mysql-test/t/func_in.test:
  Bug #44399: test case
sql/item.cc:
  Bug #44399: Implement typed caching for GROUP BY
sql/item.h:
  Bug #44399: Implement typed caching for GROUP BY
sql/item_cmpfunc.cc:
  Bug #44399: remove the special case
sql/sql_select.cc:
  Bug #44399: Implement typed caching for GROUP BY
2009-05-25 11:00:40 +03:00
Georgi Kodinov
54d36955b2 Revert of the fix for bug #44399 (joro@sun.com-20090512135917-kal1dvtqpqgnj3yc). 2009-05-20 14:14:33 +03:00
Georgi Kodinov
d7a22ed9a9 Bug #44399: crash with statement using TEXT columns, aggregates, GROUP BY,
and HAVING

When calculating GROUP BY the server caches some expressions. It does
that by allocating a string slot (Item_copy_string) and assigning the 
value of the expression to it. This effectively means that the result
type of the expression can be changed from whatever it was to a string.
As this substitution takes place after the compile-time result type 
calculation for IN but before the run-time type calculations, 
it causes the type calculations in the IN function done at run time 
to get unexpected results different from what was prepared at compile time.

In the CASE ... WHEN ... THEN ... statement there was a similar problem
and it was solved by artificially adding a STRING argument to the matrix
at compile time, so if any of the arguments of the CASE function changes 
its type to a string it will still be covered by the information prepared 
at compile time.
Extended the CASE fix for cover the IN case.
An alternative way of fixing this problem is by caching the result type of 
the arguments at compile time and using the cached information at run time
instead of re-calculating the result types.
Preferred the CASE approach for uniformity and fix localization.

mysql-test/r/func_in.result:
  Bug #44399: test case
mysql-test/t/func_in.test:
  Bug #44399: test case
sql/item_cmpfunc.cc:
  Bug #44399: assume at compile time there's an extra string argument
  in the IN function (similar to CASE) to cater for possible string 
  conversions in the process of calculating the GROUP BY/aggregates.
2009-05-12 16:59:17 +03:00
Michael Widenius
210a412522 bzr merge from guilhem's maria tree to our local 5.1
configure.in:
  Manually merged
mysql-test/lib/My/ConfigFactory.pm:
  Manually merged
mysql-test/mysql-test-run.pl:
  Manually merged
mysql-test/t/information_schema.test:
  Manually merged
sql/handler.cc:
  Manually merged
support-files/mysql.spec.sh:
  Manually merged
2009-04-25 12:04:38 +03:00
Guilhem Bichot
c71aae73f6 merge of 5.1-main into 5.1-maria. MyISAM changes are propagated to Maria except
those of davi.arnaut@sun.com-20090219210935-9vilvcisyyieffxl (TODO).
2009-04-01 11:34:52 +02:00
Sergey Glukhov
fafeaf460b 5.0-bugteam->5.1-bugteam merge 2009-02-19 17:59:00 +04:00
Sergey Glukhov
c2e23208ef Bug#37601 Cast Is Not Done On Row Comparison
In case of ROW item each compared pair does not
check if argumet collations can be aggregated and
thus appropiriate item conversion does not happen.
The fix is to add the check and convertion for ROW
pairs.


mysql-test/r/row.result:
  test result
mysql-test/t/row.test:
  test case
sql/item.cc:
  added agg_item_set_converter() function which was a part of
  agg_item_charsets() func. The only difference is that
  agg_item_set_converter() checks and converts items 
  using already known collation.
sql/item.h:
  added agg_item_set_converter() function
sql/item_cmpfunc.cc:
  In case of ROW item each compared pair does not
  check if argumet collations can be aggregated and
  thus appropiriate item conversion does not happen.
  The fix is to add the check and convertion for ROW
  pairs.
2009-02-19 17:20:44 +04:00
Michael Widenius
945fa0d913 Merge with mysql-maria tree
mysql-test/t/variables.test:
  Reset delay_key_write, otherwise maria.maria test may fail
sql/set_var.cc:
  Reset ha_open_options if one resets the delay_key_write variable.
  Before there was no way to reset it without restarting mysqld, which caused some tests to fail
2009-02-19 11:01:25 +02:00
Michael Widenius
a8fdaa6f2c Merge with base MySQL 5.1
Contains fixes for test cases
Changed release tag to beta

configure.in:
  change release tag to beta
2009-02-15 12:58:34 +02:00
Guilhem Bichot
704b4845aa merge of 5.1-main into 5.1-maria. Myisam->Maria change propagation will follow.
There were so many changes into mtr (this is the new mtr coming) that I rather
copied mtr from 6.0-main here (at least this one knows how to run Maria tests).
I also fixed suite/maria tests to be accepted by the new mtr.

mysys/thr_mutex.c:
  adding DBUG_PRINT here, so that we can locate where the warning is issued.
2009-02-12 15:08:56 +01:00
Michael Widenius
bd4e65515f Fixed compiler warnings found by gcc 4.3.2
- Added braces around expressions with &&, ||, & and |
- Added empty line before ; for empty while and for loops
- Added () around if with assignments
- Removed const before function returning simple type

Changed BUILD scripts to not build with NDB 


BUILD/SETUP.sh:
  By default, don't build ndb with --max in Maria tree.
  NDB is not kept up to date anyway in 5.1
client/mysql.cc:
  Added braces around && to get rid of compiler warnings
sql/event_db_repository.cc:
  Added braces around && to get rid of compiler warnings
sql/events.cc:
  Added braces around && to get rid of compiler warnings
sql/field.cc:
  Added braces around && to get rid of compiler warnings
  Fixed for loops
sql/field.h:
  Added braces around & to get rid of compiler warnings
sql/field_conv.cc:
  Added braces around && to get rid of compiler warnings
  Fixed bug when copying between DATETIME fields and strict dates are used
  Removed not needeed else
sql/gstream.cc:
  Added braces around && to get rid of compiler warnings
sql/ha_ndbcluster.cc:
  Added braces around && to get rid of compiler warnings
  Added {} to get rid of compiler warnings
sql/handler.cc:
  Added braces around && to get rid of compiler warnings
sql/item.cc:
  Added braces around && to get rid of compiler warnings
sql/item_cmpfunc.cc:
  Added braces around && to get rid of compiler warnings
  Removed some not needed space
sql/item_func.cc:
  Added braces around && to get rid of compiler warnings
sql/item_strfunc.cc:
  Added braces around && to get rid of compiler warnings
sql/item_subselect.cc:
  Added braces around && to get rid of compiler warnings
sql/item_sum.cc:
  Added braces around && to get rid of compiler warnings
sql/item_timefunc.cc:
  Added braces around && to get rid of compiler warnings
sql/item_xmlfunc.cc:
  Added empty line before ; for empty while and for loops
sql/log.cc:
  Added braces around && to get rid of compiler warnings
sql/log_event.cc:
  Added braces around && to get rid of compiler warnings
  Removed not needed else
sql/log_event_old.cc:
  Added braces around && to get rid of compiler warnings
sql/opt_range.cc:
  Added braces around && to get rid of compiler warnings
sql/opt_sum.cc:
  Added braces around && to get rid of compiler warnings
sql/set_var.cc:
  Added empty line before ; for empty while and for loops
  Added () around if with assignments
sql/slave.cc:
  Added braces around && to get rid of compiler warnings
  Added empty line before ; for empty while and for loops
sql/spatial.h:
  Added braces around && to get rid of compiler warnings
sql/sql_acl.cc:
  Added braces around && to get rid of compiler warnings
sql/sql_analyse.cc:
  Added empty line before ; for empty while and for loops
sql/sql_base.cc:
  Added braces around && to get rid of compiler warnings
sql/sql_connect.cc:
  Added braces around && to get rid of compiler warnings
sql/sql_db.cc:
  Added braces around && to get rid of compiler warnings
sql/sql_delete.cc:
  Added braces around && to get rid of compiler warnings
sql/sql_help.cc:
  Added empty line before ; for empty while and for loops
sql/sql_insert.cc:
  Added braces around && to get rid of compiler warnings
  Added () around if with assignments
sql/sql_lex.cc:
  Cast char array references to uchar; Fixed wrong array referencing when using characters > ASCII 128 in SQL statments
  Added empty line before ; for empty while and for loops
  Trivial indent fixes
  Added braces around && to get rid of compiler warnings
sql/sql_load.cc:
  Added braces around && to get rid of compiler warnings
sql/sql_parse.cc:
  Added braces around && to get rid of compiler warnings
sql/sql_partition.cc:
  Added braces around && to get rid of compiler warnings
sql/sql_plugin.cc:
  Fixed bug in detecing if option variable should be readonly
  Added empty line before ; for empty while and for loops
sql/sql_prepare.cc:
  Added braces around && to get rid of compiler warnings
sql/sql_select.cc:
  Added braces around && to get rid of compiler warnings
  Added () around if with assignments
  Added empty line before ; for empty while and for loops
sql/sql_show.cc:
  Added braces around && to get rid of compiler warnings
sql/sql_table.cc:
  Added braces around && to get rid of compiler warnings
sql/sql_trigger.cc:
  Added braces around && to get rid of compiler warnings
sql/sql_update.cc:
  Added braces around && to get rid of compiler warnings
sql/sql_yacc.yy:
  Added braces around && to get rid of compiler warnings
sql/table.cc:
  Added braces around && to get rid of compiler warnings
sql/table.h:
  Added braces around && to get rid of compiler warnings
sql/time.cc:
  Added braces around && to get rid of compiler warnings
sql/tztime.cc:
  Added braces around && to get rid of compiler warnings
sql/uniques.cc:
  Added braces around && to get rid of compiler warnings
storage/federated/ha_federated.cc:
  Fixed bug in testing of variable to ha_info() (Not critical)
storage/heap/ha_heap.cc:
  Added braces around && to get rid of compiler warnings
storage/maria/ha_maria.cc:
  Fixed bug: Mark that maria_log_dir_path is readonly
  Added braces around && to get rid of compiler warnings
storage/ndb/include/ndbapi/NdbEventOperation.hpp:
  Removed const before function returning simple type
storage/ndb/include/ndbapi/NdbOperation.hpp:
  Removed const before function returning simple type
storage/ndb/src/ndbapi/Ndb.cpp:
  Added empty line before ; for empty while and for loops
storage/ndb/src/ndbapi/NdbEventOperation.cpp:
  Removed const before function returning simple type
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp:
  Removed const before function returning simple type
storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp:
  Removed const before function returning simple type
storage/ndb/src/ndbapi/NdbRecAttr.cpp:
  Added empty line before ; for empty while and for loops
storage/ndb/src/ndbapi/TransporterFacade.hpp:
  Added braces around && to get rid of compiler warnings
2009-01-31 23:22:44 +02:00
Sergey Petrunia
a9608b196d BUG#37822: Correlated subquery with IN and IS UNKNOWN provides wrong result
Item_in_optimizer::is_null() evaluated "NULL IN (SELECT ...)" to NULL regardless of
whether subquery produced any records, this was a documented limitation.

The limitation has been removed (see bugs 8804, 24085, 24127) now
Item_in_optimizer::val_int() correctly handles all cases with NULLs. Make
Item_in_optimizer::is_null() invoke val_int() to return correct values for
"NULL IN (SELECT ...)".


mysql-test/r/subselect.result:
  BUG#37822: Correlated subquery with IN and IS UNKNOWN provides wrong result
  - Testcase
mysql-test/t/subselect.test:
  BUG#37822: Correlated subquery with IN and IS UNKNOWN provides wrong result
  - Testcase
2009-01-28 22:18:27 +03:00
Gleb Shchepa
335e842d24 Bug #41363: crash of mysqld on windows with aggregate in case
Execution of queries containing the CASE function of
aggregate function like in "SELECT ... CASE ARGV(...) WHEN ..."
crashed the server.


The CASE function caches pointers to concrete comparison
functions for an each pair of types of CASE-WHERE clause
parameters, i.e. for the "CASE INT_RESULT WHERE REAL_RESULT
THEN ... WHERE DECIMAL_RESULT ... END" function call it
caches comparisons for INT_RESULT with REAL_RESULT and
for INT_RESULT with DECIMAL_RESULT. Usually a result
type is known after a call to the fix_fields function,
however, the setup_copy_fields function call may
wrap aggregate items with Item_copy_string that has
STRING_RESULT result type, so setup_copy_fields may
change argument result types of the CASE function after
call to Item_func_case::fix_fields/fix_length_and_dec.
Then the Item_func_case::find_item function tries to
use comparison function for unexpected pair of the
STRING_RESULT and some other type - that caused
an assertion failure of server crash.

The Item_func_case::fix_length_and_dec function has
been modified to take into account possible STRING_RESULT
result type in the presence of aggregate arguments of
the CASE function.


mysql-test/r/func_in.result:
  Added test case for bug #41363.
mysql-test/t/func_in.test:
  Added test case for bug #41363.
sql/item_cmpfunc.cc:
  Bug #41363: crash of mysqld on windows with aggregate in case
  
  The Item_func_case::fix_length_and_dec function has
  been modified to take into account possible STRING_RESULT
  result type in the presence of aggregate arguments of
  the CASE function.
2008-12-31 15:55:04 +04:00
Michael Widenius
86fcfb1508 Fix for Bug#40311 Assert in MARIA_RECORD_POS during pushbuild 2 test:
Fixed bug when removing a newly inserted record (in case of duplicate key).
The bug caused a crash for rows with several blobs and the first blob was small enough to fit into the head page.
Don't change state_history if nothing changed (speed optimization that also simplifies logic).
Reset state_history if we added/deleted or updated rows without versioning.
Fixed wrong test in trnman_exists_active_transactions() if state is visible or not.

Other bugs fixed:
Fixed wrong argument to (lock->get_status) when we had to wait for TL_WRITE_CONCURRENT_INSERT.
Item_equal::update_used_tables() didn't calculate const_item_cache properly.
Added assert's to detect if join_read_const_table() was called under wrong assumptions..
Fixed that _ma_setup_live_state() is called from thr_lock() instead of handler::external_lock().
This was needed to get versioning information to be setup correctly.
Fixed error in debug binaries during a call to _ma_check_table_is_closed() when another thread was opening/closing a table.
Fixed wrong test when finding right history_state to use.

mysql-test/suite/maria/r/maria.result:
  Added test for Bug#40311 Assert in MARIA_RECORD_POS during pushbuild 2 test
mysql-test/suite/maria/t/maria.test:
  Added test for Bug#40311 Assert in MARIA_RECORD_POS during pushbuild 2 test
mysys/thr_lock.c:
  Fixed wrong argument to (lock->get_status) when we had to wait for TL_WRITE_CONCURRENT_INSERT
sql/item_cmpfunc.cc:
  Item_equal::update_used_tables() didn't calculate const_item_cache properly, which later caused a wrong result for item->const_item()
sql/sql_base.cc:
  In debug mode, Initilize record buffer with unexpected data to catch usage of uninitialized memory
sql/sql_select.cc:
  Fixed indentation
  Added assert's to detect if join_read_const_table() was called under wrong assumptions.
  One assert() is disabled for now as Item_equal() doesn't behave as expected.
storage/maria/ha_maria.cc:
  Move calling to _ma_setup_live_state() to ma_state.c::_ma_block_get_status()
  This was needed as _ma_setup_live_state() needed to know if the table will be used concurrently or not
storage/maria/ma_blockrec.c:
  Fixed bug when removing a newly inserted record (in case of duplicate key).
  The bug caused a crash for rows with several blobs and the first blob was small enough to fit into the head page.
storage/maria/ma_dbug.c:
  Added mutex to protect the open table list during _ma_check_table_is_closed().
  Without the protection we could get a error in debug binaries during a call to _ma_check_table_is_closed()
storage/maria/ma_delete_table.c:
  Removed not used code
storage/maria/ma_rename.c:
  Removed not used code
storage/maria/ma_state.c:
  Fixed wrong test when finding right history_state to use
  Mark in tables->state_current.no_transid if we are using transid's or not.
  Don't change state_history if nothing changed (speed optimization that also simplifies logic)
  Reset state_history if we added/deleted or updated rows without versioning.
  More DBUG_ASSERT's and more DBUG
  Updated maria_versioning() to initialize environment before calling _ma_blok_get_status(). This was needed because of the new logic in _ma_block_get_status()
storage/maria/ma_state.h:
  Added flags to detect if table changed and/or if we changed table without versioning
storage/maria/ma_write.c:
  Simple cleanups (No logic changes)
storage/maria/trnman.c:
  Fixed wrong test in trnman_exists_active_transactions() if state is visible or not.
2008-12-22 02:17:37 +02:00
Gleb Shchepa
749847686c rollback of bug #40761 fix 2008-12-12 15:13:11 +04:00
Gleb Shchepa
5ff1bcbc2a rollback of bug #40761 fix 2008-12-12 14:59:10 +04:00
Gleb Shchepa
a4467c9798 manual merge 5.0-bugteam -> 5.1-bugteam (bug 40761) 2008-12-12 02:04:06 +04:00
Gleb Shchepa
ffe23f0eb7 Bug #40761: Assert on sum function on
IF(..., CAST(longtext AS UNSIGNED), signed_val)
            (was: LEFT JOIN on inline view crashes server)

Select from a LONGTEXT column wrapped with an expression
like "IF(..., CAST(longtext_column AS UNSIGNED), smth_signed)"
failed an assertion or crashed the server. IFNULL function was
affected too.

LONGTEXT column item has a maximum length of 32^2-1 bytes,
at the same time this is a maximum possible length of any
MySQL item. CAST(longtext_column AS UNSIGNED) returns some
unsigned numeric result of length 32^2-1, so the result of
IF/IFNULL function of this number and some other signed number
will have text length of (32^2-1)+1=32^2 (one byte for the
minus sign) - there is integer overflow, and the length is
equal to zero. That caused assert/crash.

The bug has been fixed by the same solution as in the CASE
function implementation.


mysql-test/r/func_if.result:
  Added test case for bug #40761.
mysql-test/t/func_if.test:
  Added test case for bug #40761.
sql/item_cmpfunc.cc:
  Bug #40761: Assert on sum function on
              IF(..., CAST(longtext AS UNSIGNED), signed_val)
  
  1. Item_func_case::agg_str_lengths method has been moved
     to the Item_func superclass.
  2. Item_func_ifnull/Item_func_if::fix_length_and_dec methods
     have been updated to calculate max_length, decimals and
     unsigned flag like Item_func_case.
sql/item_cmpfunc.h:
  Bug #40761: Assert on sum function on
              IF(..., CAST(longtext AS UNSIGNED), signed_val)
  
  Item_func_case::agg_str_lengths method has been moved to
  the Item_func superclass.
sql/item_func.cc:
  Bug #40761: Assert on sum function on
              IF(..., CAST(longtext AS UNSIGNED), signed_val)
  
  Item_func_case::agg_str_lengths method has been moved to
  the Item_func superclass.
sql/item_func.h:
  Bug #40761: Assert on sum function on
              IF(..., CAST(longtext AS UNSIGNED), signed_val)
  
  Item_func_case::agg_str_lengths method has been moved to
  the Item_func superclass.
2008-12-12 00:57:32 +04:00
Guilhem Bichot
926aaf4635 Merge of 5.1-main into 5.1-maria. There were no changes to storage/myisam, mysys/mf_keycache.c, mysql-test/t/*myisam*
since previous merge. MARIA_PAGECACHE_READS in maria-preload.test are down a little bit (5%), which must be a good
side-effect of some sql/ change.
2008-12-10 10:02:25 +01:00
Georgi Kodinov
5705e3abda merged 37936 to 5.1-bugteam 2008-12-09 19:58:50 +02:00
Georgi Kodinov
bd8657786a Bug #37936: ASSERT_COLUMN_MARKED_FOR_WRITE in Field_datetime::store ,
Field_varstring::store
      
The code that temporary saved the bitmaps of the read set and the write set so that
it can set it to all columns for debug purposes was not expecting that the
table->read_set and table->write_set can be the same. And was always saving both in 
sequence.
As a result the original value was never restored.
Fixed by saving & restoring the original value only once if the two sets are the
same (in a special set of functions).

mysql-test/r/select.result:
  Bug #37936: test case
mysql-test/t/select.test:
  Bug #37936: test case
sql/item_cmpfunc.cc:
  Bug #37936: don't save/restore twice if the read and write sets are the same
sql/opt_range.cc:
  Bug #37936: don't save/restore twice if the read and write sets are the same
sql/table.h:
  Bug #37936: Make a designated set of functions that save/restore
  both the read and the write sets in a single call.
2008-12-09 19:46:03 +02:00
Tatiana A. Nurnberg
61296d6db7 auto-merge 2008-11-27 12:33:04 +01:00
Tatiana A. Nurnberg
d096079d33 Bug#37553: MySql Error Compare TimeDiff & Time
We pretended that TIMEDIFF() would always return positive results;
this gave strange results in comparisons of the TIMEDIFF(low,hi)<TIME(0)
type that rendered a negative result, but still gave false in comparison.
We also inadvertantly dropped the sign when converting times to
decimal.

CAST(time AS DECIMAL) handles signs of the times correctly.
TIMEDIFF() marked up as signed. Time/date comparison code switched to
signed for clarity.

mysql-test/r/func_sapdb.result:
  show that time-related comparisons work with negative
  time values now.
  show that converting time to DECIMAL no longer drops sign.
mysql-test/t/func_sapdb.test:
  show that time-related comparisons work with negative
  time values now.
  show that converting time to DECIMAL no longer drops sign.
sql/item_cmpfunc.cc:
  signed returns
sql/item_cmpfunc.h:
  signed now (time/date < > =)
sql/item_func.cc:
  signed now
sql/item_timefunc.h:
  Functions such as TIMEDIFF() return signed results!
  The file-comments pretended we were doing that all along, anyway...
sql/my_decimal.cc:
  heed sign when converting time to my_decimal;
  times may actually be negative!
  Needed for SELECT CAST(time('-73:42:12') AS DECIMAL);
sql/mysql_priv.h:
  using signed for dates and times now
2008-11-26 09:28:17 +01:00
Guilhem Bichot
33b194c36e Merge of 5.1-main into 5.1-maria. There were no changes to storage/myisam, or mysql-test/t/*myisam*.
However there were three new tests mysql-test/suite/parts/t/partition*myisam.test, of which I make here
copies for Maria.
2008-11-21 15:21:50 +01:00
Sergey Glukhov
bd6376f1d1 Bug#34760 Character set autodetection appears to fail
the problem is the same as reported in bug#20835,
so the fix is backport of bug#20835 patch.


mysql-test/r/subselect.result:
  test result
mysql-test/t/subselect.test:
  test case
2008-11-21 16:39:59 +04:00
Evgeny Potemkin
3c49cb0795 Bug#37870: Usage of uninitialized value caused failed assertion.
The convert_constant_item function converts a constant to integer using
field for condition like 'field = a_constant'. In some cases the
convert_constant_item is called for a subquery when outer select is already
being executed, so convert_constant_item saves field's value to prevent its
corruption. For EXPLAIN and at the prepare phase field's value isn't
initialized yet, thus when convert_constant_item tries to restore saved
value it fails assertion.

Now the convert_constant_item doesn't save/restore field's value if it's
haven't been read yet. Outer constant values are always saved.

mysql-test/r/explain.result:
  Added a test case for the bug#37870.
mysql-test/t/explain.test:
  Added a test case for the bug#37870.
sql/item_cmpfunc.cc:
  Bug#37870: Usage of uninitialized value caused failed assertion.
  Now the convert_constant_item doesn't save/restore field's value if it's
  haven't been read yet. Outer constant values are always saved.
2008-11-05 18:40:23 +03:00
Evgeny Potemkin
545e4c58b2 Corrected fix for the bug#37870. 2008-10-27 19:19:26 +03:00
Evgeny Potemkin
e27e560783 Bug#37870: Usage of uninitialized value caused failed assertion.
The convert_constant_item function converts a constant to integer using
field for condition like 'field = a_constant'. When the convert_constant_item
is called for a subquery the outer select is already being executed, so
convert_constant_item saves field's value to prevent its corruption.
For EXPLAIN field's value isn't initialized thus when convert_constant_item
tries to restore saved value it fails assertion.
      
Now the convert_constant_item doesn't save/restore field's value
for EXPLAIN.


mysql-test/r/explain.result:
  Added a test case for the bug#37870.
mysql-test/t/explain.test:
  Added a test case for the bug#37870.
sql/item_cmpfunc.cc:
  Bug#37870: Usage of uninitialized value caused failed assertion.
  Now the convert_constant_item doesn't save/restore field's value
  for EXPLAIN.
2008-10-27 12:26:32 +03:00
Michael Widenius
f47e003e1b Merged 5.1 with maria 5.1 2008-10-10 18:28:41 +03:00
Ramil Kalimullin
eb2794d422 Merge 2008-09-09 20:52:38 +05:00
Ramil Kalimullin
776793a97c Fix for bug#37526: asymertic operator <=> in trigger
Problem: <=> operator may return wrong results 
comparing NULL and a DATE/DATETIME/TIME value.

Fix: properly check NULLs.


mysql-test/r/type_datetime.result:
  Fix for bug#37526: asymertic operator <=> in trigger
    - test result.
mysql-test/t/type_datetime.test:
  Fix for bug#37526: asymertic operator <=> in trigger
    - test case.
sql/item_cmpfunc.cc:
  Fix for bug#37526: asymertic operator <=> in trigger
    - if is_nulls_eq is TRUE Arg_comparator::compare_datetime() 
  should return 1 only if both arguments are NULL.
2008-09-09 20:05:27 +05:00
Ramil Kalimullin
bef0ee999d Merge 2008-09-05 13:36:02 +05:00
Ramil Kalimullin
788be2aebd Fix for bug #39021: SELECT REGEXP BINARY NULL never returns
Problem: SELECT ... REGEXP BINARY NULL may lead to server crash/hang.

Fix: properly handle NULL regular expressions.


mysql-test/r/func_regexp.result:
  Fix for bug #39021: SELECT REGEXP BINARY NULL never returns
    - test result.
mysql-test/t/func_regexp.test:
  Fix for bug #39021: SELECT REGEXP BINARY NULL never returns
    - test case.
sql/item_cmpfunc.cc:
  Fix for bug #39021: SELECT REGEXP BINARY NULL never returns
    - checking regular expressions' null_value
  we tested it without a val_xxx() call before, which is wrong.
  Now Item_func_regex::regcomp() returns -1 in the case
  and allows to handle NULL expessions properly.
sql/item_cmpfunc.h:
  Fix for bug #39021: SELECT REGEXP BINARY NULL never returns
    - checking regular expressions' null_value
  we tested it without a val_xxx() call before, which is wrong.
  Now Item_func_regex::regcomp() returns -1 in the case
  and allows to handle NULL expessions properly.
2008-09-05 13:30:01 +05:00
Ramil Kalimullin
67a3d9e4d0 Fix for bug#37337: Function returns different results
Problem: REGEXP in functions/PSs may return wrong results
due to improper initialization.

Fix: initialize required REGEXP params.


sql/item_cmpfunc.cc:
  Fix for bug#37337: Function returns different results
  
  prev_regexp is used in the Item_func_regex::regcomp()
  to store previous regex and to avoid re-initialization 
  if given the same pattern.
  Shoud be deleted in the Item_func_regex::cleanup() where we
  clean up the regexp structure.
2008-08-15 10:53:25 +05:00
Georgi Kodinov
a3cd2e2dab merged 34159 and 37662 5.0-bugteam->5.1-bugteam 2008-07-31 12:50:24 +03:00
Georgi Kodinov
ae4a35fd5c Bug#37662 nested if() inside sum() is parsed in exponential time
min() and max() functions are implemented in MySQL as macros.
This means that max(a,b) is expanded to: ((a) > (b) ? (a) : (b))
Note how 'a' is quoted two times.
Now imagine 'a' is a recursive function call that's several 10s of levels deep.
And the recursive function does max() with a function arg as well to dive into
recursion.
This means that simple function call can take most of the clock time.
Identified and fixed several such calls to max()/min() : including the IF() 
sql function implementation.

mysql-test/r/func_if.result:
  Bug#37662 test case
mysql-test/t/func_if.test:
  Bug#37662 test case
sql/item.cc:
  Bug#37662 don't call expensive functions as arguments to min/max
sql/item_cmpfunc.cc:
  Bug#37662 don't call expensive functions as arguments to min/max
sql/item_func.cc:
  Bug#37662 don't call expensive functions as arguments to min/max
2008-07-30 14:07:37 +03:00
Gleb Shchepa
56861c2d1f after-push patch: partial rollback of bug #37761 fix.
Note: item->null_value is not updated before a call to
item->store(), item->is_null() is not too (in common case).
2008-07-15 17:12:08 +05:00
Gleb Shchepa
e000e4a2a2 Bug #37761: IN handles NULL differently for table-subquery
and value-list

The server returns unexpected results if a right side of the 
NOT IN clause consists of NULL value and some constants of
the same type, for example:

  SELECT * FROM t WHERE NOT t.id IN (NULL, 1, 2) 
  
may return 3, 4, 5 etc if a table contains these values.


The Item_func_in::val_int method has been modified:
unnecessary resets of an Item_func_case::has_null field 
value has been moved outside of an argument comparison
loop. (Also unnecessary re-initialization of the null_value
field has been moved).


mysql-test/r/func_in.result:
  Added test case for bug #37761.
mysql-test/t/func_in.test:
  Added test case for bug #37761.
sql/item_cmpfunc.cc:
  Bug #37761: IN handles NULL differently for table-subquery 
              and value-list
  
  The Item_func_in::val_int method has been modified:
  unnecessary resets of an Item_func_case::has_null field 
  value has been moved outside of an argument comparison
  loop. (Also unnecessary re-initialization of the null_value
  field has been moved).
2008-07-14 14:06:49 +05:00
unknown
50ceea65cf Merge mysql.com:/home/my/mysql-5.1
into  mysql.com:/home/my/mysql-new


BitKeeper/etc/ignore:
  auto-union
BUILD/SETUP.sh:
  Auto merged
CMakeLists.txt:
  Auto merged
client/get_password.c:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqltest.c:
  Auto merged
cmd-line-utils/readline/bind.c:
  Auto merged
cmd-line-utils/readline/display.c:
  Auto merged
cmd-line-utils/readline/histexpand.c:
  Auto merged
cmd-line-utils/readline/history.c:
  Auto merged
cmd-line-utils/readline/readline.c:
  Auto merged
cmd-line-utils/readline/text.c:
  Auto merged
dbug/user.r:
  Auto merged
extra/yassl/src/handshake.cpp:
  Auto merged
include/config-win.h:
  Auto merged
include/m_string.h:
  Auto merged
include/my_global.h:
  Auto merged
include/my_pthread.h:
  Auto merged
include/mysql/plugin.h:
  Auto merged
include/mysql_com.h:
  Auto merged
include/thr_alarm.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysql/Makefile.shared:
  Auto merged
libmysql/dll.c:
  Auto merged
libmysql/get_password.c:
  Auto merged
libmysql/libmysql.c:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
mysql-test/lib/mtr_cases.pl:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/alter_table.result:
  Auto merged
mysql-test/r/change_user.result:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/merge.result:
  Auto merged
mysql-test/r/mix2_myisam.result:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/r/query_cache.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/valgrind.supp:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_events.result:
  Auto merged
mysql-test/suite/rpl/t/rpl_switch_stm_row_mixed.test:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
mysql-test/t/query_cache.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
mysql-test/t/view.test:
  Auto merged
mysys/mf_iocache.c:
  Auto merged
mysys/mf_tempfile.c:
  Auto merged
mysys/my_atomic.c:
  Auto merged
mysys/my_bit.c:
  Auto merged
mysys/my_bitmap.c:
  Auto merged
mysys/my_compress.c:
  Auto merged
mysys/my_create.c:
  Auto merged
mysys/my_delete.c:
  Auto merged
mysys/my_error.c:
  Auto merged
mysys/my_init.c:
  Auto merged
mysys/my_open.c:
  Auto merged
mysys/my_realloc.c:
  Auto merged
mysys/my_rename.c:
  Auto merged
mysys/my_symlink.c:
  Auto merged
mysys/my_sync.c:
  Auto merged
mysys/my_thr_init.c:
  Auto merged
mysys/thr_alarm.c:
  Auto merged
mysys/thr_lock.c:
  Auto merged
scripts/make_binary_distribution.sh:
  Auto merged
server-tools/instance-manager/mysql_connection.cc:
  Auto merged
sql/CMakeLists.txt:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/events.cc:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/gen_lex_hash.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_partition.h:
  Auto merged
sql/handler.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/net_serv.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/partition_info.cc:
  Auto merged
sql/rpl_injector.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/slave.h:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_load.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_test.cc:
  Auto merged
sql/sql_union.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
sql/unireg.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
storage/csv/ha_tina.cc:
  Auto merged
storage/csv/ha_tina.h:
  Auto merged
storage/myisam/CMakeLists.txt:
  Auto merged
storage/myisam/ft_boolean_search.c:
  Auto merged
storage/myisam/ft_eval.c:
  Auto merged
storage/myisam/ft_nlq_search.c:
  Auto merged
storage/myisam/ft_parser.c:
  Auto merged
storage/myisam/ft_static.c:
  Auto merged
storage/myisam/ft_stopwords.c:
  Auto merged
storage/myisam/ft_test1.c:
  Auto merged
storage/myisam/ft_update.c:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_check.c:
  Auto merged
storage/myisam/mi_create.c:
  Auto merged
storage/myisam/mi_delete.c:
  Auto merged
storage/myisam/mi_delete_all.c:
  Auto merged
storage/myisam/mi_dynrec.c:
  Auto merged
storage/myisam/mi_key.c:
  Auto merged
storage/myisam/mi_packrec.c:
  Auto merged
storage/myisam/mi_range.c:
  Auto merged
storage/myisam/mi_search.c:
  Auto merged
storage/myisam/mi_test1.c:
  Auto merged
storage/myisam/mi_test2.c:
  Auto merged
storage/myisam/mi_test3.c:
  Auto merged
storage/myisam/mi_unique.c:
  Auto merged
storage/myisam/mi_write.c:
  Auto merged
storage/myisam/myisamchk.c:
  Auto merged
storage/myisam/myisamdef.h:
  Auto merged
storage/myisam/myisampack.c:
  Auto merged
storage/myisam/sort.c:
  Auto merged
storage/myisam/sp_test.c:
  Auto merged
support-files/mysql.spec.sh:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
configure.in:
  Manual merge
dbug/dbug.c:
  Restore to original state in Maria tree
  The big diff comes from a wrong pull from 5.0 -> 5.1 after backporting dbug to 5.0 from 5.1
include/Makefile.am:
  Manual merge
include/my_atomic.h:
  Ignore changes
include/my_base.h:
  Manual merge
include/my_dbug.h:
  Use orginal my_dbug.h from maria tree
include/my_handler.h:
  Manual merge
include/my_sys.h:
  Manual merge
include/myisam.h:
  Manual merge
mysql-test/lib/mtr_report.pl:
  Manual merge
mysql-test/r/myisam.result:
  Manual merge
mysql-test/suite/binlog/r/binlog_unsafe.result:
  Manual merge
mysql-test/suite/binlog/t/binlog_unsafe.test:
  Manual merge
mysql-test/suite/rpl/r/rpl_row_flsh_tbls.result:
  Manual merge
mysql-test/suite/rpl/r/rpl_switch_stm_row_mixed.result:
  No changes
mysql-test/suite/rpl/t/rpl_row_flsh_tbls.test:
  Manual merge
mysql-test/t/change_user.test:
  Manual merge
mysql-test/t/disabled.def:
  Manual merge
mysql-test/t/merge.test:
  No changes
mysql-test/t/myisam.test:
  Manual merge
mysys/Makefile.am:
  Manual merge
mysys/array.c:
  Manual merge
mysys/mf_keycache.c:
  Manual merge
mysys/my_getsystime.c:
  Manual merge
mysys/my_handler.c:
  Manual merge
mysys/my_pread.c:
  Manual merge
mysys/safemalloc.c:
  Manual merge
sql/ha_partition.cc:
  Manual merge
sql/handler.cc:
  Manual merge
sql/lex.h:
  Manual merge
sql/mysql_priv.h:
  Manual merge
sql/mysqld.cc:
  Manual merge
sql/set_var.h:
  Manual merge
sql/sql_class.cc:
  Manual merge
sql/sql_insert.cc:
  Manual merge
sql/sql_parse.cc:
  Manual merge
sql/sql_select.cc:
  Manual merge
sql/sql_show.cc:
  Manual merge
sql/sql_table.cc:
  Manual merge
storage/myisam/mi_checksum.c:
  No changes
storage/myisam/mi_extra.c:
  Manual merge
storage/myisam/mi_open.c:
  Manual merge
storage/myisammrg/ha_myisammrg.cc:
  Manual merge
strings/strmake.c:
  No changes
2008-04-28 19:24:05 +03:00
unknown
a9089cf460 Bug#26243 mysql command line crash after control-c
- Backported the 5.1 DBUG to 5.0.
- Avoid memory cleanup race on Windows client for CTRL-C


client/mysql.cc:
  Bug#26243 mysql command line crash after control-c
  - On Windows, the sigint handler shouldn't call mysql_end
  because the main thread will do so automatically.
  - Remove unnecessary signal call from the sigint handler.
  - Call my_end with proper value.
dbug/dbug.c:
  Bug#26243 mysql command line crash after control-c
  - Backported the 5.1 DBUG library. The old version uses a non-thread 
  safe global variable 'static struct state *stack'.
dbug/factorial.c:
  Bug#26243 mysql command line crash after control-c
  - Backported the 5.1 DBUG library. The old version uses a non-thread 
  safe global variable 'static struct state *stack'.
dbug/user.r:
  Bug#26243 mysql command line crash after control-c
  - Backported the 5.1 DBUG library. The old version uses a non-thread 
  safe global variable 'static struct state *stack'.
include/my_dbug.h:
  Bug#26243 mysql command line crash after control-c
  - Backported the 5.1 DBUG library. The old version uses a non-thread 
  safe global variable 'static struct state *stack'.
libmysql/libmysql.c:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
myisam/mi_open.c:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/ha_federated.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/ha_innodb.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/ha_myisammrg.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/item_cmpfunc.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/mysqld.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/net_serv.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/opt_range.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/set_var.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/slave.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/sql_cache.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
sql/sql_select.cc:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
tests/mysql_client_test.c:
  Bug#26243 mysql command line crash after control-c
  - Update for new DBUG library.
2008-03-28 14:02:27 -04:00
unknown
d6df18dd33 Merge kaamos.(none):/data/src/mysql-5.1
into  kaamos.(none):/data/src/opt/mysql-5.1-opt


client/mysql.cc:
  Auto merged
client/mysqldump.c:
  Auto merged
configure.in:
  Auto merged
include/my_global.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
mysql-test/include/mix1.inc:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/func_str.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
storage/ndb/src/kernel/blocks/backup/Backup.hpp:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/r/func_time.result:
  Manual merge.
mysql-test/r/view.result:
  Manual merge.
mysql-test/t/view.test:
  Manual merge.
scripts/mysql_config.sh:
  Manual merge.
sql-common/client.c:
  Manual merge.
sql/sql_parse.cc:
  Manual merge.
2008-03-12 11:19:46 +03:00
unknown
a3e83048a3 Fix for Bug#30217: Views: changes in metadata behaviour
between 5.0 and 5.1.
  
The problem was that in the patch for Bug#11986 it was decided
to store original query in UTF8 encoding for the INFORMATION_SCHEMA.
This approach however turned out to be quite difficult to implement
properly. The main problem is to preserve the same IS-output after
dump/restore.
  
So, the fix is to rollback to the previous functionality, but also
to fix it to support multi-character-set-queries properly. The idea
is to generate INFORMATION_SCHEMA-query from the item-tree after
parsing view declaration. The IS-query should:
  - be completely in UTF8;
  - not contain character set introducers.
  
For more information, see WL4052.


mysql-test/include/ddl_i18n.check_views.inc:
  Add a test case for Bug#30217.
mysql-test/r/ddl_i18n_koi8r.result:
  Update result file.
mysql-test/r/ddl_i18n_utf8.result:
  Update result file.
mysql-test/r/information_schema.result:
  Update result file.
mysql-test/r/information_schema_db.result:
  Update result file.
mysql-test/r/mysqldump.result:
  Update result file.
mysql-test/r/show_check.result:
  Update result file.
mysql-test/t/ddl_i18n_koi8r.test:
  Add a test case for Bug#30217.
mysql-test/t/ddl_i18n_utf8.test:
  Add a test case for Bug#30217.
mysql-test/t/mysqldump.test:
  Add a test case for Bug#30217.
sql/ha_ndbcluster.cc:
  Add a parameter to print().
sql/item.cc:
  1. Add a parameter to print().
  2. Item_string::print():
        - Do not append character set introducer to the text literal
          if we're building a query for INFORMATION_SCHEMA;
        - Convert text literal to UTF8 if we're building a query
          for INFORMATION_SCHEMA.
sql/item.h:
  Add a parameter to print().
sql/item_cmpfunc.cc:
  Add a parameter to print().
sql/item_cmpfunc.h:
  Add a parameter to print().
sql/item_func.cc:
  Add a parameter to print().
sql/item_func.h:
  Add a parameter to print().
sql/item_geofunc.h:
  Add a parameter to print().
sql/item_row.cc:
  Add a parameter to print().
sql/item_row.h:
  Add a parameter to print().
sql/item_strfunc.cc:
  Add a parameter to print().
sql/item_strfunc.h:
  Add a parameter to print().
sql/item_subselect.cc:
  Add a parameter to print().
sql/item_subselect.h:
  Add a parameter to print().
sql/item_sum.cc:
  Add a parameter to print().
sql/item_sum.h:
  Add a parameter to print().
sql/item_timefunc.cc:
  Add a parameter to print().
sql/item_timefunc.h:
  Add a parameter to print().
sql/mysql_priv.h:
  Add a parameter to print().
sql/sp_head.cc:
  Add a parameter to print().
sql/sql_lex.cc:
  Add a parameter to print().
sql/sql_lex.h:
  Add a parameter to print().
sql/sql_parse.cc:
  Add a parameter to print().
sql/sql_select.cc:
  Add a parameter to print().
sql/sql_show.cc:
  Add a parameter to print().
sql/sql_test.cc:
  Add a parameter to print().
sql/sql_view.cc:
  Build INFORMATION_SCHEMA query from Item-tree.
sql/sql_yacc.yy:
  Build INFORMATION_SCHEMA query from Item-tree.
sql/table.h:
  Add a parameter to print().
2008-02-22 13:30:33 +03:00
unknown
695865fee9 Merge kaamos.(none):/data/src/mysql-5.1
into  kaamos.(none):/data/src/opt/mysql-5.1-opt


libmysqld/lib_sql.cc:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/variables.result:
  Auto merged
BitKeeper/deleted/.del-rpl_ndb_charset.result:
  Auto merged
BitKeeper/deleted/.del-rpl_row_charset.result:
  Auto merged
BitKeeper/deleted/.del-rpl_row_charset.test:
  Auto merged
BitKeeper/deleted/.del-rpl_row_charset_innodb.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Manual merge.
mysql-test/r/sp.result:
  Manual merge.
2008-02-17 14:57:01 +03:00
unknown
8170b22b5c Fixed compiler warnings in a lot of files
Added IMPOSSIBLE_RESULT to avoid compiler warnings when using (Item_result) -1 as a dummy value
Changed PAGE_SIZE to TEST_PAGE_SIZE to avoid compiler errors on systems where PAGE_SIZE is defined


client/get_password.c:
  Fixed compiler warning
cmd-line-utils/readline/bind.c:
  Fixed compiler warning
cmd-line-utils/readline/chardefs.h:
  Fixed compiler warning by adding marco to be used when largest_char is 255
cmd-line-utils/readline/display.c:
  Fixed compiler warnings by removing not accessed variables
cmd-line-utils/readline/histexpand.c:
  Fixed compiler warnings by removing not accessed variables
cmd-line-utils/readline/history.c:
  Fixed compiler warnings by adding cast
cmd-line-utils/readline/text.c:
  Fixed compiler warnings by removing not accessed variables and adding casts
dbug/dbug.c:
  Fixed compiler warnings by changing types
include/mysql_com.h:
  Added IMPOSSIBLE_RESULT to avoid compiler warnings when using (Item_result) -1 as a dummy value
libmysql/libmysql.c:
  Fixed compiler warning
mysql-test/t/query_cache_debug.test:
  Mark test as BIG as it uses a lot of memory
mysys/mf_iocache2.c:
  Fixed compiler warnings by adding cast
sql/event_data_objects.cc:
  Fixed compiler warnings by removing not used code
sql/events.cc:
  Fixed compiler warnings by removing not used code
sql/field.cc:
  Fixed compiler warnings by adding cast and removed not accessed variables
sql/ha_partition.cc:
  Fixed compiler warnings by removing not used code
sql/item.cc:
  Fixed compiler warnings by removing not accessed variables
  Use IMPOSSIBLE_RESULT instead of (Item_result)-1
sql/item_cmpfunc.cc:
  Fixed compiler warnings by removing not accessed variables
sql/item_func.cc:
  Fixed compiler warnings by removing not used code and not accessed variables
  Added IMPOSSIBLE_RESULT
sql/item_subselect.cc:
  Fixed compiler warnings by removing not accessed variables
sql/item_xmlfunc.cc:
  Fixed forgotten setting of xpath->error
sql/log.cc:
  Fixed compiler warnings by removing not accessed variables
sql/log_event.cc:
  Added IMPOSSIBLE_RESULT into switch
  Fixed wrong usage of DBUG_ASSERT(1)
  Removed always true DBUG_ASSERT()
sql/mysqld.cc:
  Fixed compiler warnings by adding casts for ULONG_MAX
sql/opt_sum.cc:
  Fixed compiler warnings by removing not used code
  Removed wrong DBUG_ASSERT()
sql/partition_info.cc:
  Fixed compiler warnings by removing not accessed variables
sql/rpl_injector.h:
  Removed always true part from DBUG_ASSERT() to remove compiler warning
sql/spatial.cc:
  Fixed compiler warnings by removing not accessed variables
sql/sql_acl.cc:
  Fixed compiler warnings by removing not accessed variables
sql/sql_base.cc:
  Fixed compiler warnings by removing not accessed variables
sql/sql_cache.cc:
  Fixed compiler warnings by removing not accessed variables
sql/sql_class.cc:
  Fixed compiler warnings by:
  - Removing always true part from DBUG_ASSERT()
  - Removing not used code
  - Added IMPOSSIBLE_RESULT into switch
sql/sql_load.cc:
  Fixed compiler warnings by removing not accessed variables
sql/sql_parse.cc:
  Fixed compiler warnings by:
  - Removing not accessed variables
  - Removing always true part from DBUG_ASSERT()
  - Removing not used code
sql/sql_plugin.cc:
  Added comment
sql/sql_prepare.cc:
  Fixed compiler warnings by removing not accessed variables
sql/sql_show.cc:
  Fixed compiler warnings by using correct cast
sql/sql_table.cc:
  Fixed compiler warnings by removing not used code and removing not accessed variables
sql/table.cc:
  Fixed compiler warnings by removing not accessed variables
sql/time.cc:
  Fixed wrong DBUG_ASSERT(1)
storage/maria/unittest/Makefile.am:
  Changed PAGE_SIZE to TEST_PAGE_SIZE to avoid compiler errors on systems where PAGE_SIZE is defined
storage/maria/unittest/ma_pagecache_consist.c:
  Changed PAGE_SIZE to TEST_PAGE_SIZE to avoid compiler errors on systems where PAGE_SIZE is defined
storage/maria/unittest/ma_pagecache_single.c:
  Changed PAGE_SIZE to TEST_PAGE_SIZE to avoid compiler errors on systems where PAGE_SIZE is defined
tests/mysql_client_test.c:
  Fixed compiler warnings by removing not accessed variables and changing types
2008-02-13 21:27:12 +02:00
unknown
22e2762640 Merge host.loc:/home/uchum/work/5.0-opt-gca
into  host.loc:/home/uchum/work/5.1-opt-gca


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
2008-02-13 19:37:05 +04:00
unknown
247efb9cf0 Fixed bug#33764: Wrong result with IN(), CONCAT() and implicit
type conversion.

Instead of copying of whole character string from a temporary
buffer, the server copied a short-living pointer to that string
into a long-living structure. That has been fixed.


mysql-test/r/select.result:
  Added test case for bug#33764.
mysql-test/t/select.test:
  Added test case for bug#33764.
sql/item_cmpfunc.cc:
  Fixed bug#33764.
  Copying of a pointer has been replaced with an optional copying of
  a whole array to a newly allocated memory space in case of a
  functional source item.
2008-02-13 19:32:19 +04:00
unknown
a36faa7eda Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl-merge


client/client_priv.h:
  Auto merged
include/my_sys.h:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/lib/mtr_report.pl:
  Auto merged
mysql-test/suite/rpl/t/rpl_err_ignoredtable.test:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
mysql-test/suite/rpl/r/rpl_invoked_features.result:
  Manual merge.
mysql-test/suite/rpl/t/rpl_invoked_features.test:
  Manual merge.
sql/log.cc:
  Manual merge.
2008-01-31 17:46:50 +01:00
unknown
7b8ec92ecc Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl-merge


sql/item_cmpfunc.cc:
  Auto merged
2008-01-30 17:46:37 +01:00
unknown
b0283afb9c Fixing return value.
sql/item_cmpfunc.cc:
  Minor fix to return correct value in case of error.
sql/rpl_utility.cc:
  Minor fix to return correct value in case of error.
2008-01-30 17:35:25 +01:00
unknown
b395490480 Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl-merge


BitKeeper/deleted/.del-show_binlog_events2.inc:
  Auto merged
sql-common/client.c:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/slave.cc:
  Auto merged
2008-01-30 16:14:14 +01:00
unknown
101c30ccc4 Post-merge changes.
BitKeeper/deleted/.del-show_binlog_events2.inc:
  Delete: mysql-test/include/show_binlog_events2.inc
client/mysqlbinlog.cc:
  char -> uchar for raw memory.
sql/item_cmpfunc.cc:
  Adding cast to remove warning when converting negative integer
  to unsigned type.
sql/log_event.cc:
  char -> uchar for raw memory.
sql/log_event.h:
  char -> uchar for raw memory.
sql/rpl_utility.cc:
  Adding cast to remove warning when converting negative integer
  to unsigned type.
sql/slave.cc:
  char -> uchar for raw memory.
sql/sql_repl.cc:
  char -> uchar for raw memory.
sql-common/client.c:
  char -> uchar for raw memory.
2008-01-30 16:03:00 +01:00
unknown
295732b580 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  janus.mylan:/usr/home/serg/Abk/mysql-5.1


configure.in:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/information_schema.result:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/field.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_geofunc.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/key.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/net_serv.cc:
  Auto merged
sql/opt_sum.cc:
  Auto merged
sql/protocol.h:
  Auto merged
sql/repl_failsafe.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_select.h:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.h:
  Auto merged
storage/archive/ha_archive.cc:
  Auto merged
storage/innobase/buf/buf0buf.c:
  Auto merged
storage/innobase/buf/buf0flu.c:
  Auto merged
storage/innobase/buf/buf0lru.c:
  Auto merged
storage/innobase/include/buf0buf.h:
  Auto merged
storage/innobase/include/buf0buf.ic:
  Auto merged
storage/innobase/include/sync0arr.h:
  Auto merged
storage/innobase/include/sync0rw.h:
  Auto merged
storage/innobase/include/sync0rw.ic:
  Auto merged
storage/innobase/include/sync0sync.h:
  Auto merged
storage/innobase/os/os0sync.c:
  Auto merged
storage/innobase/sync/sync0arr.c:
  Auto merged
storage/innobase/sync/sync0rw.c:
  Auto merged
storage/innobase/sync/sync0sync.c:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_open.c:
  Auto merged
storage/myisammrg/ha_myisammrg.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  merged
sql/item_cmpfunc.cc:
  merged
sql/protocol.cc:
  merged
sql/slave.cc:
  merged
sql/sql_class.h:
  merged
sql/sql_parse.cc:
  merged
2007-12-20 22:11:37 +01:00
unknown
18f5e87ed9 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint


sql/field.cc:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_create.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_geofunc.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/net_serv.cc:
  Auto merged
sql/opt_sum.cc:
  Auto merged
sql/protocol.h:
  Auto merged
sql/records.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.h:
  Auto merged
sql/sql_trigger.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/structs.h:
  Auto merged
sql/unireg.h:
  Auto merged
sql/item.cc:
  manual merge
sql/log_event.cc:
  manual merge
sql/protocol.cc:
  manual merge
sql/sp_head.cc:
  manual merge
sql/sql_base.cc:
  manual merge
sql/sql_parse.cc:
  manual merge
sql/sql_select.cc:
  manual merge
2007-12-14 10:52:10 -05:00
unknown
214ea2063a Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt


client/mysql.cc:
  Auto merged
client/mysqltest.c:
  Auto merged
include/mysql_com.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
mysql-test/r/delayed.result:
  Auto merged
mysql-test/r/func_misc.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/myisam.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/t/func_misc.test:
  Auto merged
mysql-test/t/merge.test:
  Auto merged
mysql-test/t/myisam.test:
  Auto merged
mysql-test/t/range.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/type_datetime.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_check.c:
  Auto merged
mysql-test/include/mix1.inc:
  manual merge
mysql-test/r/innodb_mysql.result:
  manual merge
mysql-test/r/range.result:
  manual merge
sql/item_cmpfunc.cc:
  manual merge
2007-12-13 16:10:57 +04:00
unknown
9a10c20ba9 Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt


BitKeeper/etc/ignore:
  auto-union
client/mysql.cc:
  Auto merged
client/mysqltest.c:
  Auto merged
include/mysql_com.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
mysql-test/r/archive.result:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/delayed.result:
  Auto merged
mysql-test/r/func_misc.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/merge.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/r/type_date.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_innodb_bug28430.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/func_misc.test:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
mysql-test/t/merge.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/type_date.test:
  Auto merged
mysql-test/t/type_datetime.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
mysys/queues.c:
  Auto merged
sql/events.cc:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_partition.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_string.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/mi_check.c:
  Auto merged
storage/myisam/mi_open.c:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/lib/mtr_report.pl:
  manual merge
mysql-test/r/myisam.result:
  manual merge
mysql-test/r/partition.result:
  manual merge
mysql-test/r/user_var.result:
  manual merge
mysql-test/t/myisam.test:
  manual merge
mysql-test/t/partition.test:
  manual merge
mysql-test/t/user_var.test:
  manual merge
sql/item.h:
  manual merge
sql/item_func.cc:
  manual merge
storage/myisammrg/ha_myisammrg.cc:
  manual merge
2007-12-13 15:56:04 +04:00
unknown
33f82b1789 Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt


client/mysql.cc:
  Auto merged
client/mysqltest.c:
  Auto merged
include/mysql_com.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
myisam/mi_check.c:
  Auto merged
mysql-test/r/delayed.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/myisam.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/t/merge.test:
  Auto merged
mysql-test/t/myisam.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/type_datetime.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_myisam.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/r/func_misc.result:
  manual merge
mysql-test/r/innodb_mysql.result:
  manual merge
mysql-test/t/func_misc.test:
  manual merge
mysql-test/t/innodb_mysql.test:
  manual merge
sql/sql_insert.cc:
  manual merge
2007-12-13 14:52:49 +04:00
unknown
1cdd95f7d1 Forced compilers to remove the warning appeared after the patch
with a fix for bug 32694.
2007-12-09 11:53:07 -08:00
unknown
b74535d7d9 Merge lapi.mysql.com:/home/tkatchaounov/mysql/src/5.0#32694
into  lapi.mysql.com:/home/tkatchaounov/mysql/src/5.1#32694


mysql-test/r/type_datetime.result:
  Auto merged
mysql-test/t/type_datetime.test:
  Manual merge for BUG#32694.
sql/item_cmpfunc.cc:
  Manual merge for BUG#32694.
2007-12-08 23:15:43 +02:00
unknown
b3d8ff4ebd Fix for BUG#32694 "NOT NULL table field in a subquery produces invalid results"
The problem was that when convert_constant_item is called for subqueries,
this happens when we already started executing the top-level query, and
the field argument of convert_constant_item pointed to a valid table row.
In turn convert_constant_item used the field buffer to compute the value
of its item argument. This copied the item's value into the field,
and made equalities with outer references always true.
  
The fix saves/restores the original field's value when it belongs to an
outer table.


mysql-test/r/type_datetime.result:
  Test for BUG#32694.
mysql-test/t/type_datetime.test:
  Test for BUG#32694.
sql/item_cmpfunc.cc:
  - Changed convert_constant_item() so that it doesn't destroy the contents
    of its field argument when the field originates from table in an outer
    query.
2007-12-08 23:05:00 +02:00
unknown
068b6e4222 Merge ramayana.hindu.god:/home/tsmith/m/bk/51
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/51-merge


client/mysqldump.c:
  Auto merged
include/my_base.h:
  Auto merged
include/my_sys.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysql/Makefile.shared:
  Auto merged
mysql-test/lib/mtr_cases.pl:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/create.result:
  Auto merged
mysql-test/r/grant.result:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/suite/rpl/t/rpl_ssl.test:
  Auto merged
mysql-test/t/cast.test:
  Auto merged
mysql-test/t/create.test:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/records.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/unireg.cc:
  Auto merged
storage/myisam/ft_boolean_search.c:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/sort.c:
  Auto merged
mysql-test/t/log_state.test:
  Manual merge fix-up
mysql-test/include/mix1.inc:
  Manual merge
mysql-test/r/ctype_ucs.result:
  Manual merge
mysql-test/r/func_misc.result:
  Manual merge
mysql-test/r/innodb_mysql.result:
  Manual merge
mysql-test/r/key.result:
  Manual merge
mysql-test/r/log_state.result:
  Manual merge
mysql-test/suite/binlog/t/binlog_killed.test:
  Manual merge
mysql-test/t/ctype_ucs.test:
  Manual merge
mysql-test/t/func_misc.test:
  Manual merge
mysql-test/t/key.test:
  Manual merge
sql/item_strfunc.h:
  Manual merge
strings/ctype-simple.c:
  Manual merge
2007-12-05 12:33:36 -07:00
unknown
55a420e134 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/50


client/mysqldump.c:
  Auto merged
include/my_sys.h:
  Auto merged
libmysql/CMakeLists.txt:
  Auto merged
libmysql/Makefile.shared:
  Auto merged
myisam/ft_boolean_search.c:
  Auto merged
myisam/sort.c:
  Auto merged
mysql-test/t/cast.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_myisam.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
mysql-test/mysql-test-run.pl:
  Manual merge
mysql-test/r/ctype_ucs.result:
  Manual merge
mysql-test/r/func_misc.result:
  Manual merge
mysql-test/t/binlog_killed.test:
  Manual merge
mysql-test/t/ctype_ucs.test:
  Manual merge
mysql-test/t/func_misc.test:
  Manual merge
sql/item_strfunc.h:
  Manual merge
strings/ctype-simple.c:
  Manual merge
2007-12-04 20:58:21 -07:00
unknown
30aee30b0d Merge stella.local:/home2/mydev/mysql-5.1-amain
into  stella.local:/home2/mydev/mysql-5.1-axmrg


include/my_base.h:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/suite/ndb/t/disabled.def:
  Auto merged
mysql-test/t/partition.test:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
client/mysql.cc:
  Manual merge
mysql-test/suite/rpl/t/disabled.def:
  Manual merge
2007-11-27 19:29:10 +01:00
unknown
6288fde222 Merge stella.local:/home2/mydev/mysql-5.0-amain
into  stella.local:/home2/mydev/mysql-5.0-axmrg


sql/item_cmpfunc.cc:
  Auto merged
2007-11-27 16:24:44 +01:00
unknown
a41eb64590 Merge mysql.com:/home/ram/work/b32560/b32560.5.0
into  mysql.com:/home/ram/work/b32560/b32560.5.1


mysql-test/r/func_set.result:
  Auto merged
sql/item_cmpfunc.cc:
  SCCS merged
2007-11-23 16:43:49 +04:00
unknown
1f57bfb8d1 Fix for bug #32560: crash with interval function and count(*)
Problem: INTERVAL function implementation doesn't handle NULL range values.

Fix: skip NULL ranges looking for a proper one.


mysql-test/r/func_set.result:
  Fix for bug #32560: crash with interval function and count(*)
    - test result.
mysql-test/t/func_set.test:
  Fix for bug #32560: crash with interval function and count(*)
    - test case.
sql/item_cmpfunc.cc:
  Fix for bug #32560: crash with interval function and count(*)
    - skip NULL ranges calculating INTERVAL(...).
2007-11-23 16:30:06 +04:00
unknown
692f0e4f67 Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.1
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.1-rpl-merge


client/mysql.cc:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/ctype_ucs.result:
  Auto merged
mysql-test/r/mysql.result:
  Auto merged
mysql-test/suite/ndb/r/ndb_dd_basic.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_extraCol_innodb.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_extraCol_myisam.result:
  Auto merged
mysql-test/suite/rpl_ndb/r/rpl_ndb_extraCol.result:
  Auto merged
mysql-test/t/ctype_uca.test:
  Auto merged
mysql-test/t/ctype_ucs.test:
  Auto merged
mysql-test/t/innodb.test:
  Auto merged
mysql-test/t/mysql.test:
  Auto merged
mysql-test/t/partition.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/r/innodb.result:
  Manual merge.
2007-11-21 21:15:33 +01:00
unknown
d295bfaa76 Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.0
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl-merge


client/mysql.cc:
  Auto merged
mysql-test/r/ctype_ucs.result:
  Auto merged
mysql-test/t/ctype_uca.test:
  Auto merged
mysql-test/t/ctype_ucs.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
2007-11-21 21:11:57 +01:00
unknown
f2a631f0dc Fix for bug #32021: Using Date 000-00-01 in WHERE causes wrong result
Problem: caching 00000000-00000099 dates as integer values we're 
improperly shifting them up twice in the get_datetime_value().
  
Fix: don't shift cached DATETIME values up for the second time.


mysql-test/r/type_date.result:
  Fix for bug #32021: Using Date 000-00-01 in WHERE causes wrong result
    - test result.
mysql-test/t/type_date.test:
  Fix for bug #32021: Using Date 000-00-01 in WHERE causes wrong result
    - test case.
sql/item.h:
  Fix for bug #32021: Using Date 000-00-01 in WHERE causes wrong result
    - Item_cache::field_type() method added.
    - new Item_cache(enum_field_types) and Item_cache_int(enum_field_types) 
      constructors added.
sql/item_cmpfunc.cc:
  Fix for bug #32021: Using Date 000-00-01 in WHERE causes wrong result
    - don't shift cached DATETIME values for the second time in the
      get_datetime_value():
        creating new Item_cache_int set DATETIME filed type,
        check the type before shifting.
2007-11-21 08:01:00 +04:00
unknown
e316f813d9 Merge gleb.loc:/work/bk/PA/5.0-opt-32335
into  gleb.loc:/work/bk/5.1-opt


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/item_cmpfunc.cc:
  Merge with 5.0-opt.
2007-11-18 16:54:47 +04:00
unknown
99054db64c Fixed bug #32335.
Comparison of a BIGINT NOT NULL column with a constant arithmetic
expression that evaluates to NULL caused error 1048: "Column '...'
cannot be null".

Made convert_constant_item() check if the constant expression is NULL
before attempting to store it in a field. Attempts to store NULL in a
NOT NULL field caused query errors.


sql/item_cmpfunc.cc:
  Fixed bug #32335.
  1. Made convert_constant_item() check if the constant expression is NULL
     before attempting to store it in a field. Attempts to store NULL in
     a NOT NULL field caused query errors.
  
  2. Also minor bug has been fixed: the thd->count_cuted_fields value
     was not restored in case of successful conversion.
mysql-test/t/select.test:
  Added test case for bug #32335.
mysql-test/r/select.result:
  Added test case for bug #32335.
2007-11-18 00:02:55 +04:00
unknown
2892d3a2ab Merge gleb.loc:/home/uchum/5.0-opt
into  gleb.loc:/home/uchum/5.1-opt


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/sp_rcontext.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
mysql-test/r/subselect.result:
  Merge with 5.0-opt.
mysql-test/t/subselect.test:
  Merge with 5.0-opt.
2007-11-11 06:07:38 +04:00
unknown
747cb198b6 Merge gleb.loc:/home/uchum/work/bk/5.0-opt-28076
into  gleb.loc:/home/uchum/work/bk/5.0-opt


sql/item_cmpfunc.cc:
  Auto merged
2007-11-10 23:58:22 +04:00
unknown
e7c6a81f25 Fixed bug #28076: inconsistent binary/varbinary comparison.
After adding an index the <VARBINARY> IN (SELECT <BINARY> ...)
clause returned a wrong result: the VARBINARY value was illegally padded
with zero bytes to the length of the BINARY column for the index search.
(<VARBINARY>, ...) IN (SELECT <BINARY>, ... ) clauses are affected too.


sql/item.cc:
  Fixed bug #28076.
  The Item_cache_str::save_in_field method has been overloaded
  to check cached values for an illegal padding before the saving
  into a field.
sql/item.h:
  Fixed bug #28076.
  The Item_cache_str::is_varbinary flag has been added and the
  Item_cache_str::save_in_field method has been overloaded to prevent
  cached values from an illegal padding when saving in fields.
  The signature of the Item_cache::get_cache method has been
  changed to accept pointers to Item instead of Item_result
  values.
sql/item_cmpfunc.cc:
  Fixed bug #28076.
  The Item_in_optimizer::fix_left method has been modified to
  to call Item_cache::get_cache in a new manner.
sql/item_subselect.cc:
  Fixed bug #28076.
  The subselect_indexsubquery_engine::exec method has been
  modified to take into account field conversion errors
  (copy&paste from subselect_uniquesubquery_engine::exec).
sql/sp_rcontext.cc:
  Fixed bug #28076.
  The sp_rcontext::create_case_expr_holder method has been
  modified to call Item_cache::get_cache in a new manner.
sql/sp_rcontext.h:
  Fixed bug #28076.
  The sp_rcontext::create_case_expr_holder method signature
  has been modified to pass Item pointers to the
  Item_cache::get_cache method.
sql/sql_class.cc:
  Fixed bug #28076.
  The select_max_min_finder_subselect::send_data method has been
  modified to call Item_cache::get_cache in a new manner.
mysql-test/t/subselect.test:
  Added test case for bug #28076.
mysql-test/r/subselect.result:
  Added test case for bug #28076.
2007-11-10 23:44:48 +04:00
unknown
91ceabf3b4 Merge mysql.com:/misc/mysql/31800/50-31800
into  mysql.com:/misc/mysql/31800/51-31800


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql-common/my_time.c:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
2007-11-10 13:34:12 +01:00
unknown
ac3ef6c759 Bug#31800: Date comparison fails with timezone and slashes for greater than comparison
BETWEEN was more lenient with regard to what it accepted as a DATE/DATETIME
in comparisons than greater-than and less-than were. ChangeSet makes < >
comparisons similarly robust with regard to trailing garbage (" GMT-1")
and "missing" leading zeros. Now all three comparators behave similarly
in that they throw a warning for "junk" at the end of the data, but then
proceed anyway if possible. Before < > fell back on a string- (rather than
date-) comparison when a warning-condition was raised in the string-to-date
conversion. Now the fallback only happens on actual errors, while warning-
conditions still result in a warning being to delivered to the client.


mysql-test/r/select.result:
  Show that we compare DATE/DATETIME-like strings as date(time)s
  now, rather than as bin-strings.
  Adjust older result as "2005-09-3a" is now correctly seen as
  "2005-09-3" + trailing garbage, rather than as "2005-09-30".
mysql-test/t/select.test:
  Show that we compare DATE/DATETIME-like strings as date(time)s
  now, rather than as bin-strings.
sql-common/my_time.c:
  correct/clarify date-related comments, particulary for check_date().
  doxygenize comment while at it.
sql/item_cmpfunc.cc:
  get_date_from_str() no longer signals an error when all we had
  was a warning-condition -- and one we already gave the user a
  warning for at that. Preamble doxygenized.
2007-11-10 13:33:42 +01:00
unknown
200f0531ef Merge koti.dsl.inet.fi:/home/elkin/MySQL/TEAM/FIXES/5.0/bug27571_asyn_killed_flags
into  koti.dsl.inet.fi:/home/elkin/MySQL/5.1-merge-bug27571


client/mysql.cc:
  Auto merged
mysql-test/r/ctype_euckr.result:
  Auto merged
mysql-test/r/ctype_uca.result:
  Auto merged
mysql-test/suite/binlog/r/binlog_killed.result:
  Auto merged
mysql-test/suite/binlog/t/binlog_killed.test:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/log_event.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
strings/ctype-euc_kr.c:
  Auto merged
mysql-test/suite/rpl/r/rpl_sp_effects.result:
  manual merge ul
mysql-test/suite/rpl/t/rpl_sp_effects.test:
  manual merge
sql/slave.cc:
  leaving for manual merge
sql/sql_delete.cc:
  leaving for manual merge
sql/sql_insert.cc:
  leaving for manual merge
sql/sql_load.cc:
  leaving for manual merge
sql/sql_update.cc:
  leaving for manual merge
2007-10-30 11:31:03 +02:00
unknown
c45171b01b Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/bar/mysql-work/mysql-5.0-rpl-merge


mysql-test/r/ctype_utf8.result:
  Auto merged
mysql-test/r/func_regexp.result:
  Auto merged
mysql-test/t/ctype_utf8.test:
  Auto merged
mysql-test/t/func_regexp.test:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
mysql-test/r/ctype_ucs.result:
  After merge fix
mysql-test/t/ctype_ucs.test:
  After merge fix
2007-10-30 12:21:44 +04:00
unknown
a3b60d2d51 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.1
into  mysql.com:/home/bar/mysql-work/mysql-5.1-new-rpl-merge


client/mysql.cc:
  Auto merged
mysql-test/r/ctype_euckr.result:
  Auto merged
mysql-test/r/ctype_uca.result:
  Auto merged
mysql-test/r/ctype_utf8.result:
  Auto merged
mysql-test/r/func_regexp.result:
  Auto merged
mysql-test/suite/rpl/r/rpl_bug31076.result:
  Auto merged
mysql-test/t/ctype_utf8.test:
  Auto merged
mysql-test/t/func_regexp.test:
  Auto merged
mysql-test/t/partition.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_xmlfunc.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/log.h:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
strings/ctype-euc_kr.c:
  Auto merged
sql/sql_yacc.yy:
  Reverting Rafal's changes: TRANSACTIONAL_SYM was removed in a mistake.
mysql-test/r/ctype_ucs.result:
  After merge fix
mysql-test/suite/rpl/t/rpl_bug31076.test:
  After merge fix.
mysql-test/t/ctype_ucs.test:
  After megre fix
2007-10-30 12:03:34 +04:00
unknown
016c6f615e Merge mysql.com:/home/ram/work/mysql-5.0-maint
into  mysql.com:/home/ram/work/b30782/b30782.5.0


sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
2007-10-29 13:42:02 +04:00
unknown
30dab869ec Merge mysql.com:/home/ram/work/b30782/b30782.5.0
into  mysql.com:/home/ram/work/b30782/b30782.5.1


sql/item_cmpfunc.cc:
  Auto merged
mysql-test/r/case.result:
  manual merge.
mysql-test/t/case.test:
  manual merge.
sql/item_cmpfunc.h:
  manual merge.
2007-10-29 13:16:26 +04:00
unknown
42894ed0b8 Fix for bug #30782: Truncated UNSIGNED BIGINT columns only in SELECT w/ CASE,
JOIN, and ORDER BY

Problem: improper maximum length calculation of the CASE function leads to 
decimal value truncation (storing/retrieving decimal field values).

Fix: accurately calculate maximum length/unsigned flag/decimals parameters 
of the CASE function.


mysql-test/r/case.result:
  Fix for bug #30782: Truncated UNSIGNED BIGINT columns only in SELECT w/ CASE, 
  JOIN, and ORDER BY
    - test result.
mysql-test/t/case.test:
  Fix for bug #30782: Truncated UNSIGNED BIGINT columns only in SELECT w/ CASE, 
  JOIN, and ORDER BY
    - test case.
sql/item_cmpfunc.cc:
  Fix for bug #30782: Truncated UNSIGNED BIGINT columns only in SELECT w/ CASE, 
  JOIN, and ORDER BY
    - accurately calculate Item_func_case::max_length/unsigned_flag/decimals.
sql/item_cmpfunc.h:
  Fix for bug #30782: Truncated UNSIGNED BIGINT columns only in SELECT w/ CASE, 
  JOIN, and ORDER BY
    - accurately calculate Item_func_case::max_length/unsigned_flag/decimals.
2007-10-29 12:20:21 +04:00
unknown
47bed4d45d Bug#31081 server crash in regexp function
Additional fix for valgrind warning
2007-10-24 12:08:33 +05:00
unknown
ddaecb2161 Merge polly.(none):/home/kaa/src/maint/mysql-5.0-maint
into  polly.(none):/home/kaa/src/maint/mysql-5.1-maint


include/my_sys.h:
  Auto merged
libmysql/Makefile.shared:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/records.cc:
  Auto merged
sql/sql_array.h:
  Auto merged
sql/sql_help.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
storage/myisam/ft_boolean_search.c:
  Auto merged
storage/myisam/ft_nlq_search.c:
  Auto merged
storage/myisam/myisampack.c:
  Auto merged
mysys/mf_keycache.c:
  Manual merge.
mysys/mf_sort.c:
  Manual merge.
mysys/my_lib.c:
  Manual merge.
mysys/queues.c:
  Manual merge.
sql/sql_acl.cc:
  Manual merge.
sql/sql_table.cc:
  Manual merge.
storage/csv/ha_tina.cc:
  Manual merge.
storage/myisam/sort.c:
  Manual merge.
2007-10-18 14:32:43 +04:00
unknown
ce8bf087b0 Fix for bug #31207: Test "join_nested" shows different strategy on IA64
CPUs / Intel's ICC compile

The bug is a combination of two problems:

1. IA64/ICC MySQL binaries use glibc's qsort(), not the one in mysys.

2. The order relation implemented by join_tab_cmp() is not transitive,
i.e. it is possible to choose such a, b and c that (a < b) && (b < c)
but (c < a). This implies that result of a sort using the relation
implemented by join_tab_cmp() depends on the order in which
elements are compared, i.e. the result is implementation-specific. Since
choose_plan() uses qsort() to pre-sort the
join tables using join_tab_cmp() as a compare function, the results of
the sorting may vary depending on qsort() implementation.

It is neither possible nor important to implement a better ordering
algorithm in join_tab_cmp(). Therefore the only way to fix it is to
force our own qsort() to be used by renaming it to my_qsort(), so we don't depend
on linker to decide that.

This patch also "fixes" bug #20530: qsort redefinition violates the
standard.


include/my_sys.h:
  Renamed qsort() and qsort2() to my_qsort() and my_qsort2(). Since
  previously we relied on stdlib.h to provide a declaration for qsort(), a
  separate declaration for my_qsort() is now required.
libmysql/Makefile.shared:
  Added mf_qsort.c to libmysql, since my_lib.c now uses my_qsort() instead of qsort().
myisam/ft_boolean_search.c:
  Replaced qsort2() with my_qsort2().
myisam/ft_nlq_search.c:
  Replaced qsort2() with my_qsort2().
myisam/myisampack.c:
  Replaced qsort() with my_qsort().
myisam/sort.c:
  Replaced qsort2() with my_qsort2().
mysys/mf_keycache.c:
  Replaced qsort() with my_qsort().
mysys/mf_qsort.c:
  Renamed qsort() to my_qsort() and qsort2() to my_qsort2().
mysys/mf_sort.c:
  Replaced qsort2() with my_qsort2().
mysys/my_lib.c:
  Replaced qsort() with my_qsort().
mysys/queues.c:
  Replaced qsort2() with my_qsort2().
sql/item_cmpfunc.cc:
  Replaced qsort2() with my_qsort2().
sql/item_cmpfunc.h:
  Replaced qsort2() with my_qsort2().
sql/opt_range.cc:
  Replaced qsort() with my_qsort().
sql/records.cc:
  Replaced qsort() with my_qsort().
sql/sql_acl.cc:
  Replaced qsort() with my_qsort().
sql/sql_array.h:
  Replaced qsort() with my_qsort().
sql/sql_help.cc:
  Replaced qsort() with my_qsort().
sql/sql_select.cc:
  Replaced qsort() with my_qsort().
sql/examples/ha_tina.cc:
  Replaced qsort() with my_qsort().
sql/sql_table.cc:
  Replaced qsort() with my_qsort().
2007-10-17 20:08:58 +04:00
unknown
d3443ee1c7 Merge mysql.com:/home/bar/mysql-work/mysql-5.0.b31081
into  mysql.com:/home/bar/mysql-work/mysql-5.1.b31081


mysql-test/r/ctype_ucs.result:
  Auto merged
mysql-test/r/ctype_utf8.result:
  Auto merged
mysql-test/r/func_regexp.result:
  Auto merged
mysql-test/t/ctype_uca.test:
  Auto merged
mysql-test/t/ctype_ucs.test:
  Auto merged
mysql-test/t/ctype_utf8.test:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
2007-10-16 15:04:04 +05:00
unknown
6c974c673f Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B31440-5.1-opt


sql/item_cmpfunc.cc:
  Auto merged
2007-10-13 09:13:00 +03:00
unknown
387d03f574 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B31440-5.0-opt


sql/item_cmpfunc.cc:
  Auto merged
2007-10-13 09:12:15 +03:00
unknown
39bc53e7c7 Merge magare.gmz:/home/kgeorge/mysql/autopush/B31440-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/B31440-5.1-opt


mysql-test/r/func_regexp.result:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
2007-10-12 14:14:27 +03:00
unknown
f0fcc8c267 Merge gleb.loc:/home/uchum/work/bk/PA/5.0-opt-31471
into  gleb.loc:/home/uchum/work/bk/5.1-opt


mysql-test/r/create.result:
  Auto merged
mysql-test/r/null.result:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
2007-10-11 23:09:08 +05:00
unknown
d43c15b0de Doxygenization of comments. 2007-10-11 13:29:09 -04:00
unknown
76af571717 Bug #31440: 'select 1 regex null' asserts debug server
The special case with NULL as a regular expression
was handled at prepare time. But in this special case
the item was not marked as fixed. This caused an assertion
at execution time.
Fixed my marking the item as fixed even when known to 
return NULL at prepare time.


mysql-test/r/func_regexp.result:
  Bug #31440: test case
mysql-test/t/func_regexp.test:
  Bug #31440: test case
sql/item_cmpfunc.cc:
  Bug #31440: mark the item as fixed even when 
  known to return NULL.
2007-10-11 11:29:26 +03:00
unknown
c866f8015f Fixed bug #31471: decimal_bin_size: Assertion `scale >= 0 &&
precision > 0 && scale <= precision'.

A sign of a resulting item of the IFNULL function was not
updated and the maximal length of this result was calculated
improperly. Correct algorithm was copy&pasted from the IF
function implementation.


sql/item_cmpfunc.cc:
  Fixed bug #31471.
  The Item_func_ifnull::fix_length_and_dec method has been
  modified to update the Item_func_ifnull::unsigned_flag field
  and to take this field into account when calculating the
  Item_func_ifnull::max_length value.
  (See Item_func_if::fix_length_and_dec for reference).
mysql-test/t/null.test:
  Added test case for bug #31471.
mysql-test/r/null.result:
  Added test case for bug #31471.
mysql-test/r/create.result:
  Update test case after the bugfix of bug #31471.
2007-10-10 20:14:29 +05:00
unknown
64b1913382 Bug#31081 server crash in regexp function
Problem: The "regex" library written by Henry Spencer
does not support tricky character sets like UCS2.
Fix: convert tricky character sets to UTF8 before calling
regex functions.


mysql-test/r/ctype_uca.result:
  Adding tests
mysql-test/r/ctype_ucs.result:
  Adding tests
mysql-test/r/ctype_utf8.result:
  Adding tests
mysql-test/r/func_regexp.result:
  Adding tests
mysql-test/t/ctype_uca.test:
  Adding tests
mysql-test/t/ctype_ucs.test:
  Adding tests
mysql-test/t/ctype_utf8.test:
  Adding tests
mysql-test/t/func_regexp.test:
  Adding tests
sql/item_cmpfunc.cc:
  - Adding new method Item_func_regex::regcomp()
  to share more code between fix_fields() and val_int()
  - Adding conversion from ASCII-incompatible charsets like UCS2
  to UTF8, because the "regexp" does not support these charsets
  - Additional optimization: calculate flags for regcomp only
    once in fix_fields, instead of every regcomp()
sql/item_cmpfunc.h:
  Adding prototypes for new members and methods
mysql-test/include/ctype_regex.inc:
  New BitKeeper file ``mysql-test/include/ctype_regex.inc''
  
  Moving common regular expression tests into a separate
  file and uncluding it into func_regexp and into many ctype_xxx tests.
2007-10-05 12:15:11 +05:00
unknown
e4cbbcf8a9 Merge sunlight.local:/local_work/27216-bug-5.0-opt-mysql
into  sunlight.local:/local_work/merge-5.1-opt-mysql


libmysql/libmysql.c:
  Auto merged
mysql-test/r/date_formats.result:
  Auto merged
mysql-test/r/insert_select.result:
  Auto merged
mysql-test/t/insert_select.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
mysql-test/r/type_datetime.result:
  Manually merged
mysql-test/t/type_datetime.test:
  Manually merged
sql/item_cmpfunc.cc:
  Manually merged
sql/item_cmpfunc.h:
  Manually merged
sql/sql_insert.cc:
  Manually merged
2007-09-24 17:23:40 +04:00
unknown
ebaa05efa7 Bug#27216: functions with parameters of different date types may return wrong
type of the result.

There are several functions that accept parameters of different types.
The result field type of such functions was determined based on
the aggregated result type of its arguments. As the DATE and the DATETIME
types are represented by the STRING type, the result field type
of the affected functions was always STRING for DATE/DATETIME arguments.
The affected functions are COALESCE, IF, IFNULL, CASE, LEAST/GREATEST, CASE.

Now the affected functions aggregate the field types of their arguments rather
than their result types and return the result of aggregation as their result
field type.
The cached_field_type member variable is added to the number of classes to
hold the aggregated result field type.
The str_to_date() function's result field type now defaults to the
MYSQL_TYPE_DATETIME.
The agg_field_type() function is added. It aggregates field types with help
of the Field::field_type_merge() function.
The create_table_from_items() function now uses the 
item->tmp_table_field_from_field_type() function to get the proper field
when the item is a function with a STRING result type.


libmysql/libmysql.c:
  Bug#27216: functions with parameters of different date types may return wrong
  type of the result.
  The client library now accepts the NEWDATE type as a string.
sql/item_cmpfunc.cc:
  Bug#27216: functions with parameters of different date types may return wrong
  type of the result.
  Now the fix_length_and_dec functions of the
  Item_func_ifnull,Item_func_if, Item_func_case, Item_func_coalesce
  classes are use agg_field_type function to find out the type of their 
  result field.
sql/item_cmpfunc.h:
  Bug#27216: functions with parameters of different date types may return wrong
  type of the result.
  The cached_field type is added to the Item_func_case, Item_func_if and
  Item_func_coalesce classes.
  The field_type function is added to the Item_func_ifnull, Item_func_if,
  Item_func_coalesce, Item_func_case classes.
sql/item_func.cc:
  Bug#27216: functions with parameters of different date types may return wrong
  type of the result.
  The Item_func_min_max::fix_length_and_dec function now uses the agg_field_type
  function to find out the correct type of the result field.
sql/item_func.h:
  Bug#27216: functions with parameters of different date types may return wrong
  type of the result.
  The cached_field_type variable is added to the Item_func_min_max class.
sql/item_timefunc.cc:
  Bug#27216: functions with parameters of different date types may return wrong
  type of the result.
  The result of the str_to_date function now defaults to the
  DATETIME type.
sql/mysql_priv.h:
  Bug#27216: functions with parameters of different date types may return wrong
  type of the result.
  The prototype of the agg_field_type function is added.
sql/protocol.cc:
  Bug#27216: functions with parameters of different date types may return wrong
  type of the result.
  The Protocol_simple::store function is now used to store fields of NEWDATE type.
sql/sql_insert.cc:
  Bug#27216: functions with parameters of different date types may return wrong
  type of the result.
  The create_table_from_items function now uses the
  tmp_table_field_from_field_type function to get field for items with the
  STRING result type.
mysql-test/r/date_formats.result:
  A test case result corrected after fixing bug#27216.
mysql-test/r/type_datetime.result:
  Added a test case for the bug#27216: functions with parameters of different
  date types may return wrong type of the result.
mysql-test/t/type_datetime.test:
  Added a test case for the bug#27216: functions with parameters of different
  date types may return wrong type of the result.
2007-09-22 11:49:27 +04:00
unknown
09a53f28a7 Fixed a lot of compiler warnings and errors detected by Forte C++ on Solaris
Faster thr_alarm()
Added 'Opened_files' status variable to track calls to my_open()
Don't give warnings when running mysql_install_db
Added option --source-install to mysql_install_db

I had to do the following renames() as used polymorphism didn't work with Forte compiler on 64 bit systems
index_read()      -> index_read_map()
index_read_idx()  -> index_read_idx_map()
index_read_last() -> index_read_last_map()


BUILD/compile-solaris-sparc-forte:
  Updated script to current Solaris installations
  Now we compile by default for 64 bits
client/mysql.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
client/mysql_upgrade.c:
  Fixed compiler warning (on Forte)
client/mysqladmin.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
client/mysqlcheck.c:
  Fixed compiler warning (on Forte)
client/mysqldump.c:
  Fixed compiler warning (on Forte)
client/mysqlslap.c:
  Fixed compiler warning (on Forte)
client/mysqltest.c:
  Fixed compiler warning (on Forte)
client/sql_string.cc:
  Avoid compiler warnings when using C function pointers in C++
configure.in:
  Added detection of mtmalloc and ieeefp.h
extra/replace.c:
  Fixed compiler warning (on Forte)
include/m_ctype.h:
  Added some typedef's to make it easy to use C function pointers in C++
include/my_sys.h:
  Added my_file_total_opened (counter for calls to my_open())
include/myisam.h:
  Fixed compiler warning (on Forte)
libmysql/libmysql.c:
  Fixed compiler warning (on Forte) by adding casts and change types
libmysql/manager.c:
  Fixed compiler warning (on Forte) by adding casts and change types
mysql-test/r/ctype_cp932_binlog_stm.result:
  Updated positions
  (Needed because we didn't before correctly restore collation_database after running stored procedure
mysys/my_fopen.c:
  Count number of opened files
mysys/my_open.c:
  Count number of opened files
mysys/my_static.c:
  Count number of opened files
mysys/thr_alarm.c:
  Optimization to do less alarm() and pthread_sigmask() calls.
  Idea is to remember time for next pending alarm and not reschedule a new alarm if it's after the current one.
  Before we only did this if there was other pending alarms.
  We don't have to use pthread_sigmask() in case of 'USE_ONE_SIGNAL_HAND' as the alarm()
  signal will be blocked for the calling thread anyway and no other thread will have the alarm() signal enabled to call process_alarm()
regex/regcomp.c:
  Fixed compiler warning (on Forte) by adding casts and change types
scripts/mysql_install_db.sh:
  Added option --source-install to allow one to create a mysql database from the source tree without installing MySQL
  Don't give (unnecessary) warnings
server-tools/instance-manager/angel.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
server-tools/instance-manager/thread_registry.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/event_db_repository.cc:
  index_read() -> index_read_map()
sql/event_queue.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/field.cc:
  Fixed compiler warnings about hidden fields
sql/ha_partition.cc:
  Fixed compiler warnings about hidden fields
  index_read() -> index_read_map()
sql/ha_partition.h:
  index_read() -> index_read_map()
sql/handler.cc:
  Added PAGE option to row types (to prepare for future)
  index_read() -> index_read_map()
sql/handler.h:
  Added ROW_TYPE_PAGE (for future)
  Added flag to signal if table was to be created transactionally
  I had to do the following renames() as used polymorphism didn't work with Forte compiler on 64 bit systems
  index_read()      -> index_read_map()
  index_read_idx()  -> index_read_idx_map()
  index_read_last() -> index_read_last_map()
sql/item.cc:
  Fixed indentation
  Renamed local variable to avoid hiding class variable
sql/item_cmpfunc.cc:
  Renamed local variable to avoid hiding class variable
sql/item_cmpfunc.h:
  Removed not used variable
sql/item_func.cc:
  Renamed local variable to avoid hiding class variable
sql/item_strfunc.cc:
  Moved functions from Item_strfunc.cc
sql/item_strfunc.h:
  Move functions to item_strfunc.cc
  Use C function pointer type to avoid compiler warnings (with Forte)
sql/item_subselect.cc:
  index_read() -> index_read_map()
sql/item_xmlfunc.cc:
  Renamed local variable to avoid hiding class variable
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/key.cc:
  Fixed indentation
sql/log.cc:
  Renamed local variable to avoid hiding class variable
sql/log_event.cc:
  Removed call to my_time() when creating class instance of Log_event() as this may have static instances.
  (One can't call my_time() before my_init())
  index_read() -> index_read_map()
  Renamed local variable to avoid hiding class variable
sql/log_event_old.cc:
  Renamed local variable to avoid hiding class variable
sql/mysql_priv.h:
  Made all create_backup_ctx() declarations identical.
  This lifted up a bug where wrong create_backup_ctx() was called in some cases.
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/mysqld.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
  Fixed indentation
  Don't call end_thr_alarm() when calling unireg_abort() as unireg_abort() already calls end_thr_alarm()
  Added variable 'Opened_files' (number of calls to my_open() or my_fopen())
  Don't print 'loose' warnings when using --bootstrap (to avoid warnings when running mysql_install_db)
  Fixed compiler warnings
sql/opt_range.cc:
  index_read() -> index_read_map()
sql/opt_sum.cc:
  index_read() -> index_read_map()
sql/partition_info.cc:
  Renamed local variable to avoid hiding class variable
sql/rpl_filter.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/set_var.cc:
  Renamed local variable to avoid hiding class variable
  Added 'process_key_cache_t' type to avoid compiler warning (on Forte)
sql/set_var.h:
  Added 'process_key_cache_t' type to avoid compiler warning (on Forte)
sql/sp.cc:
  More debugging
  index_read() -> index_read_map()
sql/sp_cache.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/sp_head.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
  Moved 'saved_creation_ctx' higher up to be able to free objects allocated by create_backup_ctx()
sql/sql_acl.cc:
  index_read() -> index_read_map()
sql/sql_class.cc:
  Renamed local variable to avoid hiding class variable
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/sql_class.h:
  Renamed local variable to avoid hiding class variable
sql/sql_db.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
sql/sql_delete.cc:
  Renamed local variable to avoid hiding class variable
sql/sql_handler.cc:
  index_read() -> index_read_map()
sql/sql_help.cc:
  index_read() -> index_read_map()
sql/sql_insert.cc:
  index_read() -> index_read_map()
  Renamed local variable to avoid hiding class variable
sql/sql_lex.cc:
  Renamed local variable to avoid hiding class variable
sql/sql_plugin.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
  index_read() -> index_read_map()
  Don't give warnings about not used plugins if we are using --warnings=0
sql/sql_select.cc:
  index_read() -> index_read_map()
sql-common/client.c:
  Fixed compiler warning (on Forte)
sql-common/my_time.c:
  Removed never accessed code
  Fixed compiler warning (on Forte)
sql/sql_servers.cc:
  index_read() -> index_read_map()
sql/sql_show.cc:
  Added TRANSACTIONAL to SHOW CREATE
  Fixed ROW_TYPE_PAGE
sql/sql_string.cc:
  Avoid compiler warnings when using C function pointers in C++
sql/sql_table.cc:
  Set create_info->transactional if we used TRANSACTIONAL=1
sql/sql_udf.cc:
  index_read() -> index_read_map()
sql/sql_yacc.yy:
  Added TRANSACTIONAL=0|1 to CREATE (for future)
  Added row type PAGE (was only partionally handled before)
sql/strfunc.cc:
  Avoid compiler warnings when using C function pointers in C++
sql/table.cc:
  More DBUG statements
  Declare all create_backup_ctx() functions identically
  Remember if table was created with TRANSACTIONAL flag or not (future safe)
  Renamed local variable to avoid hiding class variable
sql/table.h:
  Remember if table was created with TRANSACTIONAL=1
sql/tztime.cc:
  index_read() -> index_read_map()
sql-common/pack.c:
  Fixed compiler warning (on Forte)
storage/archive/archive_reader.c:
  Fixed compiler warning (on Forte)
storage/archive/azio.c:
  Fixed compiler warning (on Forte)
storage/blackhole/ha_blackhole.cc:
  index_read() -> index_read_map()
storage/blackhole/ha_blackhole.h:
  index_read() -> index_read_map()
storage/csv/ha_tina.cc:
  Declare functions sent to C code with extern "C" to avoid compiler warnings (on Forte)
storage/example/ha_example.cc:
  index_read() -> index_read_map()
storage/example/ha_example.h:
  index_read() -> index_read_map()
storage/heap/ha_heap.cc:
  index_read() -> index_read_map()
storage/heap/ha_heap.h:
  index_read() -> index_read_map()
storage/heap/hp_test1.c:
  Fixed compiler warning (on Forte)
storage/heap/hp_test2.c:
  Fixed compiler warning (on Forte)
storage/myisam/ft_boolean_search.c:
  Fixed compiler warning (on Forte)
storage/myisam/ft_nlq_search.c:
  Fixed compiler warning (on Forte)
storage/myisam/ft_parser.c:
  Fixed compiler warning (on Forte)
storage/myisam/ft_stopwords.c:
  Fixed compiler warning (on Forte)
storage/myisam/ha_myisam.cc:
  index_read() -> index_read_map()
storage/myisam/ha_myisam.h:
  index_read() -> index_read_map()
storage/myisam/mi_check.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_delete.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_dynrec.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_extra.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_key.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_keycache.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_locking.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_log.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_open.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_packrec.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_page.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_rkey.c:
  Added comment
storage/myisam/mi_search.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_statrec.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_test1.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_test2.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_test3.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_update.c:
  Fixed compiler warning (on Forte)
storage/myisam/mi_write.c:
  Fixed compiler warning (on Forte)
storage/myisam/myisamdef.h:
  Fixed that file_read/file_write returns type size_t
  Changed some functions to use uchar * as argument/return value instead of char*
  This fixed some compiler warnings on Forte
storage/myisam/myisamlog.c:
  Fixed compiler warning (on Forte)
storage/myisam/myisampack.c:
  Fixed compiler warning (on Forte)
storage/myisam/rt_test.c:
  Fixed compiler warning (on Forte)
storage/myisam/sort.c:
  Fixed compiler warning (on Forte) by adding casts or changing variables to uchar*
storage/myisam/sp_test.c:
  Fixed compiler warning (on Forte) by adding casts or changing variables to uchar*
storage/myisammrg/ha_myisammrg.cc:
  index_read() -> index_read_map()
storage/myisammrg/ha_myisammrg.h:
  index_read() -> index_read_map()
storage/myisammrg/myrg_create.c:
  Fixed compiler warning (on Forte) by adding casts or changing variable types
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp:
  Tdummy -> align  (as in other part of cluster code)
storage/ndb/src/kernel/vm/DynArr256.cpp:
  Removed not used variable
storage/ndb/src/ndbapi/Ndb.cpp:
  Removed not used variable
strings/strtod.c:
  Include ieeefp.h to avoid compiler warning
tests/bug25714.c:
  Fixed compiler warning
tests/mysql_client_test.c:
  Remove not used variable
  Fixed indentation
  Removed never reached code
  Fixed compiler warning (on Forte) by adding casts or changing variable types
vio/viosocket.c:
  Fixed compiler warning (on Forte) by adding casts or changing variable types
2007-08-13 16:11:25 +03:00
unknown
4a07ed48dd Merge magare.gmz:/home/kgeorge/mysql/work/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/merge-5.0-5.1-opt


mysql-test/r/type_time.result:
  Auto merged
sql/field.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
BitKeeper/deleted/.del-index_merge.result:
  Auto merged
mysql-test/include/index_merge1.inc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
storage/heap/ha_heap.cc:
  Auto merged
storage/heap/ha_heap.h:
  Auto merged
2007-07-18 15:56:29 +03:00
unknown
56a65d7ad0 item_cmpfunc.cc:
A typo fixed.


sql/item_cmpfunc.cc:
  A typo fixed.
2007-07-16 01:03:58 +04:00
unknown
3e925554ec item_cmpfunc.cc:
Fixed compiler warning.


sql/item_cmpfunc.cc:
  Fixed compiler warning.
2007-07-16 00:59:47 +04:00
unknown
16135c7dca item_cmpfunc.cc:
A comment changed.


sql/item_cmpfunc.cc:
  A comment changed.
2007-07-15 23:40:57 +04:00
unknown
6e078ff543 Extended fix for the bug#29555.
The get_time_value function is added. It is used to obtain TIME values both
from items the can return time as an integer and from items that can return
time only as a string.
The Arg_comparator::compare_datetime function now uses pointer to a getter
function to obtain values to compare. Now this function is also used for
comparison of TIME values.
The get_value_func variable is added to the Arg_comparator class.
It points to a getter function for the DATE/DATETIME/TIME comparator.


mysql-test/t/type_time.test:
  Extended test case for the bug#29555.
mysql-test/r/type_time.result:
  Extended test case for the bug#29555.
sql/item_cmpfunc.cc:
  Extended fix for the bug#29555.
  The get_time_value function is added. It is used to obtain TIME values both
  from items the can return time as an integer and from items that can return
  time only as a string.
  The Arg_comparator::compare_datetime function now uses pointer to a getter
  function to obtain values to compare. Now this function is also used for
  comparison of TIME values.
sql/item_cmpfunc.h:
  Extended fix for the bug#29555.
  The get_value_func variable is added to the Arg_comparator class.
  It points to a getter function for the DATE/DATETIME/TIME comparator.
2007-07-15 21:51:36 +04:00