Commit graph

1183 commits

Author SHA1 Message Date
unknown
39bf2b9662 Fixed bug #29104: assertion abort for grouping queries using views.
The abort happened when a query contained a conjunctive predicate
of the form 'view column = constant' in the WHERE condition and 
the grouping list also contained a reference to a view column yet
a different one.

Removed the failing assertion as invalid in a general case.

Also fixed a bug that prevented applying some optimization for grouping
queries using views. If the WHERE condition of such a query contains
a conjunctive condition of the form 'view column = constant' and
this view column is used in the grouping list then grouping by this
column can be eliminated. The bug blocked performing this elimination.


mysql-test/r/view.result:
  Added a test case for bug #29104.
mysql-test/t/view.test:
  Added a test case for bug #29104.
sql/item.cc:
  Fixed bug #29104: assertion abort for grouping queries using views.
  The abort happened when a query contained a conjunctive predicate
  of the form 'view column = constant' in the WHERE condition and 
  the grouping list also contained a reference to a view column yet
  a different one.
  
  Removed the failing assertion as invalid in a general case.
  
  Also fixed a bug that prevented applying some optimization for grouping
  queries using views. If the WHERE condition of such a query contains
  a conjunctive condition of the form 'view column = constant' and
  this view column is used in the grouping list then grouping by this
  column can be eliminated. The bug blocked performing this elimination.
  This bug was in the function Item_field::eq while the failing
  assertion was in the function Item_direct_view_ref::eq.
2007-06-20 12:43:14 -07:00
unknown
e855bf33b3 Fixed bug #28898.
For a join query with GROUP BY and/or ORDER BY and a view reference
in the FROM list the metadata erroneously showed empty table aliases
and database names for the view columns.



sql/item.h:
  Fixed bug #28898.
  Body of Item_ref::get_tmp_table_item method has been moved
  to item.cc file.
mysql-test/t/metadata.test:
  Updated test case for bug #28898.
sql/item.cc:
  Fixed bug #28898.
  The Item_ref::get_tmp_table_item method has been modified
  to copy pointers to the table alias and database name to the new
  Item_field object created for a field stored in the temporary
  table.
mysql-test/r/metadata.result:
  Updated test case for bug #28898.
sql/sql_select.cc:
  Fixed bug #28898.
  The change_to_use_tmp_fields function has been modified to
  to copy pointers to the table alias and database name from
  the Item_ref objects to the new Item_field objects created
  for fields stored in the temporary table.
2007-06-20 12:25:07 +05:00
unknown
0662a9b78a Merge bk@192.168.21.1:mysql-5.1
into  mysql.com:/d2/hf/mrg/mysql-5.1-opt


client/mysqltest.c:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/include/mix1.inc:
  merging
mysql-test/r/innodb_mysql.result:
  merging
sql/sql_select.cc:
  merging
2007-06-14 16:42:43 +05:00
unknown
6f168d1255 Merge bk@192.168.21.1:mysql-5.0
into  mysql.com:/d2/hf/mrg/mysql-5.0-opt


client/mysqltest.c:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/r/innodb_mysql.result:
  merging
mysql-test/t/innodb_mysql.test:
  merging
sql/sql_select.cc:
  merging
2007-06-14 16:41:10 +05:00
unknown
2b42067f1a error_simulation.result, item.cc, subselect.result, error_simulation.test:
Post merge fix.


mysql-test/t/error_simulation.test:
  Post merge fix.
mysql-test/r/subselect.result:
  Post merge fix.
mysql-test/r/error_simulation.result:
  Post merge fix.
sql/item.cc:
  Post merge fix.
2007-06-11 17:02:16 +04:00
unknown
237a1d22f1 Merge moonbone.local:/mnt/gentoo64/work/test-5.0-opt-mysql
into  moonbone.local:/mnt/gentoo64/work/test-5.1-opt-mysql


mysql-test/r/gis.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/t/gis.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
mysql-test/include/mix1.inc:
  Manually merged
mysql-test/r/innodb_mysql.result:
  Manually merged
mysql-test/r/type_datetime.result:
  Manually merged
mysql-test/t/type_datetime.test:
  Manually merged
sql/field.h:
  Manually merged
sql/sql_select.cc:
  Manually merged
sql/sql_yacc.yy:
  Manually merged
tests/mysql_client_test.c:
  Manually merged
2007-06-11 00:16:00 +04:00
unknown
18310fabf4 Bug#28763: Selecting geometry fields in UNION caused server crash.
This bug was introduced by the fix for the bug#27300. In this fix a section
of code was added to the Item::tmp_table_field_from_field_type method.
This section intended to create Field_geom fields for the Item_geometry_func
class and its descendants. In order to get the geometry type of the current
item it casted "this" to the Item_geometry_func* type. But the
Item::tmp_table_field_from_field_type method is also used for creation of
fields for UNION and in this case this method is called for an object of the
Item_type_holder class and the cast to the Item_geometry_func* type causes 
a server crash.

Now the Item::tmp_table_field_from_field_type method correctly works when it's
called for both the Item_type_holder and the Item_geometry_func classes.
The new geometry_type variable is added to the Item_type_holder class.
The new method called get_geometry_type is added to the Item_field
and the Field classes. It returns geometry type from the field for the
Item_field and the Field_geom classes and fails an assert for other Field
descendants.


sql/field.h:
  Bug#28763: Selecting geometry fields in UNION caused server crash.
  The new method called get_geometry_type is added to the Field class.
  It returns geometry type of the field for the Field_geom class
  and fails an assert for other Field descendants.
sql/item.cc:
  Bug#28763: Selecting geometry fields in UNION caused server crash.
  Now the Item::tmp_table_field_from_field_type method correctly works when it's
  called for both the Item_type_holder and the Item_geometry_func classes.
mysql-test/r/gis.result:
  Added a test case for the bug#28763: Selecting geometry fields in UNION caused server crash.
mysql-test/t/gis.test:
  Added a test case for the bug#28763: Selecting geometry fields in UNION caused server crash.
sql/item.h:
  Bug#28763: Selecting geometry fields in UNION caused server crash.
  The new method called get_geometry_type is added to the Item_field class.
  It returns geometry type from the field.
  The new geometry_type variable is added to the Item_type_holder class.
2007-06-08 00:33:03 +04:00
unknown
38ed1be3ec Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/51
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/jun05/51


client/mysqldump.c:
  Auto merged
include/m_string.h:
  Auto merged
include/mysql_com.h:
  Auto merged
include/violite.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
mysql-test/include/mix1.inc:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/t/mysqltest.test:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
mysys/my_init.c:
  Auto merged
server-tools/instance-manager/mysql_connection.cc:
  Auto merged
sql/field.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  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/net_serv.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_connect.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql-common/client.c:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
strings/ctype-mb.c:
  Auto merged
strings/ctype-ucs2.c:
  Auto merged
strings/strtod.c:
  Auto merged
vio/vio_priv.h:
  Auto merged
vio/viosocket.c:
  Auto merged
client/mysqltest.c:
  SCCS merged
include/my_global.h:
  SCCS merged
sql/field.h:
  SCCS merged
sql/sql_table.cc:
  Manual merge
strings/ctype-bin.c:
  Manual merge
2007-06-05 17:51:30 +02:00
unknown
7be03ef01f Merge mysql.com:/home/ram/work/mysql-5.0-maint
into  mysql.com:/home/ram/work/b28464.new/b28464.new.5.0


sql/item.h:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/item.cc:
  SCCS merged
2007-05-24 20:21:04 +05:00
unknown
a27fd67b51 Merge mysql.com:/home/ram/work/b28464.new/b28464.new.5.0
into  mysql.com:/home/ram/work/b28464.new/b28464.new.5.1


mysql-test/t/limit.test:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/item.cc:
  SCCS merged
2007-05-24 18:42:38 +05:00
unknown
6e84990797 Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1
into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1-marvel


BitKeeper/etc/ignore:
  auto-union
client/mysql.cc:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqltest.c:
  Auto merged
extra/comp_err.c:
  Auto merged
include/decimal.h:
  Auto merged
include/my_getopt.h:
  Auto merged
include/my_global.h:
  Auto merged
include/my_sys.h:
  Auto merged
include/mysql.h:
  Auto merged
mysys/array.c:
  Auto merged
mysys/hash.c:
  Auto merged
mysys/typelib.c:
  Auto merged
sql/derror.cc:
  Auto merged
sql/event_data_objects.cc:
  Auto merged
sql/event_queue.cc:
  Auto merged
sql/field.cc:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/ha_ndbcluster.h:
  Auto merged
sql/ha_ndbcluster_binlog.cc:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/ha_partition.h:
  Auto merged
sql/handler.cc:
  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_subselect.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/item_timefunc.h:
  Auto merged
sql/log.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/my_decimal.cc:
  Auto merged
sql/my_decimal.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/opt_range.h:
  Auto merged
sql/opt_sum.cc:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/protocol.h:
  Auto merged
sql/rpl_utility.h:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sp_head.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_connect.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_load.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_partition.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_select.h:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_trigger.cc:
  Auto merged
sql/sql_union.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/structs.h:
  Auto merged
sql/table.h:
  Auto merged
sql/tztime.cc:
  Auto merged
sql/unireg.cc:
  Auto merged
storage/example/ha_example.cc:
  Auto merged
storage/federated/ha_federated.cc:
  Auto merged
storage/heap/ha_heap.cc:
  Auto merged
storage/innobase/handler/ha_innodb.h:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/sort.c:
  Auto merged
storage/myisammrg/ha_myisammrg.cc:
  Auto merged
storage/ndb/tools/restore/consumer_restore.cpp:
  Auto merged
strings/decimal.c:
  Auto merged
strings/strtod.c:
  Auto merged
include/hash.h:
  Manual merge with 5.1 main tree.
mysys/my_getopt.c:
  Manual merge with 5.1 main tree.
sql/field.h:
  Manual merge with 5.1 main tree.
sql/ha_ndbcluster.cc:
  Manual merge with 5.1 main tree.
sql/item_cmpfunc.h:
  Manual merge with 5.1 main tree.
sql/item_create.cc:
  Manual merge with 5.1 main tree.
sql/item_func.h:
  Manual merge with 5.1 main tree.
sql/key.cc:
  Manual merge with 5.1 main tree.
sql/lock.cc:
  Manual merge with 5.1 main tree.
sql/mysqld.cc:
  Manual merge with 5.1 main tree.
sql/set_var.cc:
  Manual merge with 5.1 main tree.
sql/set_var.h:
  Manual merge with 5.1 main tree.
sql/sql_base.cc:
  Manual merge with 5.1 main tree.
sql/sql_handler.cc:
  Manual merge with 5.1 main tree.
sql/sql_insert.cc:
  Manual merge with 5.1 main tree.
sql/sql_plugin.cc:
  Manual merge with 5.1 main tree.
sql/sql_table.cc:
  Manual merge with 5.1 main tree.
sql/sql_yacc.yy:
  Manual merge with 5.1 main tree.
sql/table.cc:
  Manual merge with 5.1 main tree.
storage/innobase/handler/ha_innodb.cc:
  Manual merge with 5.1 main tree.
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
  Manual merge with 5.1 main tree.
storage/ndb/tools/restore/restore_main.cpp:
  Manual merge with 5.1 main tree.
2007-05-24 13:24:36 +03:00
unknown
e6f1c2dd14 Merge mysql.com:/home/ram/work/mysql-5.0-maint
into  mysql.com:/home/ram/work/b28509/b28509.5.0


mysql-test/r/ps.result:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
sql/item.cc:
  Auto merged
2007-05-23 13:48:31 +05:00
unknown
edbd365e30 Merge mysql.com:/home/ram/work/b28509/b28509.5.0
into  mysql.com:/home/ram/work/b28509/b28509.5.1


mysql-test/r/ps.result:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
sql/item.cc:
  Auto merged
2007-05-23 13:47:34 +05:00
unknown
221e23ad72 Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/50
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/50


configure.in:
  Auto merged
mysql-test/r/strict.result:
  Auto merged
mysql-test/r/type_datetime.result:
  Auto merged
mysql-test/t/type_datetime.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
2007-05-21 20:50:08 +02:00
unknown
f0abfddf07 Merge bk@192.168.21.1:mysql-5.1
into  mysql.com:/d2/hf/mrg/mysql-5.1-opt


mysql-test/include/mix1.inc:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
2007-05-18 20:04:01 +05:00
unknown
caf045dbeb Merge bk@192.168.21.1:mysql-5.0
into  mysql.com:/d2/hf/mrg/mysql-5.0-opt


mysql-test/r/ps.result:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
sql/item.cc:
  Auto merged
2007-05-18 20:02:27 +05:00
unknown
e0d006f348 Merge mysql.com:/d2/hf/mrg/mysql-5.0-opt
into  mysql.com:/d2/hf/mrg/mysql-5.1-opt


mysql-test/r/func_gconcat.result:
  Auto merged
mysql-test/include/mix1.inc:
  Auto merged
mysql-test/r/func_group.result:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/t/func_gconcat.test:
  Auto merged
mysql-test/t/func_group.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_union.cc:
  Auto merged
mysql-test/r/ps.result:
  merging
mysql-test/r/subselect.result:
  merging
mysql-test/r/type_datetime.result:
  SCCS merged
mysql-test/t/ps.test:
  merging
mysql-test/t/subselect.test:
  merging
mysql-test/t/type_datetime.test:
  merging
sql/opt_sum.cc:
  SCCS merged
2007-05-18 20:00:49 +05:00
unknown
6249d57d4b Fox for bug #28509: strange behaviour: passing a decimal value to PS
Set parameter's type to Item::DECIMAL_ITEM assigning a decimal value.


mysql-test/r/ps.result:
  Fox for bug #28509: strange behaviour: passing a decimal value to PS
    - test result.
mysql-test/t/ps.test:
  Fox for bug #28509: strange behaviour: passing a decimal value to PS
    - test case.
sql/item.cc:
  Fox for bug #28509: strange behaviour: passing a decimal value to PS
    - set Item_param::item_type to Item::DECIMAL_ITEM in case of DECIMAL_RESULT variable.
    - removed redundant item_result_type assignments as it's set before.
2007-05-18 18:16:51 +05:00
unknown
5b3b80b44f Fix for bug #28464: a string argument to 'limit ?' PS - replication fails
Problem: we may get syntactically incorrect queries in the binary log 
if we use a string value user variable executing a PS which 
contains '... limit ?' clause, e.g.
prepare s from "select 1 limit ?"; 
set @a='qwe'; execute s using @a;
  
Fix: raise an error in such cases.


mysql-test/r/limit.result:
  Fix for bug #28464: a string argument to 'limit ?' PS - replication fails
    - test result
mysql-test/t/limit.test:
  Fix for bug #28464: a string argument to 'limit ?' PS - replication fails
    - test case
sql/item.cc:
  Fix for bug #28464: a string argument to 'limit ?' PS - replication fails
    - if Item_param::strict_type is set, check given and required types,
      return an error if not equal.
sql/item.h:
  Fix for bug #28464: a string argument to 'limit ?' PS - replication fails
    - bool strict_type introduced, which indicates that a parameter value must be of 
      the required_result_type type.
    - set_strict_type() function introduced to set required type.
sql/sql_yacc.yy:
  Fix for bug #28464: a string argument to 'limit ?' PS - replication fails
    - as we accept only INTs in the 'limit' clause set parameter's required type.
2007-05-18 12:08:07 +05:00
unknown
ce5f0d1bc3 Merge siva.hindu.god:/home/tsmith/m/bk/50
into  siva.hindu.god:/home/tsmith/m/bk/maint/50


mysql-test/r/type_datetime.result:
  Auto merged
mysql-test/t/outfile.test:
  Auto merged
mysql-test/t/type_datetime.test:
  Auto merged
sql/field.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/my_decimal.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
2007-05-17 14:17:50 -06:00
unknown
dd1a118000 Fixed bug #28337: wrong results for grouping queries with correlated
subqueries in WHERE conditions.
This bug was introduced by the patch for bug 27321.


mysql-test/r/subselect.result:
  Added a test case for bug #28337.
mysql-test/t/subselect.test:
  Added a test case for bug #28337.
sql/item.cc:
  Fixed bug #28337: wrong results for grouping queries with correlated
  subqueries in WHERE conditions.
  This bug was introduced by the patch for bug 27321.
  
  Now in the Item_field::fix_outer_field function we create an Item_outer_ref
  object for an outer reference only if it is used in the SELECT list or
  in the HAVING clause of the subquery against which the reference is resolved.
2007-05-16 23:42:10 -07:00
unknown
b5e4f54a53 Backport of TIME->MYSQL_TIME / Y2K fixset
Made year 2000 handling more uniform
Removed year 2000 handling out from calc_days()
The above removes some bugs in date/datetimes with year between 0 and 200
Now we get a note when we insert a datetime value into a date column
For default values to CREATE, don't give errors for warning level NOTE
Fixed some compiler failures
Added library ws2_32 for windows compilation (needed if we want to compile with IOCP support)
Removed duplicate typedef TIME and replaced it with MYSQL_TIME

Better (more complete) fix for: Bug#21103 "DATE column not compared as DATE"
Fixed properly Bug#18997 "DATE_ADD and DATE_SUB perform year2K autoconversion magic on 4-digit year value"
Fixed Bug#23093 "Implicit conversion of 9912101 to date does not match cast(9912101 as date)"
 


include/my_time.h:
  Removed not used define YY_MAGIC_BELOW
  Added prototype for year_2000_handling()
mysql-test/r/date_formats.result:
  Updated results (fixed bug in date_format() with year < 99
mysql-test/r/func_sapdb.result:
  Added more testing of make_date()
mysql-test/r/ps_2myisam.result:
  Now we get a note when we insert a datetime value into a date column
mysql-test/r/ps_3innodb.result:
  Now we get a note when we insert a datetime value into a date column
mysql-test/r/ps_4heap.result:
  Now we get a note when we insert a datetime value into a date column
mysql-test/r/ps_5merge.result:
  Now we get a note when we insert a datetime value into a date column
mysql-test/r/ps_7ndb.result:
  Now we get a note when we insert a datetime value into a date column
mysql-test/r/strict.result:
  zero-year in str_to_date() throws warning in strict
mysql-test/r/type_date.result:
  Added test for date conversions
mysql-test/r/type_datetime.result:
  Added testcase for datetime to date conversion.
mysql-test/t/date_formats.test:
  Added testing of dates < 200
mysql-test/t/func_sapdb.test:
  More testing of makedate()
mysql-test/t/type_date.test:
  Added test for date conversions
mysql-test/t/type_datetime.test:
  Added testcase for datetime to date conversion
sql/field.cc:
  Give note if we insert a datetime value in a date field
  Don't give notes if we are doing internal test conversions (like from convert_constant_item())
  More documentation (store functions can now return '3' to inform that the function did return a NOTE (not warning or error))
  Revert some changes in Field_newdate::store() to get more optimal code
  Field::set_warning() will now ignore notes if CHECK_FIELD_IGNORE is set.
  New parameters to make_truncated_value_warning()
sql/field.h:
  Give note if we insert a datetime value in a date field
  Don't give notes if we are doing internal test conversions (like from convert_constant_item())
  More documentation (store functions can now return '3' to inform that the function did return a NOTE (not warning or error))
  Revert some changes in Field_newdate::store() to get more optimal code
  Field::set_warning() will now ignore notes if CHECK_FIELD_IGNORE is set.
  New parameters to make_truncated_value_warning()
sql/item.cc:
  Give note if we insert a datetime value in a date field
  Don't give notes if we are doing internal test conversions (like from convert_constant_item())
  More documentation (store functions can now return '3' to inform that the function did return a NOTE (not warning or error))
  Revert some changes in Field_newdate::store() to get more optimal code
  Field::set_warning() will now ignore notes if CHECK_FIELD_IGNORE is set.
  New parameters to make_truncated_value_warning()
sql/item.h:
  TIME -> MYSQL_TIME
sql/item_cmpfunc.cc:
  Don't print notes in convert_constant_item()
sql/item_func.h:
  TIME -> MYSQL_TIME
sql/item_timefunc.cc:
  New parameters to make_truncated_value_warning()
  Moved year 2000 handling out from calc_days()
sql/item_timefunc.h:
  TIME -> MYSQL_TIME
sql/my_decimal.cc:
  TIME -> MYSQL_TIME
sql/my_decimal.h:
  TIME -> MYSQL_TIME
sql/mysql_priv.h:
  Added error level to make_truncated_value_warning()
sql/protocol.cc:
  TIME -> MYSQL_TIME
sql/protocol.h:
  TIME -> MYSQL_TIME
sql/sp.cc:
  TIME -> MYSQL_TIME
sql/sql_base.cc:
  Make testing of result value of save_in_field() uniform
sql/sql_class.h:
  TIME -> MYSQL_TIME
sql/sql_show.cc:
  TIME -> MYSQL_TIME
sql/structs.h:
  TIME -> MYSQL_TIME
sql/time.cc:
  Added error level to make_truncated_value_warning()
sql/tztime.cc:
  TIME -> MYSQL_TIME
sql/tztime.h:
  TIME -> MYSQL_TIME
sql/unireg.cc:
  For default values to CREATE, don't give errors for warning level NOTE
  (Fixed failed CREATE when we give a datetime value to a date field)
sql-common/my_time.c:
  Added year_2000_handling()
  Removed year 2000 handling from calc_daynr()
2007-05-16 10:44:59 +02:00
unknown
fc7ef4be71 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  vajra.(none):/opt/local/work/mysql-5.1-runtime


mysql-test/include/mix1.inc:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/ps_1general.result:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
mysql-test/t/ps_1general.test:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_ndbcluster_binlog.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_partition.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.h:
  Auto merged
sql/sql_insert.cc:
  SCCS merged
2007-05-15 17:54:11 +04:00
unknown
655efae884 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  vajra.(none):/opt/local/work/mysql-5.0-runtime


sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2007-05-15 13:56:09 +04:00
unknown
f252f9248a WL#3817: Simplify string / memory area types and make things more consistent (first part)
The following type conversions was done:

- Changed byte to uchar
- Changed gptr to uchar*
- Change my_string to char *
- Change my_size_t to size_t
- Change size_s to size_t

Removed declaration of byte, gptr, my_string, my_size_t and size_s. 

Following function parameter changes was done:
- All string functions in mysys/strings was changed to use size_t
  instead of uint for string lengths.
- All read()/write() functions changed to use size_t (including vio).
- All protocoll functions changed to use size_t instead of uint
- Functions that used a pointer to a string length was changed to use size_t*
- Changed malloc(), free() and related functions from using gptr to use void *
  as this requires fewer casts in the code and is more in line with how the
  standard functions work.
- Added extra length argument to dirname_part() to return the length of the
  created string.
- Changed (at least) following functions to take uchar* as argument:
  - db_dump()
  - my_net_write()
  - net_write_command()
  - net_store_data()
  - DBUG_DUMP()
  - decimal2bin() & bin2decimal()
- Changed my_compress() and my_uncompress() to use size_t. Changed one
  argument to my_uncompress() from a pointer to a value as we only return
  one value (makes function easier to use).
- Changed type of 'pack_data' argument to packfrm() to avoid casts.
- Changed in readfrm() and writefrom(), ha_discover and handler::discover()
  the type for argument 'frmdata' to uchar** to avoid casts.
- Changed most Field functions to use uchar* instead of char* (reduced a lot of
  casts).
- Changed field->val_xxx(xxx, new_ptr) to take const pointers.

Other changes:
- Removed a lot of not needed casts
- Added a few new cast required by other changes
- Added some cast to my_multi_malloc() arguments for safety (as string lengths
  needs to be uint, not size_t).
- Fixed all calls to hash-get-key functions to use size_t*. (Needed to be done
  explicitely as this conflict was often hided by casting the function to
  hash_get_key).
- Changed some buffers to memory regions to uchar* to avoid casts.
- Changed some string lengths from uint to size_t.
- Changed field->ptr to be uchar* instead of char*. This allowed us to
  get rid of a lot of casts.
- Some changes from true -> TRUE, false -> FALSE, unsigned char -> uchar
- Include zlib.h in some files as we needed declaration of crc32()
- Changed MY_FILE_ERROR to be (size_t) -1.
- Changed many variables to hold the result of my_read() / my_write() to be
  size_t. This was needed to properly detect errors (which are
  returned as (size_t) -1).
- Removed some very old VMS code
- Changed packfrm()/unpackfrm() to not be depending on uint size
  (portability fix)
- Removed windows specific code to restore cursor position as this
  causes slowdown on windows and we should not mix read() and pread()
  calls anyway as this is not thread safe. Updated function comment to
  reflect this. Changed function that depended on original behavior of
  my_pwrite() to itself restore the cursor position (one such case).
- Added some missing checking of return value of malloc().
- Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid 'long' overflow.
- Changed type of table_def::m_size from my_size_t to ulong to reflect that
  m_size is the number of elements in the array, not a string/memory
  length.
- Moved THD::max_row_length() to table.cc (as it's not depending on THD).
  Inlined max_row_length_blob() into this function.
- More function comments
- Fixed some compiler warnings when compiled without partitions.
- Removed setting of LEX_STRING() arguments in declaration (portability fix).
- Some trivial indentation/variable name changes.
- Some trivial code simplifications:
  - Replaced some calls to alloc_root + memcpy to use
    strmake_root()/strdup_root().
  - Changed some calls from memdup() to strmake() (Safety fix)
  - Simpler loops in client-simple.c


BitKeeper/etc/ignore:
  added libmysqld/ha_ndbcluster_cond.cc
  ---
  added debian/defs.mk debian/control
client/completion_hash.cc:
  Remove not needed casts
client/my_readline.h:
  Remove some old types
client/mysql.cc:
  Simplify types
client/mysql_upgrade.c:
  Remove some old types
  Update call to dirname_part
client/mysqladmin.cc:
  Remove some old types
client/mysqlbinlog.cc:
  Remove some old types
  Change some buffers to be uchar to avoid casts
client/mysqlcheck.c:
  Remove some old types
client/mysqldump.c:
  Remove some old types
  Remove some not needed casts
  Change some string lengths to size_t
client/mysqlimport.c:
  Remove some old types
client/mysqlshow.c:
  Remove some old types
client/mysqlslap.c:
  Remove some old types
  Remove some not needed casts
client/mysqltest.c:
  Removed some old types
  Removed some not needed casts
  Updated hash-get-key function arguments
  Updated parameters to dirname_part()
client/readline.cc:
  Removed some old types
  Removed some not needed casts
  Changed some string lengths to use size_t
client/sql_string.cc:
  Removed some old types
dbug/dbug.c:
  Removed some old types
  Changed some string lengths to use size_t
  Changed some prototypes to avoid casts
extra/comp_err.c:
  Removed some old types
extra/innochecksum.c:
  Removed some old types
extra/my_print_defaults.c:
  Removed some old types
extra/mysql_waitpid.c:
  Removed some old types
extra/perror.c:
  Removed some old types
extra/replace.c:
  Removed some old types
  Updated parameters to dirname_part()
extra/resolve_stack_dump.c:
  Removed some old types
extra/resolveip.c:
  Removed some old types
include/config-win.h:
  Removed some old types
include/decimal.h:
  Changed binary strings to be uchar* instead of char*
include/ft_global.h:
  Removed some old types
include/hash.h:
  Removed some old types
include/heap.h:
  Removed some old types
  Changed records_under_level to be 'ulong' instead of 'uint' to clarify usage of variable
include/keycache.h:
  Removed some old types
include/m_ctype.h:
  Removed some old types
  Changed some string lengths to use size_t
  Changed character length functions to return uint
  unsigned char -> uchar
include/m_string.h:
  Removed some old types
  Changed some string lengths to use size_t
include/my_alloc.h:
  Changed some string lengths to use size_t
include/my_base.h:
  Removed some old types
include/my_dbug.h:
  Removed some old types
  Changed some string lengths to use size_t
  Changed db_dump() to take uchar * as argument for memory to reduce number of casts in usage
include/my_getopt.h:
  Removed some old types
include/my_global.h:
  Removed old types:
  my_size_t -> size_t
  byte -> uchar
  gptr -> uchar *
include/my_list.h:
  Removed some old types
include/my_nosys.h:
  Removed some old types
include/my_pthread.h:
  Removed some old types
include/my_sys.h:
  Removed some old types
  Changed MY_FILE_ERROR to be in line with new definitions of my_write()/my_read()
  Changed some string lengths to use size_t
  my_malloc() / my_free() now uses void *
  Updated parameters to dirname_part() & my_uncompress()
include/my_tree.h:
  Removed some old types
include/my_trie.h:
  Removed some old types
include/my_user.h:
  Changed some string lengths to use size_t
include/my_vle.h:
  Removed some old types
include/my_xml.h:
  Removed some old types
  Changed some string lengths to use size_t
include/myisam.h:
  Removed some old types
include/myisammrg.h:
  Removed some old types
include/mysql.h:
  Removed some old types
  Changed byte streams to use uchar* instead of char*
include/mysql_com.h:
  Removed some old types
  Changed some string lengths to use size_t
  Changed some buffers to be uchar* to avoid casts
include/queues.h:
  Removed some old types
include/sql_common.h:
  Removed some old types
include/sslopt-longopts.h:
  Removed some old types
include/violite.h:
  Removed some old types
  Changed some string lengths to use size_t
libmysql/client_settings.h:
  Removed some old types
libmysql/libmysql.c:
  Removed some old types
libmysql/manager.c:
  Removed some old types
libmysqld/emb_qcache.cc:
  Removed some old types
libmysqld/emb_qcache.h:
  Removed some old types
libmysqld/lib_sql.cc:
  Removed some old types
  Removed some not needed casts
  Changed some buffers to be uchar* to avoid casts
  true -> TRUE, false -> FALSE
mysys/array.c:
  Removed some old types
mysys/charset.c:
  Changed some string lengths to use size_t
mysys/checksum.c:
  Include zlib to get definition for crc32
  Removed some old types
mysys/default.c:
  Removed some old types
  Changed some string lengths to use size_t
mysys/default_modify.c:
  Changed some string lengths to use size_t
  Removed some not needed casts
mysys/hash.c:
  Removed some old types
  Changed some string lengths to use size_t
  Note: Prototype of hash_key() has changed which may cause problems if client uses hash_init() with a cast for the hash-get-key function.
  hash_element now takes 'ulong' as the index type (cleanup)
mysys/list.c:
  Removed some old types
mysys/mf_cache.c:
  Changed some string lengths to use size_t
mysys/mf_dirname.c:
  Removed some old types
  Changed some string lengths to use size_t
  Added argument to dirname_part() to avoid calculation of length for 'to'
mysys/mf_fn_ext.c:
  Removed some old types
  Updated parameters to dirname_part()
mysys/mf_format.c:
  Removed some old types
  Changed some string lengths to use size_t
mysys/mf_getdate.c:
  Removed some old types
mysys/mf_iocache.c:
  Removed some old types
  Changed some string lengths to use size_t
  Changed calculation of 'max_length' to be done the same way in all functions
mysys/mf_iocache2.c:
  Removed some old types
  Changed some string lengths to use size_t
  Clean up comments
  Removed not needed indentation
mysys/mf_keycache.c:
  Removed some old types
mysys/mf_keycaches.c:
  Removed some old types
mysys/mf_loadpath.c:
  Removed some old types
mysys/mf_pack.c:
  Removed some old types
  Changed some string lengths to use size_t
  Removed some not needed casts
  Removed very old VMS code
  Updated parameters to dirname_part()
  Use result of dirnam_part() to remove call to strcat()
mysys/mf_path.c:
  Removed some old types
mysys/mf_radix.c:
  Removed some old types
mysys/mf_same.c:
  Removed some old types
mysys/mf_sort.c:
  Removed some old types
mysys/mf_soundex.c:
  Removed some old types
mysys/mf_strip.c:
  Removed some old types
mysys/mf_tempdir.c:
  Removed some old types
mysys/mf_unixpath.c:
  Removed some old types
mysys/mf_wfile.c:
  Removed some old types
mysys/mulalloc.c:
  Removed some old types
mysys/my_alloc.c:
  Removed some old types
  Changed some string lengths to use size_t
  Use void* as type for allocated memory area
  Removed some not needed casts
  Changed argument 'Size' to 'length' according coding guidelines
mysys/my_chsize.c:
  Changed some buffers to be uchar* to avoid casts
mysys/my_compress.c:
  More comments
  Removed some old types
  Changed string lengths to use size_t
  Changed arguments to my_uncompress() to make them easier to understand
  Changed packfrm()/unpackfrm() to not be depending on uint size (portability fix)
  Changed type of 'pack_data' argument to packfrm() to avoid casts.
mysys/my_conio.c:
  Changed some string lengths to use size_t
mysys/my_create.c:
  Removed some old types
mysys/my_div.c:
  Removed some old types
mysys/my_error.c:
  Removed some old types
mysys/my_fopen.c:
  Removed some old types
mysys/my_fstream.c:
  Removed some old types
  Changed some string lengths to use size_t
  writen -> written
mysys/my_getopt.c:
  Removed some old types
mysys/my_getwd.c:
  Removed some old types
  More comments
mysys/my_init.c:
  Removed some old types
mysys/my_largepage.c:
  Removed some old types
  Changed some string lengths to use size_t
mysys/my_lib.c:
  Removed some old types
mysys/my_lockmem.c:
  Removed some old types
mysys/my_malloc.c:
  Removed some old types
  Changed malloc(), free() and related functions to use void *
  Changed all functions to use size_t
mysys/my_memmem.c:
  Indentation cleanup
mysys/my_once.c:
  Removed some old types
  Changed malloc(), free() and related functions to use void *
mysys/my_open.c:
  Removed some old types
mysys/my_pread.c:
  Removed some old types
  Changed all functions to use size_t
  Added comment for how my_pread() / my_pwrite() are supposed to work.
  Removed windows specific code to restore cursor position as this causes slowdown on windows and we should not mix read() and pread() calls anyway as this is not thread safe.
  (If we ever would really need this, it should be enabled only with a flag argument)
mysys/my_quick.c:
  Removed some old types
  Changed all functions to use size_t
mysys/my_read.c:
  Removed some old types
  Changed all functions to use size_t
mysys/my_realloc.c:
  Removed some old types
  Use void* as type for allocated memory area
  Changed all functions to use size_t
mysys/my_static.c:
  Removed some old types
mysys/my_static.h:
  Removed some old types
mysys/my_vle.c:
  Removed some old types
mysys/my_wincond.c:
  Removed some old types
mysys/my_windac.c:
  Removed some old types
mysys/my_write.c:
  Removed some old types
  Changed all functions to use size_t
mysys/ptr_cmp.c:
  Removed some old types
  Changed all functions to use size_t
mysys/queues.c:
  Removed some old types
mysys/safemalloc.c:
  Removed some old types
  Changed malloc(), free() and related functions to use void *
  Changed all functions to use size_t
mysys/string.c:
  Removed some old types
  Changed all functions to use size_t
mysys/testhash.c:
  Removed some old types
mysys/thr_alarm.c:
  Removed some old types
mysys/thr_lock.c:
  Removed some old types
mysys/tree.c:
  Removed some old types
mysys/trie.c:
  Removed some old types
mysys/typelib.c:
  Removed some old types
plugin/daemon_example/daemon_example.cc:
  Removed some old types
regex/reginit.c:
  Removed some old types
server-tools/instance-manager/buffer.cc:
  Changed some string lengths to use size_t
  Changed buffer to be of type uchar*
server-tools/instance-manager/buffer.h:
  Changed some string lengths to use size_t
  Changed buffer to be of type uchar*
server-tools/instance-manager/commands.cc:
  Removed some old types
  Changed some string lengths to use size_t
  Changed buffer to be of type uchar*
server-tools/instance-manager/instance_map.cc:
  Removed some old types
  Changed some string lengths to use size_t
  Changed buffer to be of type uchar*
server-tools/instance-manager/instance_options.cc:
  Changed buffer to be of type uchar*
  Replaced alloc_root + strcpy() with strdup_root()
server-tools/instance-manager/mysql_connection.cc:
  Changed buffer to be of type uchar*
server-tools/instance-manager/options.cc:
  Removed some old types
server-tools/instance-manager/parse.cc:
  Changed some string lengths to use size_t
server-tools/instance-manager/parse.h:
  Removed some old types
  Changed some string lengths to use size_t
server-tools/instance-manager/protocol.cc:
  Changed some buffers to be uchar* to avoid casts
  Changed some string lengths to use size_t
server-tools/instance-manager/protocol.h:
  Changed some string lengths to use size_t
server-tools/instance-manager/user_map.cc:
  Removed some old types
  Changed some string lengths to use size_t
sql/derror.cc:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
  Changed some string lengths to use size_t
sql/discover.cc:
  Changed in readfrm() and writefrom() the type for argument 'frmdata' to uchar** to avoid casts
  Changed some string lengths to use size_t
  Changed some buffers to be uchar* to avoid casts
sql/event_data_objects.cc:
  Removed some old types
  Added missing casts for alloc() and sprintf()
sql/event_db_repository.cc:
  Changed some buffers to be uchar* to avoid casts
  Added missing casts for sprintf()
sql/event_queue.cc:
  Removed some old types
sql/field.cc:
  Removed some old types
  Changed memory buffers to be uchar*
  Changed some string lengths to use size_t
  Removed a lot of casts
  Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/field.h:
  Removed some old types
  Changed memory buffers to be uchar* (except of store() as this would have caused too many other changes). 
  Changed some string lengths to use size_t
  Removed some not needed casts
  Changed val_xxx(xxx, new_ptr) to take const pointers
sql/field_conv.cc:
  Removed some old types
  Added casts required because memory area pointers are now uchar*
sql/filesort.cc:
  Initalize variable that was used unitialized in error conditions
sql/gen_lex_hash.cc:
  Removed some old types
  Changed memory buffers to be uchar*
  Changed some string lengths to use size_t
  Removed a lot of casts
  Safety fix in Field_blob::val_decimal() to not access zero pointer
sql/gstream.h:
  Added required cast
sql/ha_ndbcluster.cc:
  Removed some old types
  Updated hash-get-key function arguments
  Changed some buffers to be uchar* to avoid casts
  Added required casts
  Removed some not needed casts
sql/ha_ndbcluster.h:
  Removed some old types
sql/ha_ndbcluster_binlog.cc:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
  Replaced sql_alloc() + memcpy() + set end 0 with sql_strmake()
  Changed some string lengths to use size_t
  Added missing casts for alloc() and sprintf()
sql/ha_ndbcluster_binlog.h:
  Removed some old types
sql/ha_ndbcluster_cond.cc:
  Removed some old types
  Removed some not needed casts
sql/ha_ndbcluster_cond.h:
  Removed some old types
sql/ha_partition.cc:
  Removed some old types
  Changed prototype for change_partition() to avoid casts
sql/ha_partition.h:
  Removed some old types
sql/handler.cc:
  Removed some old types
  Changed some string lengths to use size_t
sql/handler.h:
  Removed some old types
  Changed some string lengths to use size_t
  Changed type for 'frmblob' parameter for discover() and ha_discover() to get fewer casts
sql/hash_filo.h:
  Removed some old types
  Changed all functions to use size_t
sql/hostname.cc:
  Removed some old types
sql/item.cc:
  Removed some old types
  Changed some string lengths to use size_t
  Use strmake() instead of memdup() to create a null terminated string.
  Updated calls to new Field()
sql/item.h:
  Removed some old types
  Changed malloc(), free() and related functions to use void *
  Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.cc:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
sql/item_cmpfunc.h:
  Removed some old types
sql/item_create.cc:
  Removed some old types
sql/item_func.cc:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
  Removed some not needed casts
  Added test for failing alloc() in init_result_field()
  Remove old confusing comment
  Fixed compiler warning
sql/item_func.h:
  Removed some old types
sql/item_row.cc:
  Removed some old types
sql/item_row.h:
  Removed some old types
sql/item_strfunc.cc:
  Include zlib (needed becasue we call crc32)
  Removed some old types
sql/item_strfunc.h:
  Removed some old types
  Changed some types to match new function prototypes
sql/item_subselect.cc:
  Removed some old types
sql/item_subselect.h:
  Removed some old types
sql/item_sum.cc:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
  Removed some not needed casts
sql/item_sum.h:
  Removed some old types
sql/item_timefunc.cc:
  Removed some old types
  Changed some string lengths to use size_t
sql/item_timefunc.h:
  Removed some old types
sql/item_xmlfunc.cc:
  Changed some string lengths to use size_t
sql/item_xmlfunc.h:
  Removed some old types
sql/key.cc:
  Removed some old types
  Removed some not needed casts
sql/lock.cc:
  Removed some old types
  Added some cast to my_multi_malloc() arguments for safety
sql/log.cc:
  Removed some old types
  Changed some string lengths to use size_t
  Changed some buffers to be uchar* to avoid casts
  Changed usage of pwrite() to not assume it holds the cursor position for the file
  Made usage of my_read() safer
sql/log_event.cc:
  Removed some old types
  Added checking of return value of malloc() in pack_info()
  Changed some buffers to be uchar* to avoid casts
  Removed some 'const' to avoid casts
  Added missing casts for alloc() and sprintf()
  Added required casts
  Removed some not needed casts
  Added some cast to my_multi_malloc() arguments for safety
sql/log_event.h:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
sql/log_event_old.cc:
  Changed some buffers to be uchar* to avoid casts
  Removed some not needed casts
sql/log_event_old.h:
  Changed some buffers to be uchar* to avoid casts
sql/mf_iocache.cc:
  Removed some old types
sql/my_decimal.cc:
  Changed memory area to use uchar*
sql/my_decimal.h:
  Changed memory area to use uchar*
sql/mysql_priv.h:
  Removed some old types
  Changed malloc(), free() and related functions to use void *
  Changed some string lengths to use size_t
  Changed definition of MOD_PAD_CHAR_TO_FULL_LENGTH to avoid long overflow
  Changed some buffers to be uchar* to avoid casts
sql/mysqld.cc:
  Removed some old types
sql/net_serv.cc:
  Removed some old types
  Changed some string lengths to use size_t
  Changed some buffers to be uchar* to avoid casts
  Ensure that vio_read()/vio_write() return values are stored in a size_t variable
  Removed some not needed casts
sql/opt_range.cc:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
  Removed some not needed casts
sql/opt_range.h:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
sql/opt_sum.cc:
  Removed some old types
  Removed some not needed casts
sql/parse_file.cc:
  Removed some old types
  Changed some string lengths to use size_t
  Changed alloc_root + memcpy + set end 0 -> strmake_root()
sql/parse_file.h:
  Removed some old types
sql/partition_info.cc:
  Removed some old types
  Added missing casts for alloc()
  Changed some buffers to be uchar* to avoid casts
sql/partition_info.h:
  Changed some buffers to be uchar* to avoid casts
sql/protocol.cc:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
  Removed some not needed casts
sql/protocol.h:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
  Changed some string lengths to use size_t
sql/records.cc:
  Removed some old types
sql/repl_failsafe.cc:
  Removed some old types
  Changed some string lengths to use size_t
  Added required casts
sql/rpl_filter.cc:
  Removed some old types
  Updated hash-get-key function arguments
  Changed some string lengths to use size_t
sql/rpl_filter.h:
  Changed some string lengths to use size_t
sql/rpl_injector.h:
  Removed some old types
sql/rpl_record.cc:
  Removed some old types
  Removed some not needed casts
  Changed some buffers to be uchar* to avoid casts
sql/rpl_record.h:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
sql/rpl_record_old.cc:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
  Removed some not needed casts
sql/rpl_record_old.h:
  Removed some old types
  Changed some buffers to be uchar* to avoid cast
sql/rpl_rli.cc:
  Removed some old types
sql/rpl_tblmap.cc:
  Removed some old types
sql/rpl_tblmap.h:
  Removed some old types
sql/rpl_utility.cc:
  Removed some old types
sql/rpl_utility.h:
  Removed some old types
  Changed type of m_size from my_size_t to ulong to reflect that m_size is the number of elements in the array, not a string/memory length
sql/set_var.cc:
  Removed some old types
  Updated parameters to dirname_part()
sql/set_var.h:
  Removed some old types
sql/slave.cc:
  Removed some old types
  Changed some string lengths to use size_t
sql/slave.h:
  Removed some old types
sql/sp.cc:
  Removed some old types
  Added missing casts for printf()
sql/sp.h:
  Removed some old types
  Updated hash-get-key function arguments
sql/sp_cache.cc:
  Removed some old types
  Added missing casts for printf()
  Updated hash-get-key function arguments
sql/sp_head.cc:
  Removed some old types
  Added missing casts for alloc() and printf()
  Added required casts
  Updated hash-get-key function arguments
sql/sp_head.h:
  Removed some old types
sql/sp_pcontext.cc:
  Removed some old types
sql/sp_pcontext.h:
  Removed some old types
sql/sql_acl.cc:
  Removed some old types
  Changed some string lengths to use size_t
  Changed some buffers to be uchar* to avoid casts
  Removed some not needed casts
  Added required casts
sql/sql_analyse.cc:
  Changed some buffers to be uchar* to avoid casts
sql/sql_analyse.h:
  Changed some buffers to be uchar* to avoid casts
sql/sql_array.h:
  Removed some old types
sql/sql_base.cc:
  Removed some old types
  Updated hash-get-key function arguments
sql/sql_binlog.cc:
  Removed some old types
  Added missing casts for printf()
sql/sql_cache.cc:
  Removed some old types
  Updated hash-get-key function arguments
  Removed some not needed casts
  Changed some string lengths to use size_t
sql/sql_cache.h:
  Removed some old types
  Removed reference to not existing function cache_key()
  Updated hash-get-key function arguments
sql/sql_class.cc:
  Removed some old types
  Updated hash-get-key function arguments
  Added missing casts for alloc()
  Updated hash-get-key function arguments
  Moved THD::max_row_length() to table.cc (as it's not depending on THD)
  Removed some not needed casts
sql/sql_class.h:
  Removed some old types
  Changed malloc(), free() and related functions to use void *
  Removed some not needed casts
  Changed some string lengths to use size_t
  Moved max_row_length and max_row_length_blob() to table.cc, as they are not depending on THD
sql/sql_connect.cc:
  Removed some old types
  Added required casts
sql/sql_db.cc:
  Removed some old types
  Removed some not needed casts
  Added some cast to my_multi_malloc() arguments for safety
  Added missing casts for alloc()
sql/sql_delete.cc:
  Removed some old types
sql/sql_handler.cc:
  Removed some old types
  Updated hash-get-key function arguments
  Added some cast to my_multi_malloc() arguments for safety
sql/sql_help.cc:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
  Removed some not needed casts
sql/sql_insert.cc:
  Removed some old types
  Added missing casts for alloc() and printf()
sql/sql_lex.cc:
  Removed some old types
sql/sql_lex.h:
  Removed some old types
  Removed some not needed casts
sql/sql_list.h:
  Removed some old types
  Removed some not needed casts
sql/sql_load.cc:
  Removed some old types
  Removed compiler warning
sql/sql_manager.cc:
  Removed some old types
sql/sql_map.cc:
  Removed some old types
sql/sql_map.h:
  Removed some old types
sql/sql_olap.cc:
  Removed some old types
sql/sql_parse.cc:
  Removed some old types
  Trivial move of code lines to make things more readable
  Changed some string lengths to use size_t
  Added missing casts for alloc()
sql/sql_partition.cc:
  Removed some old types
  Removed compiler warnings about not used functions
  Changed some buffers to be uchar* to avoid casts
  Removed some not needed casts
sql/sql_partition.h:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
sql/sql_plugin.cc:
  Removed some old types
  Added missing casts for alloc()
  Updated hash-get-key function arguments
sql/sql_prepare.cc:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
  Added missing casts for alloc() and printf()
sql-common/client.c:
  Removed some old types
  Changed some memory areas to use uchar*
sql-common/my_user.c:
  Changed some string lengths to use size_t
sql-common/pack.c:
  Changed some buffers to be uchar* to avoid casts
sql/sql_repl.cc:
  Added required casts
  Changed some buffers to be uchar* to avoid casts
  Changed some string lengths to use size_t
sql/sql_select.cc:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
  Removed some old types
sql/sql_select.h:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
sql/sql_servers.cc:
  Removed some old types
  Updated hash-get-key function arguments
sql/sql_show.cc:
  Removed some old types
  Added missing casts for alloc()
  Removed some not needed casts
sql/sql_string.cc:
  Removed some old types
  Added required casts
sql/sql_table.cc:
  Removed some old types
  Removed compiler warning about not used variable
  Changed some buffers to be uchar* to avoid casts
  Removed some not needed casts
sql/sql_test.cc:
  Removed some old types
sql/sql_trigger.cc:
  Removed some old types
  Added missing casts for alloc()
sql/sql_udf.cc:
  Removed some old types
  Updated hash-get-key function arguments
sql/sql_union.cc:
  Removed some old types
sql/sql_update.cc:
  Removed some old types
  Removed some not needed casts
sql/sql_view.cc:
  Removed some old types
sql/sql_yacc.yy:
  Removed some old types
  Changed some string lengths to use size_t
  Added missing casts for alloc()
sql/stacktrace.c:
  Removed some old types
sql/stacktrace.h:
  Removed some old types
sql/structs.h:
  Removed some old types
sql/table.cc:
  Removed some old types
  Updated hash-get-key function arguments
  Changed some buffers to be uchar* to avoid casts
  Removed setting of LEX_STRING() arguments in declaration
  Added required casts
  More function comments
  Moved max_row_length() here from sql_class.cc/sql_class.h
sql/table.h:
  Removed some old types
  Changed some string lengths to use size_t
sql/thr_malloc.cc:
  Use void* as type for allocated memory area
  Changed all functions to use size_t
sql/tzfile.h:
  Changed some buffers to be uchar* to avoid casts
sql/tztime.cc:
  Changed some buffers to be uchar* to avoid casts
  Updated hash-get-key function arguments
  Added missing casts for alloc()
  Removed some not needed casts
sql/uniques.cc:
  Removed some old types
  Removed some not needed casts
sql/unireg.cc:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
  Removed some not needed casts
  Added missing casts for alloc()
storage/archive/archive_reader.c:
  Removed some old types
storage/archive/azio.c:
  Removed some old types
  Removed some not needed casts
storage/archive/ha_archive.cc:
  Removed some old types
  Changed type for 'frmblob' in archive_discover() to match handler
  Updated hash-get-key function arguments
  Removed some not needed casts
storage/archive/ha_archive.h:
  Removed some old types
storage/blackhole/ha_blackhole.cc:
  Removed some old types
storage/blackhole/ha_blackhole.h:
  Removed some old types
storage/csv/ha_tina.cc:
  Removed some old types
  Updated hash-get-key function arguments
  Changed some buffers to be uchar* to avoid casts
storage/csv/ha_tina.h:
  Removed some old types
  Removed some not needed casts
storage/csv/transparent_file.cc:
  Removed some old types
  Changed type of 'bytes_read' to be able to detect read errors
  Fixed indentation
storage/csv/transparent_file.h:
  Removed some old types
storage/example/ha_example.cc:
  Removed some old types
  Updated hash-get-key function arguments
storage/example/ha_example.h:
  Removed some old types
storage/federated/ha_federated.cc:
  Removed some old types
  Updated hash-get-key function arguments
  Removed some not needed casts
storage/federated/ha_federated.h:
  Removed some old types
storage/heap/_check.c:
  Changed some buffers to be uchar* to avoid casts
storage/heap/_rectest.c:
  Removed some old types
storage/heap/ha_heap.cc:
  Removed some old types
storage/heap/ha_heap.h:
  Removed some old types
storage/heap/heapdef.h:
  Removed some old types
storage/heap/hp_block.c:
  Removed some old types
  Changed some string lengths to use size_t
storage/heap/hp_clear.c:
  Removed some old types
storage/heap/hp_close.c:
  Removed some old types
storage/heap/hp_create.c:
  Removed some old types
storage/heap/hp_delete.c:
  Removed some old types
storage/heap/hp_hash.c:
  Removed some old types
storage/heap/hp_info.c:
  Removed some old types
storage/heap/hp_open.c:
  Removed some old types
storage/heap/hp_rfirst.c:
  Removed some old types
storage/heap/hp_rkey.c:
  Removed some old types
storage/heap/hp_rlast.c:
  Removed some old types
storage/heap/hp_rnext.c:
  Removed some old types
storage/heap/hp_rprev.c:
  Removed some old types
storage/heap/hp_rrnd.c:
  Removed some old types
storage/heap/hp_rsame.c:
  Removed some old types
storage/heap/hp_scan.c:
  Removed some old types
storage/heap/hp_test1.c:
  Removed some old types
storage/heap/hp_test2.c:
  Removed some old types
storage/heap/hp_update.c:
  Removed some old types
storage/heap/hp_write.c:
  Removed some old types
  Changed some string lengths to use size_t
storage/innobase/handler/ha_innodb.cc:
  Removed some old types
  Updated hash-get-key function arguments
  Added missing casts for alloc() and printf()
  Removed some not needed casts
storage/innobase/handler/ha_innodb.h:
  Removed some old types
storage/myisam/ft_boolean_search.c:
  Removed some old types
storage/myisam/ft_nlq_search.c:
  Removed some old types
storage/myisam/ft_parser.c:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
storage/myisam/ft_static.c:
  Removed some old types
storage/myisam/ft_stopwords.c:
  Removed some old types
storage/myisam/ft_update.c:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
storage/myisam/ftdefs.h:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
storage/myisam/fulltext.h:
  Removed some old types
storage/myisam/ha_myisam.cc:
  Removed some old types
storage/myisam/ha_myisam.h:
  Removed some old types
storage/myisam/mi_cache.c:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_check.c:
  Removed some old types
storage/myisam/mi_checksum.c:
  Removed some old types
storage/myisam/mi_close.c:
  Removed some old types
storage/myisam/mi_create.c:
  Removed some old types
storage/myisam/mi_delete.c:
  Removed some old types
storage/myisam/mi_delete_all.c:
  Removed some old types
storage/myisam/mi_dynrec.c:
  Removed some old types
storage/myisam/mi_extra.c:
  Removed some old types
storage/myisam/mi_key.c:
  Removed some old types
storage/myisam/mi_locking.c:
  Removed some old types
storage/myisam/mi_log.c:
  Removed some old types
storage/myisam/mi_open.c:
  Removed some old types
  Removed some not needed casts
  Check argument of my_write()/my_pwrite() in functions returning int
  Added casting of string lengths to size_t
storage/myisam/mi_packrec.c:
  Removed some old types
  Changed some buffers to be uchar* to avoid casts
storage/myisam/mi_page.c:
  Removed some old types
storage/myisam/mi_preload.c:
  Removed some old types
storage/myisam/mi_range.c:
  Removed some old types
storage/myisam/mi_rfirst.c:
  Removed some old types
storage/myisam/mi_rkey.c:
  Removed some old types
storage/myisam/mi_rlast.c:
  Removed some old types
storage/myisam/mi_rnext.c:
  Removed some old types
storage/myisam/mi_rnext_same.c:
  Removed some old types
storage/myisam/mi_rprev.c:
  Removed some old types
storage/myisam/mi_rrnd.c:
  Removed some old types
storage/myisam/mi_rsame.c:
  Removed some old types
storage/myisam/mi_rsamepos.c:
  Removed some old types
storage/myisam/mi_scan.c:
  Removed some old types
storage/myisam/mi_search.c:
  Removed some old types
storage/myisam/mi_static.c:
  Removed some old types
storage/myisam/mi_statrec.c:
  Removed some old types
storage/myisam/mi_test1.c:
  Removed some old types
storage/myisam/mi_test2.c:
  Removed some old types
storage/myisam/mi_test3.c:
  Removed some old types
storage/myisam/mi_unique.c:
  Removed some old types
storage/myisam/mi_update.c:
  Removed some old types
storage/myisam/mi_write.c:
  Removed some old types
storage/myisam/myisam_ftdump.c:
  Removed some old types
storage/myisam/myisamchk.c:
  Removed some old types
storage/myisam/myisamdef.h:
  Removed some old types
storage/myisam/myisamlog.c:
  Removed some old types
  Indentation fix
storage/myisam/myisampack.c:
  Removed some old types
storage/myisam/rt_index.c:
  Removed some old types
storage/myisam/rt_split.c:
  Removed some old types
storage/myisam/sort.c:
  Removed some old types
storage/myisam/sp_defs.h:
  Removed some old types
storage/myisam/sp_key.c:
  Removed some old types
storage/myisammrg/ha_myisammrg.cc:
  Removed some old types
storage/myisammrg/ha_myisammrg.h:
  Removed some old types
storage/myisammrg/myrg_close.c:
  Removed some old types
storage/myisammrg/myrg_def.h:
  Removed some old types
storage/myisammrg/myrg_delete.c:
  Removed some old types
storage/myisammrg/myrg_open.c:
  Removed some old types
  Updated parameters to dirname_part()
storage/myisammrg/myrg_queue.c:
  Removed some old types
storage/myisammrg/myrg_rfirst.c:
  Removed some old types
storage/myisammrg/myrg_rkey.c:
  Removed some old types
storage/myisammrg/myrg_rlast.c:
  Removed some old types
storage/myisammrg/myrg_rnext.c:
  Removed some old types
storage/myisammrg/myrg_rnext_same.c:
  Removed some old types
storage/myisammrg/myrg_rprev.c:
  Removed some old types
storage/myisammrg/myrg_rrnd.c:
  Removed some old types
storage/myisammrg/myrg_rsame.c:
  Removed some old types
storage/myisammrg/myrg_update.c:
  Removed some old types
storage/myisammrg/myrg_write.c:
  Removed some old types
storage/ndb/include/util/ndb_opts.h:
  Removed some old types
storage/ndb/src/cw/cpcd/main.cpp:
  Removed some old types
storage/ndb/src/kernel/vm/Configuration.cpp:
  Removed some old types
storage/ndb/src/mgmclient/main.cpp:
  Removed some old types
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
  Removed some old types
  Removed old disabled code
storage/ndb/src/mgmsrv/main.cpp:
  Removed some old types
storage/ndb/src/ndbapi/NdbBlob.cpp:
  Removed some old types
storage/ndb/src/ndbapi/NdbOperationDefine.cpp:
  Removed not used variable
storage/ndb/src/ndbapi/NdbOperationInt.cpp:
  Added required casts
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
  Added required casts
storage/ndb/tools/delete_all.cpp:
  Removed some old types
storage/ndb/tools/desc.cpp:
  Removed some old types
storage/ndb/tools/drop_index.cpp:
  Removed some old types
storage/ndb/tools/drop_tab.cpp:
  Removed some old types
storage/ndb/tools/listTables.cpp:
  Removed some old types
storage/ndb/tools/ndb_config.cpp:
  Removed some old types
storage/ndb/tools/restore/consumer_restore.cpp:
  Changed some buffers to be uchar* to avoid casts with new defintion of packfrm()
storage/ndb/tools/restore/restore_main.cpp:
  Removed some old types
storage/ndb/tools/select_all.cpp:
  Removed some old types
storage/ndb/tools/select_count.cpp:
  Removed some old types
storage/ndb/tools/waiter.cpp:
  Removed some old types
strings/bchange.c:
  Changed function to use uchar * and size_t
strings/bcmp.c:
  Changed function to use uchar * and size_t
strings/bmove512.c:
  Changed function to use uchar * and size_t
strings/bmove_upp.c:
  Changed function to use uchar * and size_t
strings/ctype-big5.c:
  Changed functions to use size_t
  Changed character length functions to return uint
strings/ctype-bin.c:
  Changed functions to use size_t
strings/ctype-cp932.c:
  Changed functions to use size_t
  Changed character length functions to return uint
strings/ctype-czech.c:
  Fixed indentation
  Changed functions to use size_t
strings/ctype-euc_kr.c:
  Changed functions to use size_t
  Changed character length functions to return uint
strings/ctype-eucjpms.c:
  Changed functions to use size_t
  Changed character length functions to return uint
  unsigned char -> uchar
strings/ctype-gb2312.c:
  Changed functions to use size_t
  Changed character length functions to return uint
strings/ctype-gbk.c:
  Changed functions to use size_t
  Changed character length functions to return uint
strings/ctype-latin1.c:
  Changed functions to use size_t
  Changed character length functions to return uint
  unsigned char -> uchar
strings/ctype-mb.c:
  Changed functions to use size_t
  Changed character length functions to return uint
strings/ctype-simple.c:
  Changed functions to use size_t
  Simpler loops for caseup/casedown
  unsigned int -> uint
  unsigned char -> uchar
strings/ctype-sjis.c:
  Changed functions to use size_t
  Changed character length functions to return uint
strings/ctype-tis620.c:
  Changed functions to use size_t
  Changed character length functions to return uint
  unsigned char -> uchar
strings/ctype-uca.c:
  Changed functions to use size_t
  unsigned char -> uchar
strings/ctype-ucs2.c:
  Moved inclusion of stdarg.h to other includes
  usigned char -> uchar
  Changed functions to use size_t
  Changed character length functions to return uint
strings/ctype-ujis.c:
  Changed functions to use size_t
  Changed character length functions to return uint
  unsigned char -> uchar
strings/ctype-utf8.c:
  Changed functions to use size_t
  unsigned char -> uchar
  Indentation fixes
strings/ctype-win1250ch.c:
  Indentation fixes
  Changed functions to use size_t
strings/ctype.c:
  Changed functions to use size_t
strings/decimal.c:
  Changed type for memory argument to uchar *
strings/do_ctype.c:
  Indentation fixes
strings/my_strtoll10.c:
  unsigned char -> uchar
strings/my_vsnprintf.c:
  Changed functions to use size_t
strings/r_strinstr.c:
  Removed some old types
  Changed functions to use size_t
strings/str_test.c:
  Removed some old types
strings/strappend.c:
  Changed functions to use size_t
strings/strcont.c:
  Removed some old types
strings/strfill.c:
  Removed some old types
strings/strinstr.c:
  Changed functions to use size_t
strings/strlen.c:
  Changed functions to use size_t
strings/strmake.c:
  Changed functions to use size_t
strings/strnlen.c:
  Changed functions to use size_t
strings/strnmov.c:
  Changed functions to use size_t
strings/strto.c:
  unsigned char -> uchar
strings/strtod.c:
  Changed functions to use size_t
strings/strxnmov.c:
  Changed functions to use size_t
strings/xml.c:
  Changed functions to use size_t
  Indentation fixes
tests/mysql_client_test.c:
  Removed some old types
tests/thread_test.c:
  Removed some old types
vio/test-ssl.c:
  Removed some old types
vio/test-sslclient.c:
  Removed some old types
vio/test-sslserver.c:
  Removed some old types
vio/vio.c:
  Removed some old types
vio/vio_priv.h:
  Removed some old types
  Changed vio_read()/vio_write() to work with size_t
vio/viosocket.c:
  Changed vio_read()/vio_write() to work with size_t
  Indentation fixes
vio/viossl.c:
  Changed vio_read()/vio_write() to work with size_t
  Indentation fixes
vio/viosslfactories.c:
  Removed some old types
vio/viotest-ssl.c:
  Removed some old types
win/README:
  More explanations
2007-05-10 12:59:39 +03:00
unknown
6e07c2e641 Merge mysql.com:/d2/hf/mrg/mysql-5.0-opt
into  mysql.com:/d2/hf/mrg/mysql-5.1-opt


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
mysql-test/r/sp-vars.result:
  merging
mysql-test/r/type_datetime.result:
  SCCS merged
mysql-test/t/type_datetime.test:
  SCCS merged
sql/item_func.h:
  merging
sql/mysql_priv.h:
  merging
2007-05-07 16:12:42 +05:00
unknown
99bde6d9ec Bug#27759: Wrong DATE/DATETIME comparison in LEAST()/GREATEST() functions.
The LEAST/GREATEST functions compared DATE/DATETIME values as
strings which in some cases could lead to a wrong result.

A new member function called cmp_datetimes() is added to the
Item_func_min_max class. It compares arguments in DATETIME context
and returns index of the least/greatest argument.
The Item_func_min_max::fix_length_and_dec() function now detects when
arguments should be compared in DATETIME context and sets the newly
added flag compare_as_dates. It indicates that the cmp_datetimes() function
should be called to get a correct result.
Item_func_min_max::val_xxx() methods are corrected to call the
cmp_datetimes() function when needed.
Objects of the Item_splocal class now stores and reports correct original
field type.


mysql-test/t/type_datetime.test:
  Added a test case for the bug#27759: Wrong DATE/DATETIME comparison in LEAST()/GREATEST() functions.
mysql-test/r/type_datetime.result:
  Added a test case for the bug#27759: Wrong DATE/DATETIME comparison in LEAST()/GREATEST() functions.
mysql-test/r/sp-vars.result:
  A test case result corrected after the fix for the bug#27759.
sql/mysql_priv.h:
  Bug#27759: Wrong DATE/DATETIME comparison in LEAST()/GREATEST() functions.
  Added the prototype of the get_datetime_value() function.
sql/item_func.h:
  Bug#27759: Wrong DATE/DATETIME comparison in LEAST()/GREATEST() functions.
  A new member function called cmp_datetimes() is added to the
  Item_func_min_max class.
sql/item_func.cc:
  Bug#27759: Wrong DATE/DATETIME comparison in LEAST()/GREATEST() functions.
  A new member function called cmp_datetimes() is added to the
  Item_func_min_max class. It compares arguments in DATETIME context
  and returns index of the least/greatest argument.
  The Item_func_min_max::fix_length_and_dec() function now detects when
  arguments should be compared in DATETIME context and sets the newly
  added flag compare_as_dates. It indicates that the cmp_datetimes() function
  should be called to get a correct result.
  Item_func_min_max::val_xxx() methods are corrected to call the
  cmp_datetimes() function when needed.
sql/item_cmpfunc.cc:
  Bug#27759: Wrong DATE/DATETIME comparison in LEAST()/GREATEST() functions.
  The get_datetime_value() function is no longer static.
sql/item.h:
  Bug#27759: Wrong DATE/DATETIME comparison in LEAST()/GREATEST() functions.
  Objects of the Item_splocal class now stores and reports correct original
  field type.
sql/item.cc:
  Bug#27759: Wrong DATE/DATETIME comparison in LEAST()/GREATEST() functions.
  Objects of the Item_splocal class now stores and reports correct original
  field type.
2007-05-04 18:57:10 +04:00
unknown
1513cd0933 Merge weblab.(none):/home/marcsql/TREE/mysql-5.1-base
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-rt-merge


mysql-test/r/sp.result:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_ndbcluster_binlog.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2007-05-02 12:11:25 -06:00
unknown
03e7683565 Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-base
into  weblab.(none):/home/marcsql/TREE/mysql-5.0-rt-merge


mysql-test/t/sp.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2007-05-02 09:59:39 -06:00
unknown
02af55835f Merge nosik:/my/mysql-5.1
into  mysql.com:/home/my/mysql-5.1


sql/field.cc:
  Auto merged
sql/item.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
2007-05-02 12:11:59 +03:00
unknown
2a46eda7d2 Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-runtime
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-21513


mysql-test/t/sp.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/sql_lex.cc:
  manual merge
2007-04-30 11:41:51 -06:00
unknown
2031f55751 Merge mysql.com:/d2/hf/mrg/mysql-5.0-opt
into  mysql.com:/d2/hf/mrg/mysql-5.1-opt


mysql-test/r/alter_table.result:
  Auto merged
mysql-test/r/distinct.result:
  Auto merged
mysql-test/r/heap.result:
  Auto merged
mysql-test/r/ps_2myisam.result:
  Auto merged
mysql-test/r/ps_3innodb.result:
  Auto merged
mysql-test/r/ps_4heap.result:
  Auto merged
mysql-test/r/ps_5merge.result:
  Auto merged
mysql-test/r/ps_7ndb.result:
  Auto merged
mysql-test/r/query_cache.result:
  Auto merged
BitKeeper/deleted/.del-CMakeLists.txt~1:
  Auto merged
BitKeeper/deleted/.del-ps_6bdb.result:
  Auto merged
mysql-test/t/alter_table.test:
  Auto merged
mysys/my_error.c:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/key.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/table.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/include/mix1.inc:
  merging
mysql-test/r/group_by.result:
  SCCS merged
mysql-test/r/innodb_mysql.result:
  merging
mysql-test/r/join.result:
  merging
mysql-test/r/subselect.result:
  merging
mysql-test/r/type_datetime.result:
  SCCS merged
mysql-test/r/windows.result:
  SCCS merged
mysql-test/t/group_by.test:
  SCCS merged
mysql-test/t/join.test:
  merging
mysql-test/t/subselect.test:
  merging
mysql-test/t/type_datetime.test:
  merging
mysql-test/t/windows.test:
  SCCS merged
sql/item_timefunc.cc:
  merging
sql/sql_base.cc:
  SCCS merged
storage/innobase/handler/ha_innodb.cc:
  merging
2007-04-29 13:19:32 +05:00
unknown
1700feaa02 Bug#21513 (SP having body starting with quoted label rendered unusable)
Before this fix, the parser would sometime change where a token starts by
altering Lex_input_string::tok_start, which later confused the code in
sql_yacc.yy that needs to capture the source code of a SQL statement,
like to represent the body of a stored procedure.

This line of code in sql_lex.cc :

case MY_LEX_USER_VARIABLE_DELIMITER:
  lip->tok_start= lip->ptr; // Skip first `

would <skip the first back quote> ... and cause the bug reported.

In general, the responsibility of sql_lex.cc is to *find* where token are
in the SQL text, but is *not* to make up fake or incomplete tokens.
With a quoted label like `my_label`, the token starts on the first quote.
Extracting the token value should not change that (it did).

With this fix, the lexical analysis has been cleaned up to not change
lip->tok_start (in the case found for this bug).

The functions get_token() and get_quoted_token() now have an extra
parameters, used when some characters from the beginning of the token need
to be skipped when extracting a token value, like when extracting 'AB' from
'0xAB', for example, for a HEX_NUM token.

This exposed a bad assumption in Item_hex_string and Item_bin_string,
which has been fixed:

The assumption was that the string given, 'AB', was in fact preceded in
memory by '0x', which might be false (it can be preceded by "x'" and
followed by "'" -- or not be preceded by valid memory at all)

If a name is needed for Item_hex_string or Item_bin_string, the name is
taken from the original and true source code ('0xAB'), and assigned in
the select_item rule, instead of relying on assumptions related to how
memory is used.


mysql-test/r/sp.result:
  Lex_input_stream::tok_start must point at the real start of a token.
mysql-test/t/sp.test:
  Lex_input_stream::tok_start must point at the real start of a token.
sql/item.cc:
  Lex_input_stream::tok_start must point at the real start of a token.
sql/sql_lex.cc:
  Lex_input_stream::tok_start must point at the real start of a token.
sql/sql_yacc.yy:
  Lex_input_stream::tok_start must point at the real start of a token.
2007-04-27 17:14:25 -06:00
unknown
674ecb2104 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/27590-bug-5.0-opt-mysql


mysql-test/r/subselect.result:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
2007-04-27 21:07:05 +04:00
unknown
4958eec7ec Added sql_mode PAD_CHAR_TO_FULL_LENGTH (WL#921)
This pads the value of CHAR columns with spaces up to full column length (according to ANSI)
It's not makde part of oracle or ansi mode yet, as this would cause a notable behaviour change.
Added uuid_short(), a generator for increasing 'unique' longlong integers (8 bytes)   


mysql-test/r/func_misc.result:
  Update results
mysql-test/r/sql_mode.result:
  Update results
mysql-test/t/func_misc.test:
  Added test for uuid_short()
mysql-test/t/sql_mode.test:
  Added test for sql_mode=PAD_CHAR_TO_FULL_LENGTH (#WL921)
sql/field.cc:
  Added sql_mode PAD_CHAR_TO_FULL_LENGTH
sql/item.cc:
  Initialize uuid_short()
sql/item_create.cc:
  Added creation of uuid_short()
sql/item_func.cc:
  Added uuid_short()
sql/item_func.h:
  Added uuid_short()
sql/mysql_priv.h:
  Added sql_mode PAD_CHAR_TO_FULL_LENGTH
sql/mysqld.cc:
  Added sql_mode PAD_CHAR_TO_FULL_LENGTH
2007-04-27 01:12:09 +03:00
unknown
7bb6a72593 Bug#27590: Wrong DATE/DATETIME comparison.
DATE and DATETIME can be compared either as strings or as int. Both
methods have their disadvantages. Strings can contain valid DATETIME value
but have insignificant zeros omitted thus became non-comparable with
other DATETIME strings. The comparison as int usually will require conversion
from the string representation and the automatic conversion in most cases is
carried out in a wrong way thus producing wrong comparison result. Another
problem occurs when one tries to compare DATE field with a DATETIME constant.
The constant is converted to DATE losing its precision i.e. losing time part.

This fix addresses the problems described above by adding a special
DATE/DATETIME comparator. The comparator correctly converts DATE/DATETIME
string values to int when it's necessary, adds zero time part (00:00:00)
to DATE values to compare them correctly to DATETIME values. Due to correct
conversion malformed DATETIME string values are correctly compared to other
DATE/DATETIME values.

As of this patch a DATE value equals to DATETIME value with zero time part.
For example '2001-01-01' equals to '2001-01-01 00:00:00'.

The compare_datetime() function is added to the Arg_comparator class.
It implements the correct comparator for DATE/DATETIME values.
Two supplementary functions called get_date_from_str() and get_datetime_value()
are added. The first one extracts DATE/DATETIME value from a string and the
second one retrieves the correct DATE/DATETIME value from an item.
The new Arg_comparator::can_compare_as_dates() function is added and used
to check whether two given items can be compared by the compare_datetime()
comparator.
Two caching variables were added to the Arg_comparator class to speedup the
DATE/DATETIME comparison.
One more store() method was added to the Item_cache_int class to cache int
values.
The new is_datetime() function was added to the Item class. It indicates
whether the item returns a DATE/DATETIME value.


sql/item.cc:
  Bug#27590: Wrong DATE/DATETIME comparison.
  One more store() method was added to the Item_cache_int class to cache int
  values.
  The new is_datetime() function was added to the Item class. It indicates
  whether the item returns a DATE/DATETIME value.
sql/item.h:
  Bug#27590: Wrong DATE/DATETIME comparison.
  One more store() method was added to the Item_cache_int class to cache int
  values.
  The new is_datetime() function was added to the Item class. It indicates
  whether the item returns a DATE/DATETIME value.
sql/item_cmpfunc.cc:
  Bug#27590: Wrong DATE/DATETIME comparison.
  The compare_datetime() function is added to the Arg_comparator class.
  It implements the correct comparator for DATE/DATETIME values.
  Two supplementary functions called get_date_from_str() and get_datetime_value()
  are added. The first one extracts DATE/DATETIME value from a string and the
  second one retrieves the correct DATE/DATETIME value from an item.
  The new Arg_comparator::can_compare_as_dates() function is added and used
  to check whether two given items can be compared by the compare_datetime()
  comparator.
sql/item_cmpfunc.h:
  Bug#27590: Wrong DATE/DATETIME comparison.
  The compare_datetime() function is added to the Arg_comparator class.
  It implements the correct comparator for DATE/DATETIME values.
  Two supplementary functions called get_date_from_str() and get_datetime_value()
  are added. The first one extracts DATE/DATETIME value from a string and the
  second one retrieves the correct DATE/DATETIME value from an item.
  The new Arg_comparator::can_compare_as_dates() function is added and used
  to check whether two given items can be compared by the compare_datetime()
  comparator.
  Two caching variables were added to the Arg_comparator class to speedup the
  DATE/DATETIME comparison.
mysql-test/include/ps_conv.inc:
  Test case adjusted after fix for bug#27590.
mysql-test/r/distinct.result:
  Test cases results are corrected after fix for bug#27590.
sql/sql_select.cc:
  Bug#27590: Wrong DATE/DATETIME comparison.
  The test_if_equality_guarantees_uniqueness() function now uses
  Arg_comparator::can_compare_as_dates() to detect comparable DATE/DATETIME items.
mysql-test/r/ps_2myisam.result:
  The result of the adjusted test case after fix for bug#27590.
mysql-test/r/ps_3innodb.result:
  The result of the adjusted test case after fix for bug#27590.
mysql-test/r/ps_4heap.result:
  The result of the adjusted test case after fix for bug#27590.
mysql-test/r/ps_5merge.result:
  The result of the adjusted test case after fix for bug#27590.
mysql-test/r/subselect.result:
  Test cases results are corrected after fix for bug#27590.
mysql-test/r/type_datetime.result:
  Added a test case for the bug#27590: Wrong DATE/DATETIME comparison.
mysql-test/t/type_datetime.test:
  Added a test case for the bug#27590: Wrong DATE/DATETIME comparison.
tests/mysql_client_test.c:
  Test case adjusted after fix for bug#27590.
2007-04-27 00:12:09 +04:00
unknown
7062a44622 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B27363-5.0-opt


mysql-test/r/subselect.result:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
2007-04-26 11:16:01 +03:00
unknown
e14fd2b651 Bug #27363:
Validity checks for nested set functions
were not taking into account that the enclosed
set function may be on a nest level that is
lower than the nest level of the enclosing set
function.
Fixed by :
 - propagating max_sum_func_level
up the enclosing set functions chain.
 - updating the max_sum_func_level of the 
   enclosing set function when the enclosed set
   function is aggregated above or on the same
   nest level of as the level of the enclosing 
   set function.
 - updating the max_arg_level of the enclosing
   set function on a reference that refers to
   an item above or on the same nest level
   as the level of the enclosing set function.
 - Treating both Item_field and Item_ref as possibly
   referencing items from outer nest levels.


mysql-test/r/subselect.result:
  Bug #27363: test cases
mysql-test/t/subselect.test:
  Bug #27363: test cases
sql/item.cc:
  Bug #27363:
  Treat the reference as an outer reference for the
  enclosing set function even if it's referencing
  an item that is above the nest level of the
  enclosing set function.
  Consider both Item_field and Item_ref.
sql/item_sum.cc:
  Bug #27363: Use the enclosed set function aggregation
  level to mark the enclosing set function even 
  if it's aggregated on a level that is above the 
  nest level of the enclosing set function.
  Pass max_sum_func_level up the accending branch of the
  recursion because it must take into account each
  directly or indirectly nested set function.
2007-04-26 11:12:17 +03:00
unknown
9340cb193e Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into  bk-internal.mysql.com:/data0/bk/mysql-5.1-marvel


mysql-test/r/strict.result:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
2007-04-17 15:45:35 +02:00
unknown
663757ea25 Merge moonbone.local:/mnt/gentoo64/work/27321-bug-5.0-opt-mysql
into  moonbone.local:/mnt/gentoo64/work/bk-trees/mysql-5.1-opt


mysql-test/r/subselect3.result:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_union.cc:
  Auto merged
mysql-test/r/subselect.result:
  Manual merge
mysql-test/t/subselect.test:
  Manual merge
2007-04-15 12:05:13 +04:00
unknown
3e8252ffc6 item.cc:
Fix warning after fix for bug#27321.


sql/item.cc:
  Fix warning after fix for bug#27321.
2007-04-15 09:54:16 +04:00
unknown
9255aab5bf Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/27321-bug-5.0-opt-mysql


mysql-test/r/subselect3.result:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
mysql-test/r/subselect.result:
  Manually merged
mysql-test/t/subselect.test:
  Manually merged
mysql-test/t/subselect3.test:
  Manually merged
2007-04-15 08:41:35 +04:00
unknown
1cf3b96513 Bug#27321: Wrong subquery result in a grouping select.
The Item_outer_ref class based on the Item_direct_ref class was always used
to represent an outer field. But if the outer select is a grouping one and the 
outer field isn't under an aggregate function which is aggregated in that
outer select an Item_ref object should be used to represent such a field.
If the outer select in which the outer field is resolved isn't grouping then
the Item_field class should be used to represent such a field.
This logic also should be used for an outer field resolved through its alias
name.

Now the Item_field::fix_outer_field() uses Item_outer_field objects to
represent aliased and non-aliased outer fields for grouping outer selects
only.
Now the fix_inner_refs() function chooses which class to use to access outer
field - the Item_ref or the Item_direct_ref. An object of the chosen class
substitutes the original field in the Item_outer_ref object.
The direct_ref and the found_in_select_list fields were added to the
Item_outer_ref class.


mysql-test/t/subselect3.test:
  Some test cases were corrected after the fix for the bug#27321.
mysql-test/r/subselect3.result:
  Some test cases were corrected after the fix for the bug#27321.
mysql-test/t/subselect.test:
  Added a test case for the bug#27321: Wrong subquery result in a grouping select.
mysql-test/r/subselect.result:
  Added a test case for the bug#27321: Wrong subquery result in a grouping select.
  Some test cases were corrected after this fix.
sql/sql_union.cc:
  Bug#27321: Wrong subquery result in a grouping select.
  Cleanup of the inner_refs_list.
sql/sql_select.cc:
  Bug#27321: Wrong subquery result in a grouping select.
  Now the fix_inner_refs() function chooses which class to use to access outer
  field - the Item_ref or the Item_direct_ref. An object of the chosen class
  substitutes the original field in the Item_outer_ref object.
  A comment is corrected.
sql/item.cc:
  Bug#27321: Wrong subquery result in a grouping select.
  Now the Item_field::fix_outer_field() uses Item_outer_field objects to
  represent aliased and non-aliased outer fields for grouping outer selects
  only.
sql/item.h:
  Bug#27321: Wrong subquery result in a grouping select.
  The direct_ref and the found_in_select_list fields were added to the
  Item_outer_ref class.
2007-04-15 08:31:34 +04:00
unknown
e552b08fcd Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into  bk-internal.mysql.com:/data0/bk/mysql-5.1-marvel


client/mysql.cc:
  Auto merged
client/mysqlbinlog.cc:
  Auto merged
sql/event_data_objects.cc:
  Auto merged
sql/event_db_repository.cc:
  Auto merged
sql/event_queue.cc:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
strings/ctype-utf8.c:
  Auto merged
2007-04-03 13:51:31 +02:00
unknown
f92433ae13 item.cc, insert_update.result:
After merge fix.


mysql-test/r/insert_update.result:
  After merge fix.
sql/item.cc:
  After merge fix.
2007-03-31 02:57:26 +04:00
unknown
da11d8177e Merge moonbone.local:/mnt/gentoo64/work/bk-trees/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/bk-trees/mysql-5.1-opt


mysql-test/r/func_gconcat.result:
  Auto merged
mysql-test/r/insert_update.result:
  Auto merged
mysql-test/r/subselect3.result:
  Auto merged
mysql-test/t/func_gconcat.test:
  Auto merged
mysql-test/t/insert_update.test:
  Auto merged
sql/field_conv.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_load.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/table.h:
  Auto merged
mysql-test/r/gis.result:
  Manual merge
mysql-test/t/gis.test:
  Manual merge
sql/handler.cc:
  Manual merge
sql/item_sum.cc:
  Manual merge
sql/sql_insert.cc:
  Manual merge
sql/sql_table.cc:
  Manual merge
2007-03-31 02:42:40 +04:00
unknown
c8f1cf4cf9 Bug #27300:
Geometry fields have a result type string and a 
  special subclass to cater for the differences
  between them and the base class (just like 
  DATE/TIME).
  When creating temporary tables for results of 
  functions that return results of type GEOMETRY
  we must construct fields of the derived class 
  instead of the base class.
  Fixed by creating a GEOMETRY field (Field_geom) 
  instead of a generic BLOB (Field_blob) in temp 
  tables for the results of GIS functions that 
  have GEOMETRY return type (Item_geometry_func).


mysql-test/r/gis.result:
  Bug #27300: test case
mysql-test/t/gis.test:
  Bug #27300: test case
sql/item.cc:
  Bug #27300:
    Create a GEOMETRY field (Field_geom) instead of 
    a generic BLOB (Field_blob) in temp tables for 
    the results of GIS functions (Item_geometry_func).
sql/sql_select.cc:
  Bug #27300:
    Create a GEOMETRY field (Field_geom) instead of 
    a generic BLOB (Field_blob) in temp tables for 
    the results of GIS functions (Item_geometry_func).
2007-03-28 14:35:23 +03:00
unknown
9887430fc0 Merge magare.gmz:/home/kgeorge/mysql/work/WL3527-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/WL3527-5.1-opt


mysql-test/r/gis.result:
  Auto merged
mysql-test/t/gis.test:
  Auto merged
sql/field.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_sum.h:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
mysql-test/r/subselect.result:
  merge 5.0-opt -> 5.1-opt
mysql-test/t/subselect.test:
  merge 5.0-opt -> 5.1-opt
sql/sql_base.cc:
  merge 5.0-opt -> 5.1-opt
2007-03-26 17:03:57 +03:00
unknown
a88dac081e Merge bk-internal:/home/bk/mysql-5.1-opt
into  magare.gmz:/home/kgeorge/mysql/work/B26303-5.1-opt


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
2007-03-26 14:04:20 +03:00
unknown
9e6a59598c Bug #26303: Reserve is not called before qs_append().
This may lead to buffer overflow.
The String::qs_append() function will append a string
without checking if there's enough space.
So qs_append() must be called beforehand to ensure 
there's enough space in the buffer for the subsequent 
qs_append() calls.
Fixed Item_case_expr::print() to make sure there's
enough space before appending data by adding a call to 
String::reserve() to make sure qs_append() will have 
enough space.


mysql-test/r/sp-code.result:
  Bug #26303: test case
mysql-test/t/sp-code.test:
  Bug #26303: test case
sql/item.cc:
  Bug #26303: added a call to String::reserve() to
   make sure qs_append will have enough space
sql/item.h:
  Bug #26303: m_case_expr_id made unsigned 
  because it's offset in an array.
2007-03-26 12:32:51 +03:00
unknown
212ecf348c Removed not used define YY_MAGIC_BELOW
Made year 2000 handling more uniform
Removed year 2000 handling out from calc_days()
The above removes some bugs in date/datetimes with year between 0 and 200
Now we get a note when we insert a datetime value into a date column
For default values to CREATE, don't give errors for warning level NOTE
Fixed some compiler failures
Added library ws2_32 for windows compilation (needed if we want to compile with IOCP support)
Removed duplicate typedef TIME and replaced it with MYSQL_TIME

Better (more complete) fix for: Bug#21103 "DATE column not compared as DATE"
Fixed properly Bug#18997 "DATE_ADD and DATE_SUB perform year2K autoconversion magic on 4-digit year value"
Fixed Bug#23093 "Implicit conversion of 9912101 to date does not match cast(9912101 as date)"


include/my_time.h:
  Removed not used define YY_MAGIC_BELOW
  Added prototype for year_2000_handling()
mysql-test/r/date_formats.result:
  Updated results (fixed bug in date_format() with year < 99)
mysql-test/r/func_sapdb.result:
  Added more testing of make_date()
mysql-test/r/func_time.result:
  Fixed bug in date_sub() with years < 200
mysql-test/r/ps_2myisam.result:
  Now we get a note when we insert a datetime value into a date column
mysql-test/r/ps_3innodb.result:
  Now we get a note when we insert a datetime value into a date column
mysql-test/r/ps_4heap.result:
  Now we get a note when we insert a datetime value into a date column
mysql-test/r/ps_5merge.result:
  Now we get a note when we insert a datetime value into a date column
mysql-test/r/ps_7ndb.result:
  Now we get a note when we insert a datetime value into a date column
mysql-test/r/type_date.result:
  Added test for date conversions
mysql-test/r/type_datetime.result:
  Added testcase for datetime to date conversion.
mysql-test/t/date_formats.test:
  Added testing of dates < 200
mysql-test/t/func_sapdb.test:
  More testing of makedate()
mysql-test/t/type_date.test:
  Added test for date conversions
mysql-test/t/type_datetime.test:
  Added testcase for datetime to date conversion.
sql/CMakeLists.txt:
  Added library ws2_32 (needed if we want to compile with IOCP support)
sql/event_data_objects.cc:
  TIME -> MYSQL_TIME
sql/event_db_repository.cc:
  TIME -> MYSQL_TIME
sql/event_queue.cc:
  TIME -> MYSQL_TIME
sql/field.cc:
  Give note if we insert a datetime value in a date field
  Don't give notes if we are doing internal test conversions (like from convert_constant_item())
  More documentation (store functions can now return '3' to inform that the function did return a NOTE (not warning or error))
  Revert some changes in Field_newdate::store() to get more optimal code
  Field::set_warning() will now ignore notes if CHECK_FIELD_IGNORE is set.
  New parameters to make_truncated_value_warning()
sql/field.h:
  TIME -> MYSQL_TIME
sql/item.cc:
  New parameters to make_truncated_value_warning()
  Fixed get_date() to call number_to_datetime() if argument is not a string.
  Fixes Bug#23093 Implicit conversion of 9912101 to date does not match cast(9912101 as date)
sql/item.h:
  TIME -> MYSQL_TIME
sql/item_cmpfunc.cc:
  Don't print notes in convert_constant_item()
sql/item_func.h:
  TIME -> MYSQL_TIME
sql/item_timefunc.cc:
  New parameters to make_truncated_value_warning()
  Moved year 2000 handling out from calc_days()
  Don't return NULL for years < 200 in date_add/date_sub
sql/item_timefunc.h:
  TIME -> MYSQL_TIME
sql/my_decimal.cc:
  TIME -> MYSQL_TIME
sql/my_decimal.h:
  TIME -> MYSQL_TIME
sql/mysql_priv.h:
  Added error level to make_truncated_value_warning()
sql/protocol.cc:
  TIME -> MYSQL_TIME
sql/protocol.h:
  TIME -> MYSQL_TIME
sql/sp.cc:
  TIME -> MYSQL_TIME
sql/sql_base.cc:
  Make testing of result value of save_in_field() uniform
sql-common/my_time.c:
  Added year_2000_handling()
  Removed year 2000 handling from calc_daynr()
sql/sql_class.h:
  TIME -> MYSQL_TIME
sql/sql_show.cc:
  TIME -> MYSQL_TIME
sql/structs.h:
  TIME -> MYSQL_TIME
sql/time.cc:
  Added error level to make_truncated_value_warning()
sql/tztime.cc:
  TIME -> MYSQL_TIME
sql/tztime.h:
  TIME -> MYSQL_TIME
sql/unireg.cc:
  For default values to CREATE, don't give errors for warning level NOTE
  (Fixed failed CREATE when we give a datetime value to a date field)
strings/ctype-utf8.c:
  Fixed compiler failures
win/README:
  More comments
2007-03-23 22:08:31 +02:00
unknown
a220fc4892 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug27229


sql/item.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2007-03-22 14:51:20 -07:00
unknown
1f8bdbe4eb Fixed bug #27229: crash when a set function aggregated in outer
context was used as an argument of GROUP_CONCAT.
Ensured correct setting of the depended_from field in references
generated for set functions aggregated in outer selects.
A wrong value of this field resulted in wrong maps returned by 
used_tables() for these references.
Made sure that a temporary table field is added for any set function
aggregated in outer context when creation of a temporary table is 
needed to execute the inner subquery. 


mysql-test/r/subselect.result:
  Added a test case for bug #27229.
mysql-test/t/subselect.test:
  Added a test case for bug #27229.
sql/item.cc:
  Fixed bug #27229: crash when a set function aggregated in outer
  context was used as an argument of GROUP_CONCAT.
  Ensured correct setting of the depended_from field in references
  generated for set functions aggregated in outer selects.
sql/item_sum.cc:
  Fixed bug #27229: crash when a set function aggregated in outer
  context was used as an argument of GROUP_CONCAT.
  Added the field aggr_sel to the objects of the class Item_sum.
  In any Item_sum object created for a set function this field 
  has to contain a pointer to the select where the set function
  is aggregated.
sql/item_sum.h:
  Fixed bug #27229: crash when a set function aggregated in outer
  context was used as an argument of GROUP_CONCAT.
  Added the field aggr_sel to the objects of the class Item_sum.
  In any Item_sum object created for a set function this field 
  has to contain a pointer to the select where the set function
  is aggregated.
  Added a method that says whether a set function is aggregated
  in outer context and, if so, returns the aggregating select.
  Removed the field nest_level_tables_count introduced by the
  patch for bug 24484 as aggr_sel->join->tables contains the
  sane number.
sql/sql_base.cc:
  Fixed bug #27229: crash when a set function aggregated in outer
  context was used as an argument of GROUP_CONCAT.
  Added the field aggr_sel to the objects of the class Item_sum.
  Removed changes introduced by the patch for bug 24484 as 
  the field leaf_count of the THD class is not used anymore.
sql/sql_class.h:
  Fixed bug #27229: crash when a set function aggregated in outer
  context was used as an argument of GROUP_CONCAT.
  Added the field aggr_sel to the objects of the class Item_sum.
  Removed changes introduce by the patch for bug 24484 as 
  the field leaf_count of the THD class is not used anymore.
sql/sql_insert.cc:
  Fixed bug #27229: crash when a set function aggregated in outer
  context was used as an argument of GROUP_CONCAT.
  Added the field aggr_sel to the objects of the class Item_sum.
  Removed changes introduce by the patch for bug 24484 as 
  the field leaf_count of the THD class is not used anymore.
sql/sql_select.cc:
  Fixed bug #27229: crash when a set function aggregated in outer
  context was used as an argument of GROUP_CONCAT.
  When creating a temporary table a field is added in it for any 
  set function aggregated in outer context.
2007-03-22 14:48:03 -07:00
unknown
2c5395eedb Merge mysql.com:/home/hf/work/mrg/mysql-5.0-opt
into  mysql.com:/home/hf/work/mrg/mysql-5.1-opt


mysql-test/r/insert_select.result:
  Auto merged
mysql-test/t/insert_select.test:
  Auto merged
sql/field.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/sql_select.h:
  Auto merged
mysql-test/r/create.result:
  merging
mysql-test/r/temp_table.result:
  SCCS merged
mysql-test/r/type_float.result:
  merging
mysql-test/r/union.result:
  merging
mysql-test/t/temp_table.test:
  merging
2007-03-22 23:59:20 +04:00
unknown
a9df90a793 Merge mhansson@bk-internal:/home/bk/mysql-5.0-opt
into  linux-st28.site:/home/martin/mysql/src/5.0o-bug24791


sql/item.cc:
  Auto merged
2007-03-22 13:37:27 +01:00
unknown
aa32336198 Bug #24791: Union with AVG-groups generates wrong results
The problem in this bug is when we create temporary tables. When
temporary tables are created for unions, there is some 
inferrence being carried out regarding the type of the column.
Whenever this column type is inferred to be REAL (i.e. FLOAT or
DOUBLE), MySQL will always try to maintain exact precision, and
if that is not possible (there are hardware limits, since FLOAT
and DOUBLE are stored as approximate values) will switch to
using approximate values. The problem here is that at this point
the information about number of significant digits is not 
available. Furthermore, the number of significant digits should
be increased for the AVG function, however, this was not properly 
handled. There are 4 parts to the problem:

#1: DOUBLE and FLOAT fields don't display their proper display 
lengths in max_display_length(). This is hard-coded as 53 for 
DOUBLE and 24 for FLOAT. Now changed to instead return the 
field_length.

#2: Type holders for temporary tables do not preserve the 
max_length of the Item's from which they are created, and is 
instead reverted to the 53 and 24 from above. This causes 
*all* fields to get non-fixed significant digits.

#3: AVG function does not update max_length (display length)
when updating number of decimals.

#4: The function that switches to non-fixed number of 
significant digits should use DBL_DIG + 2 or FLT_DIG + 2 as 
cut-off values (Since fixed precision does not use the 'e' 
notation)

Of these points, #1 is the controversial one, but this 
change is preferred and has been cleared with Monty. The 
function causes quite a few unit tests to blow up and they had
to b changed, but each one is annotated and motivated. We 
frequently see the magical 53 and 24 give way to more relevant
numbers.


mysql-test/r/create.result:
  bug#24791
  
  changed test result
  
  With the changes made for FLOAT and DOUBLE, the original display
  lengths are now preserved.
mysql-test/r/temp_table.result:
  bug#24791
  
  changed test resullt
  
  Test case added
mysql-test/r/type_float.result:
  bug#24791
  
  changed test result
  
  delta 1: field was originally declared as DOUBLE with no display
  length, so the hardware maximum is chosen rather than 53.
  
  delta 2: fields exceed the maximum precision and thus switch to
  non-fixed significant digits
  
  delta 3: Same as above, number of decmals and significant digits
  was not specified when t3 was created.
mysql-test/t/temp_table.test:
  bug#24791
  
  Test case
sql/field.h:
  bug#24791
  
  The method max_display_length is reimplemented as
  
  uint32 max_display_length() { return field_length; }
  
  in Field_double and Field_float. Since all subclasses of 
  Field_real now have the same implementation of this method, the
  implementation has been moved up the hierarchy to Field_real.
sql/item.cc:
  bug#24791
  
  We switch to a non-fixed number of significant digits
  (by setting decimals=NOT_FIXED_DECIMAL) if the calculated 
  display length is greater than the display length of a value 
  with the maximum precision. These values differ for double and 
  float, obviously.
sql/item_sum.cc:
  bug#24791
  
  We must increase the display length accordinly whenever we 
  change number of decimal places.
2007-03-22 10:56:47 +01:00
unknown
e9bb08ac0c Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.local:/opt/local/work/mysql-5.1-runtime


include/my_global.h:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/events_scheduling.result:
  Auto merged
BitKeeper/deleted/.del-init_db.sql~a77d572c39d5a1f8:
  Auto merged
BitKeeper/deleted/.del-mysql_create_system_tables.sh:
  Auto merged
mysql-test/r/query_cache.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/events_scheduling.test:
  Auto merged
mysql-test/t/grant_cache.test:
  Auto merged
mysql-test/t/query_cache.test:
  Auto merged
mysql-test/t/view.test:
  Auto merged
scripts/mysql_system_tables_fix.sql:
  Auto merged
sql/event_db_repository.cc:
  Auto merged
sql/event_queue.cc:
  Auto merged
sql/field.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_subselect.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/sp.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_help.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
sql/tztime.cc:
  Auto merged
storage/innobase/handler/ha_innodb.cc:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/ha_myisam.h:
  Auto merged
mysql-test/r/skip_grants.result:
  Manualmerge.
mysql-test/r/sp.result:
  Manualmerge.
mysql-test/t/skip_grants.test:
  Manualmerge.
mysql-test/t/sp.test:
  Manualmerge.
sql/event_data_objects.cc:
  Manualmerge.
2007-03-20 00:42:11 +03:00
unknown
14ab9bef52 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-runtime


sql/field.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/r/sp.result:
  SCCS merged
mysql-test/t/sp.test:
  SCCS merged
2007-03-19 23:59:53 +03:00
unknown
34a0de585a Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-runtime
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-26503-merge


mysql-test/t/sp-error.test:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2007-03-14 15:36:11 -06:00
unknown
f3a731cadd Merge magare.gmz:/home/kgeorge/mysql/autopush/B26794-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B26794-merge-5.1-opt


mysql-test/r/select.result:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
mysql-test/r/alter_table.result:
  merged 5.0-opt -> 5.1-opt
mysql-test/r/gis-rtree.result:
  merged 5.0-opt -> 5.1-opt
mysql-test/r/order_by.result:
  merged 5.0-opt -> 5.1-opt
mysql-test/r/subselect.result:
  merged 5.0-opt -> 5.1-opt
mysql-test/t/alter_table.test:
  merged 5.0-opt -> 5.1-opt
mysql-test/t/order_by.test:
  merged 5.0-opt -> 5.1-opt
mysql-test/t/subselect.test:
  merged 5.0-opt -> 5.1-opt
2007-03-14 17:04:45 +02:00
unknown
f0c5044096 WL#3527 : inspected a 5.1 covarage report
sql/item.cc:
  WL#3527 : inspected a covarage report
2007-03-14 13:32:12 +02:00
unknown
13c05162f3 Fixed bug #26963: invalid optimization of the pushdown conditions
after single-row table substitution could lead to a wrong result set.
The bug happened because the function Item_field::replace_equal_field
erroniously assumed that any field included in a multiple equality
with a constant has been already substituted for this constant.
This not true for fields becoming constant after row substitutions
for constant tables.
 


mysql-test/r/select.result:
  Added a test case for bug #26963.
mysql-test/t/select.test:
  Added a test case for bug #26963.
sql/item.cc:
  Fixed bug #26963: invalid optimization of the pushdown conditions
  after single-row table substitution could lead to a wrong result set.
  The bug happened because the function Item_field::replace_equal_field
  erroneously assumed that any field included in a multiple equality
  with a constant has been already substituted for this constant.
  This not true for fields becoming constant after row substitutions
  for constant tables.
2007-03-11 23:34:40 -07:00
unknown
00a1814954 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/WL3527-5.1-opt


sql/item.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
2007-03-11 10:17:09 +02:00
unknown
8a140cb72e Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/bk-trees/mysql-5.1-opt


mysql-test/r/explain.result:
  Auto merged
mysql-test/r/func_default.result:
  Auto merged
mysql-test/r/func_regexp.result:
  Auto merged
mysql-test/r/func_test.result:
  Auto merged
mysql-test/r/having.result:
  Auto merged
mysql-test/r/olap.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/union.result:
  Auto merged
mysql-test/r/varbinary.result:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sql_union.cc:
  Auto merged
mysql-test/r/func_str.result:
  Manually merged
mysql-test/t/func_str.test:
  Manually merged
2007-03-11 00:26:45 +03:00
unknown
c0a0543545 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/25373-bug-5.0-opt-mysql


mysql-test/r/func_str.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/union.result:
  Auto merged
sql/item.cc:
  Auto merged
2007-03-10 19:53:59 +03:00
unknown
944030aef7 Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
away.

Additional fix for bug#22331. Now Item_field prints its value in the case of
the const field.


mysql-test/r/varbinary.result:
  Corrected test case after fix for bug#22331.
mysql-test/r/union.result:
  Corrected test case after fix for bug#22331.
mysql-test/r/subselect.result:
  Corrected test case after fix for bug#22331.
mysql-test/r/func_test.result:
  Corrected test case after fix for bug#22331.
mysql-test/r/having.result:
  Corrected test case after fix for bug#22331.
mysql-test/r/func_regexp.result:
  Corrected test case after fix for bug#22331.
mysql-test/r/func_str.result:
  Corrected test case after fix for bug#22331.
mysql-test/r/func_default.result:
  Corrected test case after fix for bug#22331.
mysql-test/r/explain.result:
  Corrected test case after fix for bug#22331.
sql/sql_union.cc:
  Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
  away.
  Cleanup of the SELECT_LEX::order_list list.
sql/item.h:
  Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
  away.
  Added the print() member function to the Item_field class.
sql/item.cc:
  Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
  away.
  Added the print() member function to the Item_field class.
2007-03-10 00:29:02 +03:00
unknown
8555b8d7ab Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/WL3527-5.1-opt


BitKeeper/deleted/.del-sql_parse.cc.rej:
  Auto merged
BitKeeper/deleted/.del-table.cc.rej:
  Auto merged
mysql-test/r/endspace.result:
  Auto merged
mysql-test/t/group_by.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_help.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
BitKeeper/deleted/.del-mysqld.cc.rej~35c1c438e11ebd89:
  Auto merged
mysql-test/r/group_by.result:
  manual merge to 5.1-opt
sql/mysqld.cc:
  manual merge to 5.1-opt
sql/sql_base.cc:
  manual merge to 5.1-opt
sql/sql_select.cc:
  manual merge to 5.1-opt
sql/table.h:
  manual merge to 5.1-opt
2007-03-09 17:54:13 +02:00
unknown
209802eb79 Merge mysql.com:/home/hf/work/mrg/mysql-5.0-opt
into  mysql.com:/home/hf/work/mrg/mysql-5.1-opt


mysql-test/r/union.result:
  Auto merged
mysql-test/t/union.test:
  Auto merged
sql/item.cc:
  Auto merged
2007-03-09 16:51:32 +04:00
unknown
e68df7a1ab Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  olga.mysql.com:/home/igor/mysql-5.0-opt


sql/item.cc:
  Auto merged
2007-03-09 02:45:17 -08:00
unknown
729bcaf430 Fixed bug #26661: crash when order by clause in a union
construct references invalid name.
Derived tables currently cannot use outer references.
Thus there is no outer context for them.
The 4.1 code takes this fact into account while the 
Item_field::fix_outer_field code of 5.0 lost the check that blocks
any attempts to resolve names in outer context for derived tables.


mysql-test/r/union.result:
  Added a test case for bug #26661.
mysql-test/t/union.test:
  Added a test case for bug #26661.
sql/item.cc:
  Fixed bug #26661.
  Derived tables currently cannot use outer references.
  Thus there is no outer context for them.
  The 4.1 code takes this fact into account while the 
  Item_field::fix_outer_field code of 5.0 lost the check that blocks
  any attempts to resolve names in outer context for derived tables.
2007-03-09 01:45:32 -08:00
unknown
a0521cd749 Polishing: use constants instead of magic numbers.
include/my_global.h:
  Introduce constants to be used instead of magic numbers.
sql/field.cc:
  Polishing: use contants instead of magic numbers.
sql/ha_innodb.cc:
  Polishing: use contants instead of magic numbers.
sql/handler.cc:
  Polishing: use contants instead of magic numbers.
sql/item.cc:
  Polishing: use contants instead of magic numbers.
sql/item.h:
  Polishing: use contants instead of magic numbers.
sql/item_func.cc:
  Polishing: use contants instead of magic numbers.
sql/item_subselect.cc:
  Polishing: use contants instead of magic numbers.
sql/log_event.cc:
  Polishing: use contants instead of magic numbers.
sql/sql_base.cc:
  Polishing: use contants instead of magic numbers.
sql/sql_select.cc:
  Polishing: use contants instead of magic numbers.
sql/sql_show.cc:
  Polishing: use contants instead of magic numbers.
sql/sql_table.cc:
  Polishing: use contants instead of magic numbers.
2007-03-09 08:05:08 +03:00
unknown
3d52be1584 Merge bk@192.168.21.1:mysql-5.1
into  mysql.com:/home/hf/work/mrg/mysql-5.1-opt


mysql-test/r/order_by.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/t/order_by.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_load.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
mysql-test/r/func_str.result:
  merging
mysql-test/r/sp.result:
  merging
mysql-test/r/view.result:
  merging
mysql-test/t/func_str.test:
  merging
mysql-test/t/view.test:
  merging
2007-03-08 22:04:17 +04:00
unknown
12af658570 Merge bk@192.168.21.1:mysql-5.0
into  mysql.com:/home/hf/work/mrg/mysql-5.0-opt


mysql-test/r/order_by.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/t/order_by.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_load.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
mysql-test/r/func_str.result:
  merging
mysql-test/r/sp.result:
  merging
mysql-test/r/view.result:
  merging
mysql-test/t/func_str.test:
  merging
mysql-test/t/view.test:
  merging
2007-03-08 21:42:41 +04:00
unknown
52ce1b7358 Merge mysql.com:/home/hf/work/mrg/mysql-5.0-opt
into  mysql.com:/home/hf/work/mrg/mysql-5.1-opt


BUILD/check-cpu:
  Auto merged
mysql-test/r/explain.result:
  Auto merged
mysql-test/r/func_str.result:
  Auto merged
mysql-test/r/func_test.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/update.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/explain.test:
  Auto merged
mysql-test/t/func_str.test:
  Auto merged
mysql-test/t/sp.test:
  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_strfunc.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_load.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.h:
  Auto merged
sql/sql_update.cc:
  Auto merged
mysql-test/r/func_in.result:
  SCCS merged
mysql-test/r/order_by.result:
  SCCS merged
mysql-test/r/sp.result:
  merging
mysql-test/t/func_in.test:
  SCCS merged
mysql-test/t/order_by.test:
  SCCS merged
mysql-test/t/view.test:
  merging
sql/item_cmpfunc.h:
  merging
sql/mysql_priv.h:
  merging
sql/sql_select.cc:
  SCCS merged
2007-03-08 19:08:28 +04:00
unknown
79542930ea WL#3527: Extend IGNORE INDEX so places where index is ignored
can be specified
Currently MySQL allows one to specify what indexes to ignore during
join optimization. The scope of the current USE/FORCE/IGNORE INDEX 
statement is only the FROM clause, while all other clauses are not 
affected.

However, in certain cases, the optimizer
may incorrectly choose an index for sorting and/or grouping, and
produce an inefficient query plan.

This task provides the means to specify what indexes are
ignored/used for what operation in a more fine-grained manner, thus
making it possible to manually force a better plan. We do this
by extending the current IGNORE/USE/FORCE INDEX syntax to:

IGNORE/USE/FORCE INDEX [FOR {JOIN | ORDER | GROUP BY}]

so that:
- if no FOR is specified, the index hint will apply everywhere.
- if MySQL is started with the compatibility option --old_mode then
  an index hint without a FOR clause works as in 5.0 (i.e, the 
  index will only be ignored for JOINs, but can still be used to
  compute ORDER BY).

See the WL#3527 for further details.


BitKeeper/deleted/.del-mysqld.cc.rej:
  Rename: sql/mysqld.cc.rej -> BitKeeper/deleted/.del-mysqld.cc.rej
BitKeeper/deleted/.del-sql_parse.cc.rej:
  Rename: sql/sql_parse.cc.rej -> BitKeeper/deleted/.del-sql_parse.cc.rej
BitKeeper/deleted/.del-table.cc.rej:
  Rename: sql/table.cc.rej -> BitKeeper/deleted/.del-table.cc.rej
mysql-test/r/endspace.result:
  WL3527 : fixed undeterministic test
mysql-test/r/group_by.result:
  WL#3527: test cases
mysql-test/t/endspace.test:
  WL3527 : fixed undeterministic test
mysql-test/t/group_by.test:
  WL#3527: test cases
sql/item.cc:
  WL#3527: renames
sql/mysql_priv.h:
  WL#3527: corrected initialization
sql/mysqld.cc:
  WL#3527: added old_mode command line option
sql/opt_range.cc:
  WL#3527: renames
sql/sql_base.cc:
  WL#3527: 
   - renames
   - correct initialization
   - extended the processing of USE/FORCE/IGNORE index
sql/sql_class.h:
  WL#3527: added old_mode command line option
sql/sql_delete.cc:
  WL#3527: renames
sql/sql_help.cc:
  WL#3527: renames
sql/sql_lex.cc:
  WL#3527: extended parsing of USE/FORCE/IGNORE index
sql/sql_lex.h:
  WL#3527: extended parsing of USE/FORCE/IGNORE index
sql/sql_parse.cc:
  WL#3527: extended parsing of USE/FORCE/IGNORE index
sql/sql_select.cc:
  WL#3527:
   - renames
   - passing additional info to support the extended 
     USE/FORCE/IGNORE INDEX syntax
   - If there is a covering index, and we have 
     IGNORE INDEX FOR GROUP/ORDER, and this index is 
     used for the JOIN part, then we have to ignore the
     IGNORE INDEX FOR GROUP/ORDER.
sql/sql_show.cc:
  WL#3527: passing additional info to support the extended 
     USE/FORCE/IGNORE INDEX syntax
sql/sql_update.cc:
  WL#3527: renames
sql/sql_yacc.yy:
  WL#3527: extended parsing of USE/FORCE/IGNORE index
sql/table.cc:
  WL#3527: extended the processing of USE/FORCE/IGNORE index
sql/table.h:
  WL#3527: extended the processing of USE/FORCE/IGNORE index
storage/myisam/ha_myisam.cc:
  WL#3527: extended the processing of USE/FORCE/IGNORE index
2007-03-05 19:08:41 +02:00
unknown
6da758c216 Fixed bug #26560.
The flag alias_name_used was not set on for the outer references
in subqueries. It resulted in replacement of any outer reference
resolved against an alias for a full field name when the frm 
representation of a view with a subquery was generated. 
If the subquery and the outer query referenced the same table in
their from lists this replacement effectively changed the meaning
of the view and led to wrong results for selects from this view. 

Modified several functions to ensure setting the right value of
the alias_name_used flag for outer references resolved against
aliases.
 


mysql-test/r/view.result:
  Added a test case for bug #26560.
mysql-test/t/view.test:
  Added a test case for bug #26560.
sql/item.cc:
  Fixed bug #26560.
  Made the function resolve_ref_in_select_and_group analyze the return
  value of the last parameter with the type of the name resolution for
  the submitted reference. If the reference has been resolved against 
  an alias name from select list then its flag alias_name_used is set on.
  Now this value is used in Item_field::fix_outer_field to initialize the flag
  when the item_ref object is created for an outer reference.
  Added a parameter for the second Item_ref::Item_ref constructor to initialize
  properly the flag alias_name_used. The default value of the parameter is FALSE.
  If this flag is set on at the creation of an object by this constructor it
  will never be changed. Corrected appropriately the Item_ref::set_properties
  function.
  The function Item_ref::print now prints alias name for an outer reference
  if the flag alias_name_used is set on.
sql/item.h:
  Fixed bug #26560.
  Added a parameter for the second Item_ref::Item_ref constructor to initialize
  properly the flag alias_name_used. The default value of the parameter is FALSE.
  A similar change has been applied to the first Item_direct_ref::Item_direct_ref
  constructor.
sql/mysql_priv.h:
  Fixed bug #26560.
  Added an an enumeration type enum_resolution_type to return info on
  how the function find_item_in_list has resolved the submitted item.
  The type is used only for this function.
sql/sql_base.cc:
  Fixed bug #26560.
  Made the last parameter of the function find_field_in_tables return
  more detailed information on how the submitted item has been resolved.
  Now it says whether the item has been resolved
    against an alias name,
    or as a field name without alias,
    or as a field name hidden by alias, 
    or was resolved ignoring alias.
sql/sql_select.cc:
  Fixed bug #26560.
  Took into account the new type of the last parameter of the function
  find_item_in_list.
2007-03-04 19:54:35 -08:00
unknown
4a9edcc32c Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.0
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint


BitKeeper/etc/ignore:
  auto-union
client/mysqltest.c:
  Auto merged
extra/comp_err.c:
  Auto merged
include/my_time.h:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/mysqltest.result:
  Auto merged
mysql-test/r/type_blob.result:
  Auto merged
mysql-test/t/mysqltest.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_strfunc.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/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_load.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/tztime.cc:
  Auto merged
client/mysql_upgrade.c:
  Manual merge
mysql-test/mysql-test-run.pl:
  Manual merge
mysql-test/r/ctype_cp932.result:
  Manual merge
mysql-test/r/mysqlbinlog.result:
  Manual merge
mysql-test/t/ctype_cp932.test:
  Manual merge
mysql-test/t/mysql.test:
  Manual merge
mysql-test/t/mysqlbinlog.test:
  Manual merge
2007-03-01 18:12:56 +01:00
unknown
8fa6ce5860 Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.1
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-maint


BitKeeper/etc/ignore:
  auto-union
extra/comp_err.c:
  Auto merged
include/my_pthread.h:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/mix2_myisam.result:
  Auto merged
mysql-test/r/mysqltest.result:
  Auto merged
mysql-test/r/type_blob.result:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
mysql-test/t/mysqltest.test:
  Auto merged
sql/Makefile.am:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/tztime.cc:
  Auto merged
client/mysqltest.c:
  Manual merge
mysql-test/mysql-test-run.pl:
  Manual merge
sql/mysqld.cc:
  Manual merge
2007-03-01 14:53:32 +01:00
unknown
536adef69d Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_union.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2007-02-26 17:46:52 +04:00
unknown
de5d4e32fb Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_union.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2007-02-26 16:57:45 +04:00
unknown
b10600528d Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt


mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/insert_update.result:
  Auto merged
mysql-test/r/myisam.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/r/subselect3.result:
  Auto merged
mysql-test/r/type_blob.result:
  Auto merged
mysql-test/t/insert_update.test:
  Auto merged
mysql-test/t/select.test:
  Auto merged
BitKeeper/deleted/.del-bdb.result:
  Auto merged
mysql-test/extra/binlog_tests/blackhole.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_union.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
storage/blackhole/ha_blackhole.cc:
  Auto merged
mysql-test/r/binlog_stm_blackhole.result:
  manual merge
mysql-test/r/insert_select.result:
  manual merge
mysql-test/r/subselect.result:
  manual merge
mysql-test/r/update.result:
  manual merge
mysql-test/t/insert_select.test:
  manual merge
mysql-test/t/subselect.test:
  manual merge
sql/sql_help.cc:
  manual merge
sql/sql_insert.cc:
  manual merge
sql/sql_update.cc:
  manual merge
2007-02-26 15:54:43 +04:00
unknown
90d4f80922 item.cc, item.h:
Post fix for bug#23800.


sql/item.h:
  Post fix for bug#23800.
sql/item.cc:
  Post fix for bug#23800.
2007-02-26 09:01:43 +03:00
unknown
b1e1f77f1f item.cc:
Post fix for bug#23800.
  The Item_field constructor now increases the select_n_where_fields counter.
sql_yacc.yy:
  Post fix for bug#23800.
  Take into account fields that might be added by subselects.
sql_lex.h:
  Post fix for bug#23800.
  Added the select_n_where_fields variable to the st_select_lex class.
sql_lex.cc:
  Post fix for bug#23800.
  Initialization of the select_n_where_fields variable.


sql/sql_lex.cc:
  Post fix for bug#23800.
  Initialization of the select_n_where_fields variable.
sql/sql_lex.h:
  Post fix for bug#23800.
  Added the select_n_where_fields variable to the st_select_lex class.
sql/item.cc:
  Post fix for bug#23800.
  The Item_field constructor now increases the select_n_where_fields counter.
sql/sql_yacc.yy:
  Post fix for bug#23800.
  Take into account fields that might be added by subselects.
2007-02-24 23:04:15 +03:00
unknown
9e6784924a Fixed compiler warnings
Fixed compile-pentium64 scripts
Fixed wrong estimate of update_with_key_prefix in sql-bench
Merge bk-internal.mysql.com:/home/bk/mysql-5.1 into mysql.com:/home/my/mysql-5.1
Fixed unsafe define of uint4korr()
Fixed that --extern works with mysql-test-run.pl
Small trivial cleanups
This also fixes a bug in counting number of rows that are updated when we have many simultanous queries
Move all connection handling and command exectuion main loop from sql_parse.cc to sql_connection.cc
Split handle_one_connection() into reusable sub functions.
Split create_new_thread() into reusable sub functions.
Added thread_scheduler; Preliminary interface code for future thread_handling code.

Use 'my_thread_id' for internal thread id's
Make thr_alarm_kill() to depend on thread_id instead of thread
Make thr_abort_locks_for_thread() depend on thread_id instead of thread
In store_globals(), set my_thread_var->id to be thd->thread_id.
Use my_thread_var->id as basis for my_thread_name()
The above changes makes the connection we have between THD and threads more soft.

Added a lot of DBUG_PRINT() and DBUG_ASSERT() functions
Fixed compiler warnings
Fixed core dumps when running with --debug
Removed setting of signal masks (was never used)
Made event code call pthread_exit() (portability fix)
Fixed that event code doesn't call DBUG_xxx functions before my_thread_init() is called.
Made handling of thread_id and thd->variables.pseudo_thread_id uniform.
Removed one common 'not freed memory' warning from mysqltest
Fixed a couple of usage of not initialized warnings (unlikely cases)
Suppress compiler warnings from bdb and (for the moment) warnings from ndb


BitKeeper/deleted/.del-SETUP.sh.rej:
  Rename: BUILD/SETUP.sh.rej -> BitKeeper/deleted/.del-SETUP.sh.rej
BitKeeper/deleted/.del-configure.in.rej:
  Rename: configure.in.rej -> BitKeeper/deleted/.del-configure.in.rej
BitKeeper/deleted/.del-my_global.h.rej:
  Rename: include/my_global.h.rej -> BitKeeper/deleted/.del-my_global.h.rej
BitKeeper/deleted/.del-my_pthread.h.rej:
  Rename: include/my_pthread.h.rej -> BitKeeper/deleted/.del-my_pthread.h.rej
BitKeeper/deleted/.del-mysql_client_test.c.rej:
  Rename: tests/mysql_client_test.c.rej -> BitKeeper/deleted/.del-mysql_client_test.c.rej
BitKeeper/deleted/.del-mysqld.cc.rej~35c1c438e11ebd89:
  Rename: sql/mysqld.cc.rej -> BitKeeper/deleted/.del-mysqld.cc.rej~35c1c438e11ebd89
BitKeeper/deleted/.del-sql_parse.cc.rej:
  Rename: sql/sql_parse.cc.rej -> BitKeeper/deleted/.del-sql_parse.cc.rej
BitKeeper/deleted/.del-table.cc.rej:
  Rename: sql/table.cc.rej -> BitKeeper/deleted/.del-table.cc.rej
BitKeeper/deleted/.del-thr_alarm.c.rej:
  Rename: mysys/thr_alarm.c.rej -> BitKeeper/deleted/.del-thr_alarm.c.rej
BUILD/compile-pentium64:
  Update this to be in line with compile-pentium
BUILD/compile-pentium:
  Send command line options to SETUP.sh
BUILD/compile-solaris-sparc-debug:
  Update scripts
BUILD/compile-solaris-sparc-forte:
  Update scripts
BUILD/compile-solaris-sparc-purify:
  Update scripts
BUILD/compile-solaris-sparc:
  Update scripts
BitKeeper/deleted/.del-DbtupSystemRestart.cpp~15b54d7e4e75d2d:
  Removed compiler warning
BitKeeper/deleted/.del-ha_berkeley.cc:
  Moved get_auto_primary_key() here as int5store() gives (wrong) compiler warnings in win64
configure.in:
  Added detection of port_create and port.h (for future)as 
  ---
  manual merge
BitKeeper/deleted/.del-ha_berkeley.h:
  Moved get_auto_primary_key() to ha_berkeley.cc
BitKeeper/deleted/.del-mysqlmanager.c~e97636d71145a0b:
  Fixed compiler warnings
BitKeeper/etc/ignore:
  added storage/ndb/src/ndbapi/ndberror_check
client/mysqlbinlog.cc:
  Removed not needed 'static' (caused compiler warning)
client/mysqldump.c:
  Fixed compiler warnings from 'max' build
client/mysqltest.c:
  Free warning and query memory no abort.
  (Removes strange warnings on screen if mysql-test-run fails)
  Removed compiler warnings
  Portability fix for windows (windows doesn't have mode_t)
client/sql_string.h:
  Removed compiler warning
cmd-line-utils/readline/xmalloc.c:
  Fixed compiler warnings from 'max' build
extra/charset2html.c:
  Fixed compiler warnings
extra/comp_err.c:
  Fixed compiler warnings from 'max' build
extra/yassl/include/lock.hpp:
  Fix for windows64
extra/yassl/include/openssl/ssl.h:
  Changed prototype for SSL_set_fd() to fix compiler warnings (and possible errors) on windows 64 bit
extra/yassl/include/socket_wrapper.hpp:
  Moved socket_t to ssl.h, to be able to removed compiler warnings on windows 64 bit
extra/yassl/include/yassl.hpp:
  Fix for windows64
extra/yassl/src/ssl.cpp:
  Removed compiler warning
  Detect wrong parameter (Happens when running test suite on solaris)
  Changed prototype for SSL_set_fd() to fix compiler warnings (and possible errors) on windows 64 bit
extra/yassl/taocrypt/src/integer.cpp:
  Fixed compiler warnings
extra/yassl/testsuite/testsuite.cpp:
  Removed compiler warning
include/config-win.h:
  Added HAVE_WINSOCK2 (for future)
include/my_dbug.h:
  Fixed DBUG_PROCESS() so that we don't get compiler warnings for it
include/my_global.h:
  Fixed unsafe define of uint4korr()
  manual merge (ignore changes from 5.0)
  Fixed warnings on win64 when using int5store and int6store
include/my_pthread.h:
  Added my_thread_id typedef
  Renamed 'my_thread_id() function to my_thead_dbug_id()
include/thr_alarm.h:
  Make thr_alarm_kill() to depend on thread_id instead of thread
include/thr_lock.h:
  Make thr_abort_locks_for_thread() depend on thread_id instead of thread
libmysql/libmysql.def:
  Fixed compiler warnings on win64
libmysqld/CMakeLists.txt:
  Added missing files
libmysqld/Makefile.am:
  Added new files
libmysqld/lib_sql.cc:
  Remove not needed code (store_globals() now takes care of things)
mysql-test/lib/mtr_report.pl:
  Removed wrong messages when using --extern
mysql-test/mysql-test-run.pl:
  Fixed that --extern works
  Print help on stdout instead of stderr (make it easier to pipe it to less)
  Fixed typo that caused mysql-test-run.pl to fail on Solaris
mysql-test/r/keywords.result:
  manual merge
mysql-test/r/ndb_lock.result:
  After merge fixes
mysql-test/r/ps.result:
  Portability fix
mysql-test/t/disabled.def:
  Disabled ndb_alter_table as this very often fails for me (and have done it for a long time)
mysql-test/t/keywords.test:
  manual merge
mysql-test/t/ndb_lock.test:
  Added other possible error code
mysql-test/t/ps.test:
  Portability fix (when compiling without DLOPEN)
mysql-test/t/wait_timeout.test:
  Don't run this if we are not using a thread per connection (as other thread_handling code may not support timeouts)
mysys/base64.c:
  Fixed compiler warnings on win64
mysys/mf_keycache.c:
  Fixed compiler warnings
mysys/my_getopt.c:
  Fixed compiler warning
mysys/my_init.c:
  Fixed compiler warning
  Re-indented long comment
mysys/my_thr_init.c:
  Always use mysys_var->id to generate thread name (makes things uniform accross thread implementations and thread usage)
  Always generate my_thread_name() when using DBUG
  Ensure mysys_var->pthread_self is set
  Fixed compiler warnings
mysys/ptr_cmp.c:
  Fixed compiler warnings from 'max' build
mysys/thr_alarm.c:
  Change thr_alarm_kill() to use mysys_var->id instead of thread id
  Fixed compiler warning on windows
mysys/thr_lock.c:
  Change thr_abort_locks_for_thread() to use mysys_var->id instead of thread id
  Add purecov statements around not tested code
  Fixed compiler warnings
mysys/thr_mutex.c:
  my_thread_id() -> my_thread_dbug_id()
server-tools/instance-manager/guardian.cc:
  Fixed compiler warning
server-tools/instance-manager/instance.cc:
  Fixed compiler warning
server-tools/instance-manager/mysql_connection.cc:
  Fixed compiler warnings
server-tools/instance-manager/mysqlmanager.cc:
  Fixed compiler warnings
sql/CMakeLists.txt:
  Added missing files
sql/Makefile.am:
  Added new files
sql/event_scheduler.cc:
  Added pthread_exit() calls
  Ensure DBUG_xxx calls are not made before my_thread_init()
  Use common functions to set up thread handling
sql/field.h:
  manual merge
sql/ha_ndbcluster.cc:
  Removed some trivial 'current_thd' calls
sql/handler.cc:
  Avoid warnings on KILL_CONNECTION
  Don't print out null pointer with printf()  (Causes crashes on Solaris)
sql/item.cc:
  Fixed compiler warnings from 'max' build
sql/item_cmpfunc.cc:
  After merge fixes
sql/item_func.cc:
  Merge embedded and normal code usage
  (GET_LOCK, RELEASE_LOCK now works on my_thread_id instead of pthread_t)
  Fixed compiler warning
sql/item_strfunc.cc:
  Fixed compiler warning
sql/item_timefunc.cc:
  Fixed compiler warnings
sql/lock.cc:
  Use (new) parameter to thr_abort_locks_for_thread()
sql/log.cc:
  Fixed compiler warning
sql/log_event.cc:
  Fixed compiler warnings about not used variable
sql/mysql_priv.h:
  Remove TEST_NO_THREADS (not needed with new scheduler interface)
  Added functions from sql_connect.cc and new functions from sql_parse.cc
sql/mysqld.cc:
  Use thread_scheduler structure to dispatch calls (make code more dynamic)
  Change --one-thread option to use thread_scheduler interface
  Made ONE_THREAD option independent of DBUG_BUILD
  --one-thread is now depricated. One should instead use '--thread-handling=no-threads'
  Remove not used uname() function.
  Split create_new_thread() into reusable sub functions.
  Preliminary interface code for future thread_handling code.
  Fixed compiler warnings
sql/parse_file.cc:
  Don't send zero pointer to fn_format() (Causes crashes when using --debug)
sql/repl_failsafe.cc:
  Setup pseudo_thread_id same way as other code
sql/set_var.cc:
  Added variables 'thread_handling'
  Prepare for future variable 'thread_pool_size'
  Fixed compiler warnings
sql/set_var.h:
  Fixed compiler warning
sql/slave.cc:
  Setup pseudo_thread_id same way as other code
  Removed not used signal mask
sql/sql_acl.cc:
  Fixed compiler warnings from 'max' build
sql/sql_base.cc:
  Fixed long comments
  Normalized variable setup
  Don't destroy value of thd->variables.pseduo_thread_id
  More DBUG_PRINT()'s
  More DBUG_ASSERT()'s
  Fixed compiler warnings from 'max' build
sql/sql_class.cc:
  Remove thd->real_id and thd->dbug_thread_id
  Added DBUG_ASSERT()
  Use thread_scheduler to signal threads to be killed.
  In THD::store_globals(), set my_thread_var->id to be thd->thread_id.
  Fixed compiler warnings
sql/sql_class.h:
  Use 'my_thread_id' for internal thread id's
  Remove not needed THD elements: block_signals and dbug_thread_id
  Added 'thread_scheduler' scheduling extension element to THD
sql/sql_insert.cc:
  After merge fixes
  (This actually fixes a bug in old code when many connections are in use)
  Setup pseudo_thread_id same way as other code
  Removed not used signal mask
  Initialize variable that may be used unitialized on error conditions (not fatal)
sql/sql_parse.cc:
  Move connection related code to sql_connect.cc
  Remove setting of signal mask (not needed)
  Ensure TABLE_LIST->alias is set for generated TABLE_LIST elements (fixed core dumps when running with --debug)
  Added previous 'optional' element to reset_mgh()
  Removed not needed DBUG_PRINT call
sql/sql_partition.cc:
  Fixed compiler warnings
sql/sql_prepare.cc:
  Removed not needed casts
  Fixed compiler warnings from 'max' build
sql/sql_select.cc:
  Fixed compiler warnings
sql-bench/bench-init.pl.sh:
  Added --one-missing-tests
sql-bench/example:
  Better example
sql-bench/run-all-tests.sh:
  Added --only-missing-tests
sql-bench/test-insert.sh:
  Fixed wrong estimate of update_with_key_prefix
sql/sql_show.cc:
  Don't send pthread_kill() to threads to detect if they exists.
  (Not that useful and causes problems with future thread_handling code)
  Fixed compiler warnings
sql/sql_table.cc:
  Simplify code
  Fixed compiler warnings
sql/sql_test.cc:
  Remove dbug_thread_id from test output
sql/sql_view.cc:
  Don't send zero pointer to fn_format()
sql/tztime.cc:
  Fixed compiler warning
sql/udf_example.def:
  Fixed compiler warnings on win64
sql/unireg.cc:
  Initialize variable that may be used unitialized on error conditions
storage/archive/archive_test.c:
  Fixed compiler warnings
storage/archive/azio.c:
  Fixed compiler warnings
storage/innobase/dict/dict0crea.c:
  Fixed compiler warnings detected on windows64
storage/innobase/dict/dict0dict.c:
  Fixed compiler warnings detected on windows64
storage/innobase/dict/dict0load.c:
  Fixed compiler warnings detected on windows64
storage/innobase/dict/dict0mem.c:
  Fixed compiler warnings detected on windows64
storage/innobase/eval/eval0proc.c:
  Fixed compiler warnings detected on windows64
storage/innobase/handler/ha_innodb.cc:
  Fixed compiler warnings detected on windows64
storage/innobase/include/ut0byte.ic:
  Fixed compiler warnings on win64
storage/innobase/include/ut0ut.ic:
  Fixed compiler warnings on win64
storage/innobase/mtr/mtr0log.c:
  Fixed compiler warnings detected on windows64
storage/innobase/pars/pars0lex.l:
  Fixed warnings on win64
storage/innobase/rem/rem0cmp.c:
  Fixed compiler warnings detected on windows64
storage/innobase/row/row0mysql.c:
  Fixed compiler warnings detected on windows64
storage/innobase/row/row0sel.c:
  Fixed compiler warnings detected on windows64
storage/innobase/sync/sync0rw.c:
  Fixed compiler warnings detected on windows64
storage/innobase/trx/trx0trx.c:
  Fixed compiler warnings detected on windows64
storage/myisam/mi_log.c:
  my_thread_id() -> my_thread_debug_id()
storage/myisam/mi_packrec.c:
  Fixed compiler warnings detected on windows64
storage/myisam/myisamchk.c:
  Fixed compiler warnings from 'max' build
storage/ndb/src/common/debugger/EventLogger.cpp:
  Fixed compiler warnings
storage/ndb/src/common/util/ConfigValues.cpp:
  Removed compiler warnings
storage/ndb/src/common/util/NdbSqlUtil.cpp:
  Removed compiler warnings
storage/ndb/src/cw/cpcd/CPCD.hpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/backup/Backup.cpp:
  Fixed compiler warnings detected on windows64
storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp:
  Fixed compiler warnings detected on windows64
storage/ndb/src/kernel/blocks/dbacc/DbaccMain.cpp:
  Fixed compiler warnings detected on windows64
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dblqh/DblqhMain.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtc/DbtcMain.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/Dbtup.hpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/DbtupDiskAlloc.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/DbtupFixAlloc.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/DbtupMeta.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/DbtupRoutines.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/DbtupScan.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/DbtupVarAlloc.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/tuppage.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtup/tuppage.hpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/dbtux/DbtuxStat.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/blocks/diskpage.hpp:
  Fixed compiler warnings
storage/ndb/src/kernel/vm/ndbd_malloc.cpp:
  Fixed compiler warnings
storage/ndb/src/kernel/vm/ndbd_malloc_impl.cpp:
  Fixed compiler warnings
storage/ndb/src/mgmclient/main.cpp:
  Fixed compiler warnings
storage/ndb/src/ndbapi/NdbEventOperationImpl.cpp:
  Fixed compiler warnings
storage/ndb/src/ndbapi/NdbOperationExec.cpp:
  Fixed compiler warnings
storage/ndb/src/ndbapi/SignalSender.cpp:
  Fixed compiler warnings
storage/ndb/tools/restore/consumer_restore.cpp:
  Fixed compiler warnings
strings/ctype-ucs2.c:
  Fixed compiler warnings
strings/ctype-utf8.c:
  Fixed compiler warnings
strings/decimal.c:
  Fixed compiler warnings
strings/my_strchr.c:
  Fixed conflict between function and prototype
support-files/compiler_warnings.supp:
  Ignore warnings from sql_yacc.cc that are hard to remove
  Ignore some not important warnings from windows 64 bit build
  Suppress warnings from bdb and (for the moment) warnings from ndb
  Suppress all warnings for all pushbuild platforms (should make all trees green)
vio/viosslfactories.c:
  Added DBUG_PRINT
BUILD/compile-pentium64-max:
  New BitKeeper file ``BUILD/compile-pentium64-max''
libmysqld/scheduler.cc:
  New BitKeeper file ``libmysqld/scheduler.cc''
libmysqld/sql_connect.cc:
  New BitKeeper file ``libmysqld/sql_connect.cc''
mysql-test/include/one_thread_per_connection.inc:
  New BitKeeper file ``mysql-test/include/one_thread_per_connection.inc''
mysql-test/r/no-threads.result:
  New BitKeeper file ``mysql-test/r/no-threads.result''
mysql-test/r/one_thread_per_connection.require:
  New BitKeeper file ``mysql-test/r/one_thread_per_connection.require''
mysql-test/t/no-threads-master.opt:
  New BitKeeper file ``mysql-test/t/no-threads-master.opt''
mysql-test/t/no-threads.test:
  New BitKeeper file ``mysql-test/t/no-threads.test''
sql/scheduler.cc:
  New BitKeeper file ``sql/scheduler.cc''
sql/scheduler.h:
  New BitKeeper file ``sql/scheduler.h''
sql/sql_connect.cc:
  New BitKeeper file ``sql/sql_connect.cc''
2007-02-23 13:13:55 +02:00
unknown
50bd97a943 Fixed compiler warnings (for linux and win32 and win64)
Fixed a couple of usage of not initialized warnings (unlikely cases)


client/mysqldump.c:
  Fixed compiler warnings from 'max' build
client/mysqltest.c:
  Removed compiler warnings
cmd-line-utils/readline/xmalloc.c:
  Fixed compiler warnings from 'max' build
extra/comp_err.c:
  Fixed compiler warnings from 'max' build
extra/yassl/include/openssl/ssl.h:
  Changed prototype for SSL_set_fd() to fix compiler warnings (and possible errors) on windows 64 bit
extra/yassl/include/socket_wrapper.hpp:
  Moved socket_t to ssl.h, to be able to removed compiler warnings on windows 64 bit
extra/yassl/src/ssl.cpp:
  Changed prototype for SSL_set_fd() to fix compiler warnings (and possible errors) on windows 64 bit
extra/yassl/taocrypt/src/integer.cpp:
  Fixed compiler warnings
include/my_global.h:
  Added my_offsetof() macro from 5.1 to get rid of compiler warnings
innobase/include/ut0byte.ic:
  Fixed compiler warnings on win64
innobase/include/ut0ut.ic:
  Fixed compiler warnings on win64
libmysql/libmysql.def:
  Fixed compiler warnings on win64
myisam/mi_packrec.c:
  Fixed compiler warnings on win64
myisam/myisamchk.c:
  Fixed compiler warnings from 'max' build
mysys/base64.c:
  Fixed compiler warnings on win64
mysys/mf_keycache.c:
  Fixed compiler warnings from 'max' build
mysys/my_getopt.c:
  Fixed compiler warnings from 'max' build
mysys/my_init.c:
  Fixed compiler warnings from 'max' build
mysys/my_thr_init.c:
  Fixed compiler warnings
mysys/ptr_cmp.c:
  Fixed compiler warnings from 'max' build
ndb/include/kernel/signaldata/DictTabInfo.hpp:
  Fixed compiler warnings
server-tools/instance-manager/mysql_connection.cc:
  Fixed compiler warnings
server-tools/instance-manager/mysqlmanager.cc:
  Fixed compiler warnings
sql/filesort.cc:
  Initalize variable that was used unitialized in error conditions
sql/ha_berkeley.cc:
  Moved get_auto_primary_key() here as int5store() gives (wrong) compiler warnings in win64
sql/ha_berkeley.h:
  Moved get_auto_primary_key() to ha_berkeley.cc
sql/ha_innodb.cc:
  Fixed compiler warnings
sql/item.cc:
  Fixed compiler warnings from 'max' build
sql/item_timefunc.cc:
  Fixed compiler warnings
sql/mysqld.cc:
  Fixed compiler warnings
sql/sql_acl.cc:
  Fixed compiler warnings from 'max' build
sql/sql_base.cc:
  Fixed compiler warnings from 'max' build
sql/sql_insert.cc:
  Initialize variable that may be used unitialized on error conditions (not fatal)
sql/sql_prepare.cc:
  Fixed compiler warnings from 'max' build
sql/sql_select.cc:
  Fixed compiler warnings
sql/sql_show.cc:
  Fixed compiler warnings
sql/udf_example.def:
  Fixed compiler warnings on win64
sql/unireg.cc:
  Initialize variable that may be used unitialized on error conditions
strings/ctype-ucs2.c:
  Fixed compiler warnings
strings/ctype-utf8.c:
  Fixed compiler warnings
strings/decimal.c:
  Fixed compiler warnings
support-files/compiler_warnings.supp:
  Ignore warnings from sql_yacc.cc that are hard to remove
  Ignore some not important warnings from windows 64 bit build
tools/mysqlmanager.c:
  Fixed compiler warnings
2007-02-22 16:59:57 +02:00
unknown
a1234294c6 Merge moonbone.local:/mnt/gentoo64/work/bk-trees/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/23800-bug1-5.0-opt-mysql


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
2007-02-21 23:18:17 +03:00
unknown
f8855142d7 Bug#23800: Outer fields in correlated subqueries is used in a temporary table
created for sorting.

Any outer reference in a subquery was represented by an Item_field object.
If the outer select employs a temporary table all such fields should be
replaced with fields from that temporary table in order to point to the 
actual data. This replacement wasn't done and that resulted in a wrong
subquery evaluation and a wrong result of the whole query.

Now any outer field is represented by two objects - Item_field placed in the
outer select and Item_outer_ref in the subquery. Item_field object is
processed as a normal field and the reference to it is saved in the
ref_pointer_array. Thus the Item_outer_ref is always references the correct
field. The original field is substituted for a reference in the
Item_field::fix_outer_field() function.

New function called fix_inner_refs() is added to fix fields referenced from
inner selects and to fix references (Item_ref objects) to these fields.

The new Item_outer_ref class is a descendant of the Item_direct_ref class.
It additionally stores a reference to the original field and designed to
behave more like a field.


sql/item.cc:
  Bug#23800: Correlated sub query returning incorrect results when operated upon.
  Now all outer fields are substituted with references to them (Item_outer_ref objects)
  in the Item_field::fix_outer_field() function.
  The original field is saved in the Item_outer_ref object.
sql/item.h:
  Bug#23800: Correlated sub query returning incorrect results when operated upon.
  Added the Item_outer_ref class.
sql/mysql_priv.h:
  Bug#23800: Correlated sub query returning incorrect results when operated upon.
  Added the fix_inner_refs() function prototype.
sql/sql_delete.cc:
  Bug#23800: Correlated sub query returning incorrect results when operated upon.
  Added call to the fix_inner_refs() function.
sql/sql_select.cc:
  Bug#23800: Correlated sub query returning incorrect results when operated upon.
  The new function called fix_inner_refs() is added.
mysql-test/r/subselect.result:
  Added a test case for bug#23800: Correlated sub query returning incorrect results when
  operated upon.
sql/sql_update.cc:
  Bug#23800: Correlated sub query returning incorrect results when operated upon.
  Added call to the fix_inner_refs() function.
mysql-test/r/subselect3.result:
  Corrected test cases result after fix for bug#23800: Correlated sub query returning
  incorrect results when operated upon.
mysql-test/t/subselect.test:
  Added a test case for bug#23800: Correlated sub query returning incorrect results when
  operated upon.
sql/sql_lex.cc:
  Bug#23800: Correlated sub query returning incorrect results when operated upon.
  Added cleanup of the inner_refs_list.
sql/sql_lex.h:
  Bug#23800: Correlated sub query returning incorrect results when operated upon.
  The inner_refs_list is added to the SELECT_LEX class.
2007-02-21 23:00:32 +03:00
unknown
1384e64005 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0


BitKeeper/etc/ignore:
  auto-union
BUILD/SETUP.sh:
  Auto merged
Makefile.am:
  Auto merged
client/mysql.cc:
  Auto merged
cmd-line-utils/readline/display.c:
  Auto merged
configure.in:
  Auto merged
extra/yassl/include/buffer.hpp:
  Auto merged
extra/yassl/include/crypto_wrapper.hpp:
  Auto merged
extra/yassl/include/yassl_imp.hpp:
  Auto merged
extra/yassl/include/yassl_int.hpp:
  Auto merged
extra/yassl/src/crypto_wrapper.cpp:
  Auto merged
extra/yassl/taocrypt/include/algebra.hpp:
  Auto merged
extra/yassl/taocrypt/include/des.hpp:
  Auto merged
extra/yassl/taocrypt/include/hash.hpp:
  Auto merged
extra/yassl/taocrypt/include/hmac.hpp:
  Auto merged
extra/yassl/taocrypt/include/modarith.hpp:
  Auto merged
extra/yassl/taocrypt/include/modes.hpp:
  Auto merged
extra/yassl/taocrypt/include/rsa.hpp:
  Auto merged
extra/yassl/taocrypt/include/type_traits.hpp:
  Auto merged
extra/yassl/taocrypt/mySTL/list.hpp:
  Auto merged
extra/yassl/taocrypt/src/aes.cpp:
  Auto merged
extra/yassl/taocrypt/src/algebra.cpp:
  Auto merged
extra/yassl/testsuite/testsuite.cpp:
  Auto merged
include/my_global.h:
  Auto merged
include/my_pthread.h:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
myisam/mi_open.c:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/mysqltest.result:
  Auto merged
mysql-test/t/mysqltest.test:
  Auto merged
mysys/default.c:
  Auto merged
ndb/src/common/transporter/Transporter.cpp:
  Auto merged
ndb/src/common/util/File.cpp:
  Auto merged
ndb/src/common/util/SocketClient.cpp:
  Auto merged
ndb/src/kernel/blocks/cmvmi/Cmvmi.cpp:
  Auto merged
ndb/src/kernel/blocks/dbtc/Dbtc.hpp:
  Auto merged
ndb/src/kernel/blocks/qmgr/Qmgr.hpp:
  Auto merged
ndb/src/kernel/blocks/qmgr/QmgrMain.cpp:
  Auto merged
ndb/src/mgmapi/mgmapi.cpp:
  Auto merged
ndb/src/mgmclient/CommandInterpreter.cpp:
  Auto merged
ndb/src/mgmsrv/ConfigInfo.cpp:
  Auto merged
ndb/src/mgmsrv/MgmtSrvr.cpp:
  Auto merged
ndb/src/ndbapi/ClusterMgr.hpp:
  Auto merged
ndb/src/ndbapi/Ndb.cpp:
  Auto merged
ndb/src/ndbapi/NdbScanOperation.cpp:
  Auto merged
ndb/src/ndbapi/SignalSender.cpp:
  Auto merged
sql/field.cc:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/ha_myisammrg.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_subselect.h:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/net_serv.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/opt_range.h:
  Auto merged
sql/repl_failsafe.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_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_union.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql-common/client.c:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/unireg.cc:
  Auto merged
extra/yassl/taocrypt/src/asn.cpp:
  Manual merge (Fix shadowed variable name)
extra/yassl/taocrypt/test/test.cpp:
  No changes
ndb/src/common/util/ConfigValues.cpp:
  Manual merge (Fix shadowed variable name)
sql/field.h:
  manual merge
sql/ha_myisam.cc:
  manual merge
sql/ha_ndbcluster.cc:
  manual merge
sql/item_cmpfunc.cc:
  manual merge
sql/item_subselect.cc:
  Manual merge (Fix shadowed variable name)
sql/mysqld.cc:
  no changes
2007-02-21 14:07:08 +02:00
unknown
98f87d9702 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/16630-bug-5.0-opt-mysql


sql/item.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2007-02-16 19:44:54 +03:00
unknown
d5813a06f6 Bug#16630: The update fields of the INSERT .. SELECT .. ON DUPLICATE KEY
UPDATE contains wrong data if the SELECT employs a temporary table.

If the UPDATE values of the INSERT .. SELECT .. ON DUPLICATE KEY UPDATE
statement contains fields from the SELECT part and the select employs a
temporary table then those fields will contain wrong values because they
aren't corrected to get data from the temporary table.

The solution is to add these fields to the selects all_fields list,
to store pointers to those fields in the selects ref_pointer_array and
to access them via Item_ref objects.

The substitution for Item_ref objects is done in the new function called 
Item_field::update_value_transformer(). It is called through the
item->transform() mechanism at the end of the select_insert::prepare()
function.


sql/item.cc:
  Bug#16630: The update fields of the INSERT .. SELECT .. ON DUPLICATE KEY
  UPDATE contains wrong data if the SELECT employs a temporary table.
  The new method Item_field::update_value_transformer() is added. It
  substitutes fields in the update values list for references 
  (Item_ref objects) to them.
sql/item.h:
  Bug#16630: The update fields of the INSERT .. SELECT .. ON DUPLICATE KEY
  UPDATE contains wrong data if the SELECT employs a temporary table.
  The update_value_transformer() method is added to the Item and to the
  Item_field classes.
sql/sql_insert.cc:
  Bug#16630: The update fields of the INSERT .. SELECT .. ON DUPLICATE KEY
  UPDATE contains wrong data if the SELECT employs a temporary table.
  Traverse update values and substitute fields from the select for
  references (Item_ref objects) to them.
sql/sql_select.cc:
  Bug#16630: The update fields of the INSERT .. SELECT .. ON DUPLICATE KEY
  UPDATE contains wrong data if the SELECT employs a temporary table.
  Traverse update values and substitute fields from the select for
  references (Item_ref objects) to them.
mysql-test/r/insert_select.result:
  Added a test case for bug#16630: The update fields of the INSERT .. SELECT ..
  ON DUPLICATE KEY UPDATE contains wrong data if the SELECT employs a 
  temporary table.
mysql-test/t/insert_select.test:
  Added a test case for bug#16630: The update fields of the INSERT .. SELECT ..
  ON DUPLICATE KEY UPDATE contains wrong data if the SELECT employs a 
  temporary table.
2007-02-16 19:39:28 +03:00
unknown
2dbc0b8709 Merge calliope.local.cmiller:/Volumes/Source/src/mysql-5.0-maint
into  calliope.local.cmiller:/Volumes/Source/src/mysql-5.1-maint


mysql-test/r/order_by.result:
  Auto merged
mysql-test/t/order_by.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
2007-02-14 11:38:39 -05:00
unknown
48be0a2ff1 Merge calliope.local.cmiller:/Volumes/Source/src/mysql-4.1-maint--bug25126
into  calliope.local.cmiller:/Volumes/Source/src/mysql-5.0-maint


sql/item.cc:
  Auto merged
mysql-test/r/order_by.result:
  Manual merge.
mysql-test/t/order_by.test:
  Manual merge.
2007-02-14 11:27:37 -05:00
unknown
21df932dbd Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/mysql-5.1-opt


BitKeeper/etc/gone:
  auto-union
mysql-test/r/insert_select.result:
  Auto merged
mysql-test/r/join_outer.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/insert_select.test:
  Auto merged
mysql-test/t/join_outer.test:
  Auto merged
mysql-test/t/select.test:
  Auto merged
mysys/my_getopt.c:
  Auto merged
sql/field.h:
  Auto merged
sql/field_conv.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
mysql-test/include/mix1.inc:
  Manual merge
mysql-test/r/information_schema.result:
  Manual merge
mysql-test/r/innodb_mysql.result:
  Manual merge
mysql-test/t/information_schema.test:
  Manual merge
mysql-test/t/view.test:
  Manual merge
mysys/my_pthread.c:
  Manual merge
sql/mysql_priv.h:
  Manual merge
sql/opt_range.cc:
  Manual merge
sql/sql_insert.cc:
  Manual merge
sql/sql_update.cc:
  Manual merge
2007-02-13 01:34:36 -08:00
unknown
9292b57707 Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into  bk-internal.mysql.com:/data0/bk/mysql-5.1-opt


libmysqld/lib_sql.cc:
  Auto merged
sql/item.cc:
  Auto merged
2007-02-13 00:00:27 +01:00
unknown
4c2bc81ae7 Merge mysql.com:/home/hf/work/20691/my50-20691
into  mysql.com:/home/hf/work/25492/my50-25492


sql/item.cc:
  Auto merged
2007-02-13 01:23:23 +04:00
unknown
d30e1c76ae Merge mysql.com:/home/hf/work/20691/my50-20691
into  mysql.com:/home/hf/work/20691/my51-20691


mysql-test/r/default.result:
  Auto merged
sql/item.cc:
  Auto merged
mysql-test/r/gis.result:
  SCCS merged
mysql-test/t/gis.test:
  merging
2007-02-13 01:22:43 +04:00
unknown
07f36668ae bug #20691 (INSERT (DEFAULT) may insert garbage with NO DEFAULT NOT NULL field)
Some fields (GEOMETRY first of all) can't be handled properly in this
case at all. So we return an error in this case


mysql-test/r/default.result:
  result fixed
mysql-test/r/gis.result:
  result fixed
mysql-test/t/default.test:
  VIEW test added
mysql-test/t/gis.test:
  testcase added
sql/item.cc:
  set_defaults() changed with the 'reset()'
2007-02-12 15:41:36 +04:00
unknown
4c4f506238 Bug#25126: Reference to non-existant column in UPDATE...ORDER BY... crashes server
"update existingtable set anycolumn=nonexisting order by nonexisting" would crash
the server.

Though we would find the reference to a field, that doesn't mean we can then use
it to set some values.  It could be a reference to another field.  If it is NULL, 
don't try to use it to set values in the Item_field and instead return an error.

Over the previous patch, this signals an error at the location of the error, rather
than letting the subsequent deref signal it.


mysql-test/r/order_by.result:
  Verify that all permutations work.
mysql-test/t/order_by.test:
  Verify that all permutations work.
sql/item.cc:
  When the field is NULL, don't dereference it when we set_field().  
  Instead, raise an error.
2007-02-09 11:05:36 +01:00
unknown
79c51f21cb Addendum to fix of bug #22344 : removed dead code. 2007-02-09 11:05:23 +02:00
unknown
c35ceeca9e Bug #22344: InnoDB keys act strange on datetime vs timestamp comparison
Ignoring error codes from type conversion allows default (wrong) values to
 go unnoticed in the formation of index search conditions.
 Fixed by correctly checking for conversion errors.


mysql-test/r/select.result:
  Bug #22344: InnoDB keys act strange on datetime vs timestamp comparison
   - test case
mysql-test/t/select.test:
  Bug #22344: InnoDB keys act strange on datetime vs timestamp comparison
   - test case
sql/field.h:
  Bug #22344: InnoDB keys act strange on datetime vs timestamp comparison
   - don't ignore coversion errors
sql/field_conv.cc:
  Bug #22344: InnoDB keys act strange on datetime vs timestamp comparison
   - don't ignore coversion errors
sql/item.cc:
  Bug #22344: InnoDB keys act strange on datetime vs timestamp comparison
   - don't ignore coversion errors
2007-02-06 11:08:57 +02:00