Commit graph

1055 commits

Author SHA1 Message Date
unknown
b84e9d10b4 Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
Fix tests for new behaviour: an error is thrown if a NON DETERMINISTIC
stored function (SF) is called during statement-based replication (SBR).


mysql-test/r/func_time.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/r/gis.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Mark function as DETERMINISTIC so it can be called with no error while
  doing statement-based replication (SBR).
mysql-test/r/grant2.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/r/innodb_notembedded.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/r/ps.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Mark function as DETERMINISTIC so it can be called with no error while
  doing statement-based replication (SBR).
mysql-test/r/query_cache.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/r/query_cache_notembedded.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/r/rpl_sp.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Move test for SF-calls in different replication modes to its own file, rpl_sf.
mysql-test/r/rpl_sp_effects.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/r/sp.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Mark function as DETERMINISTIC so it can be called with no error while
  doing statement-based replication (SBR).
mysql-test/r/timezone2.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/t/func_time.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/t/gis.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Mark function as DETERMINISTIC so it can be called with no error while
  doing statement-based replication (SBR).
mysql-test/t/grant2.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/t/innodb_notembedded.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/t/ps.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/t/query_cache.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/t/query_cache_notembedded.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/t/rpl_sp.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/t/rpl_sp_effects.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
mysql-test/t/sp.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Mark function as DETERMINISTIC so it can be called with no error while
  doing statement-based replication (SBR).
mysql-test/t/timezone2.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Modify test that contains non-deterministic functions so it can still be
  called with no error while doing statement-based replication (SBR).
sql/item_func.cc:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  If 'log_bin_trust_function_creators' variable is set, don't throw an error
  on calling a non-deterministc function in statement-based replication (SBR).
sql/sql_parse.cc:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Do not throw an error on calling a NON DETERMINISTIC stored procedure (SP)
  while doing statement-based replication (SBR), as the routine body is
  executed statement-by-statement.
mysql-test/r/rpl_sf.result:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Test for stored function (SF) calls in different replication modes.
  NON DETERMINISTIC SFs are not allowed while doing
  statement-based replication (SBR).
mysql-test/t/rpl_sf.test:
  Bug#16456 RBR: rpl_sp.test expects query to fail, but passes in RBR
  
  Test for stored function (SF) calls in different replication modes.
  NON DETERMINISTIC SFs are not allowed while doing
  statement-based replication (SBR).
2006-11-17 21:30:28 +01:00
unknown
092b8f9e9e Merge bk@192.168.21.1:mysql-5.1-opt
into  mysql.com:/home/hf/work/mysql-5.1-mrg


BitKeeper/deleted/.del-bdb-deadlock.test:
  Auto merged
Makefile.am:
  Auto merged
include/mysql.h:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
mysql-test/include/deadlock.inc:
  Auto merged
mysql-test/r/order_by.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/type_newdecimal.result:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
mysql-test/t/flush.test:
  Auto merged
mysql-test/t/flush_block_commit.test:
  Auto merged
mysql-test/t/innodb-lock.test:
  Auto merged
mysql-test/t/lock_multi.test:
  Auto merged
mysql-test/t/rename.test:
  Auto merged
mysql-test/t/show_check.test:
  Auto merged
mysql-test/t/status.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/type_newdecimal.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_subselect.h:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_sum.h:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/item_timefunc.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql-common/my_time.c:
  Auto merged
sql/table.cc:
  Auto merged
client/mysqltest.c:
  merging
include/my_time.h:
  merging
libmysql/libmysql.c:
  merging
mysql-test/t/order_by.test:
  merging
sql/sql_yacc.yy:
  merging
2006-11-17 19:01:35 +04:00
unknown
96ad04dec0 Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/mysql-5.0-0mrg


BitKeeper/deleted/.del-mysql_client.test:
  Auto merged
include/mysql.h:
  Auto merged
libmysqld/lib_sql.cc:
  Auto merged
mysql-test/r/order_by.result:
  Auto merged
mysql-test/r/query_cache.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/type_newdecimal.result:
  Auto merged
mysql-test/t/flush.test:
  Auto merged
mysql-test/t/flush_block_commit.test:
  Auto merged
mysql-test/t/innodb-deadlock.test:
  Auto merged
mysql-test/t/innodb-lock.test:
  Auto merged
mysql-test/t/lock_multi.test:
  Auto merged
mysql-test/t/mysql.test:
  Auto merged
mysql-test/t/query_cache.test:
  Auto merged
mysql-test/t/rename.test:
  Auto merged
mysql-test/t/show_check.test:
  Auto merged
mysql-test/t/status.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
mysql-test/t/type_newdecimal.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  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_func.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_subselect.h:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_sum.h:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/item_timefunc.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/protocol.h:
  Auto merged
sql/sql_base.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_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-common/client.c:
  Auto merged
sql-common/my_time.c:
  Auto merged
Makefile.am:
  merging
client/mysqltest.c:
  merging
include/my_time.h:
  merging
libmysql/libmysql.c:
  merging
mysql-test/t/order_by.test:
  merging
2006-11-17 10:30:16 +04:00
unknown
f224238f8a Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-22684


sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
2006-11-16 10:06:36 -07:00
unknown
2975d65cd8 Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions)
Before this change, the functions BENCHMARK, ENCODE, DECODE and FORMAT could
only accept a constant for some parameters.

After this change, this restriction has been removed. An implication is that
these functions can also be used in prepared statements.

The change consist of changing the following classes:
- Item_func_benchmark
- Item_func_encode
- Item_func_decode
- Item_func_format
to:
- only accept Item* in the constructor,
- and evaluate arguments during calls to val_xxx()
which fits the general design of all the other functions.

The 'TODO' items identified in item_create.cc during the work done for
Bug 21114 are addressed by this fix, as a natural consequence of aligning
the design.

In the 'func_str' test, a single very long test line involving an explain
extended select with many functions has been rewritten into multiple
separate tests, to improve maintainability.
The result of explain extended select decode(encode(...)) has changed,
since the encode and decode functions now print all their parameters.


mysql-test/r/func_str.result:
  Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions)
mysql-test/r/parser.result:
  Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions)
mysql-test/r/ps.result:
  Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions)
mysql-test/t/func_str.test:
  Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions)
mysql-test/t/parser.test:
  Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions)
mysql-test/t/ps.test:
  Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions)
sql/item_create.cc:
  Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions)
sql/item_func.cc:
  Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions)
sql/item_func.h:
  Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions)
sql/item_strfunc.cc:
  Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions)
sql/item_strfunc.h:
  Bug#22684 (BENCHMARK, ENCODE, DECODE and FORMAT are not real functions)
2006-11-16 09:03:47 -07:00
unknown
5f1fc19b9e Merge bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint


sql/item_func.cc:
  Auto merged
2006-11-15 12:29:24 -05:00
unknown
ab6d44374e Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug19955/my50-bug19955
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint


sql/item_func.cc:
  Auto merged
2006-11-15 12:27:09 -05:00
unknown
011513bd49 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug19955/my50-bug19955
into  zippy.cornsilk.net:/home/cmiller/work/mysql/bug19955/my51-bug19955


mysql-test/r/bigint.result:
  Auto merged
sql/item_func.cc:
  Auto merged
2006-11-15 12:24:21 -05:00
unknown
3be6493aab Bug#19955: unsigned bigint used as signed with MOD function
Problem:  When we have a really large number (between 2^63 and 2^64)
as the left side of the mod operator, it gets improperly corerced
into a signed value.

Solution:  Added check to see if the "negative" number is really
positive, and if so, cast it.


mysql-test/r/bigint.result:
  Added test case result
mysql-test/t/bigint.test:
  Added test case
sql/item_func.cc:
  Added check to see if we have an unsigned number that looks like a
  signed number.
2006-11-15 12:23:07 -05:00
unknown
f3a877abbc Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.1-maint
into  salvation.intern.azundris.com:/home/tnurnberg/work/mysql-5.1-maint-16456


mysql-test/r/func_time.result:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2006-11-15 01:58:11 +01:00
unknown
beea123546 Bug#16456 "RBR: rpl_sp.test expects query to fail, but passes in RBR"
calling (rather than defining) non-deterministic SP in SBR (as opposed
to RBR or mixed) will throw an error now.

require mixed mode for tests now. SBR will now fail when calling
non-deter SPs and SFs (as it should), and RBR already failed by virtue of
giving different results for "show binlog" than the results-file has.
also test for 16456 now. lastly make amends because one of the tests
fails with a new error # now as code was added to sql_trigger.cc while
test was disabled.


mysql-test/mysql-test-run.pl:
  Bug#16456 "RBR: rpl_sp.test expects query to fail, but passes in RBR"
  
  mtr falsely assumed that default rep mode is stmt i/o mixed?
mysql-test/r/func_time.result:
  Bug#16456 "RBR: rpl_sp.test expects query to fail, but passes in RBR"
  
  rpl_sp.test was disabled for a while; update results where wording has
  changed and add results for #16456
mysql-test/r/rpl_sp.result:
  Bug#16456 "RBR: rpl_sp.test expects query to fail, but passes in RBR"
  
  rpl_sp.test was disabled for a while; update results where wording has
  changed and add results for #16456
  ---
  Bug#16456 "RBR: rpl_sp.test expects query to fail, but passes in RBR"
  
  calling (rather than defining) non-deterministic SP or SF in SBR
  (as opposed to RBR or mixed) will throw an error now.
mysql-test/t/disabled.def:
  Bug#16456 "RBR: rpl_sp.test expects query to fail, but passes in RBR"
  
  re-enable rpl_sp.test
mysql-test/t/rpl_sp.test:
  Bug#16456 "RBR: rpl_sp.test expects query to fail, but passes in RBR"
  
  require mixed mode for tests now. SBR will now fail when calling
  non-deter SPs (as it should), and RBR already failed by virtue of
  giving different results for "show binlog" than the results-file has.
  also test for 16456 now. lastly make amends because one of the tests
  fails with a new error # now as code was added to sql_trigger.cc while
  test was disabled.
  ---
  Bug#16456 "RBR: rpl_sp.test expects query to fail, but passes in RBR"
  
  calling (rather than defining) non-deterministic SP or SF in SBR
  (as opposed to RBR or mixed) will throw an error now.
sql/item_func.cc:
  Bug#16456 "RBR: rpl_sp.test expects query to fail, but passes in RBR"
  
  calling (rather than defining) non-deterministic SF in SBR
  (as opposed to RBR or mixed) will throw an error now.
sql/sql_parse.cc:
  Bug#16456 "RBR: rpl_sp.test expects query to fail, but passes in RBR"
  
  calling (rather than defining) non-deterministic SP in SBR (as opposed
  to RBR or mixed) will throw an error now.
2006-11-15 01:27:39 +01:00
unknown
5e508a35d5 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug18761/my51-bug18761
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint


BitKeeper/etc/collapsed:
  auto-union
sql/item_func.cc:
  Auto merged
2006-11-13 13:19:49 -05:00
unknown
1aad990179 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug18761/my50-bug18761
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint


BitKeeper/etc/collapsed:
  auto-union
sql/item_func.cc:
  Auto merged
2006-11-13 13:19:13 -05:00
unknown
3d02114824 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug18761/my50-bug18761
into  zippy.cornsilk.net:/home/cmiller/work/mysql/bug18761/my51-bug18761


BitKeeper/etc/collapsed:
  auto-union
mysql-test/r/udf.result:
  Auto merged
mysql-test/t/udf.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/udf_example.c:
  Auto merged
2006-11-13 13:17:02 -05:00
unknown
154c6e0677 Bug#18761: constant expression as UDF parameters not passed in as constant
The code that set up data to be passed to user-defined functions was very
old and analyzed the "Type" of the data that was passed into the UDF, when
it really should analyze the "return_type", which is hard-coded for simple
Items and works correctly for complex ones like functions.
---
Added test at Sergei's behest.


mysql-test/r/udf.result:
  Verify that various arguments work.
  ---
  Added test at Sergei's behest.
mysql-test/t/udf.test:
  Verify that various arguments work.
  ---
  Added test at Sergei's behest.
sql/item_func.cc:
  For function-Items, test whether it is constant and set the struct members 
  for the UDF parameter appropriately.
  
  Replace tabs with spaces in affected code.
sql/udf_example.c:
  Include a simple function that is useful in testing.
2006-11-13 13:13:44 -05:00
unknown
298aff1267 Merge mysql.com:/home/hf/work/embt/my50-embt
into  mysql.com:/home/hf/work/embt/my51-embt


libmysqld/lib_sql.cc:
  Auto merged
BitKeeper/deleted/.del-bdb.result:
  Auto merged
BitKeeper/deleted/.del-bdb.test:
  Auto merged
mysql-test/r/insert_select.result:
  Auto merged
mysql-test/r/join.result:
  Auto merged
mysql-test/t/backup.test:
  Auto merged
mysql-test/t/delayed.test:
  Auto merged
mysql-test/t/join.test:
  Auto merged
mysql-test/t/status.test:
  Auto merged
mysql-test/t/trigger.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
mysql-test/mysql-test-run.pl:
  merging
mysql-test/r/flush_block_commit.result:
  SCCS merged
mysql-test/r/insert.result:
  merging
mysql-test/t/innodb.test:
  merging
mysql-test/t/insert.test:
  merging
sql/share/errmsg.txt:
  merging
2006-11-13 20:16:46 +04:00
unknown
ea7921f68a Small adjustment after merging fix for bug#23651 "Server crashes when
trigger which uses stored function invoked from different connections"
into 5.1.


sql/item_func.cc:
  After merge fix. Starting from 5.1 TABLE_SHARE for dummy TABLE object
  is also allocated in Item_func_sp constructor, so we use TABLE::alias
  instead of TABLE::s to check that dummy TABLE was not initialized yet
  or requires re-initialization.
2006-11-13 14:30:12 +03:00
unknown
458fb082d0 Merge mockturtle.local:/home/dlenev/src/mysql-5.0-bg23651
into  mockturtle.local:/home/dlenev/src/mysql-5.1-merge


mysql-test/r/trigger.result:
  Auto merged
mysql-test/t/trigger.test:
  Auto merged
sql/item_func.cc:
  Auto merged
2006-11-13 11:29:40 +03:00
unknown
1031c460de Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mockturtle.local:/home/dlenev/src/mysql-5.0-bg23651


sql/item_func.cc:
  Auto merged
2006-11-13 11:15:02 +03:00
unknown
fc83f787cb Fix for bug bug#23651 "Server crashes when trigger which uses
stored function invoked from different connections".

Invocation of trigger which was using stored function from different
connections caused server crashes (for non-debug server this happened
in highly concurrent environment, but debug server failed on assertion
in relatively simple scenario).

Item_func_sp was not safe to use in triggers (in other words for
re-execution from different threads) as artificial TABLE object
pointed by Item_func_sp::dummy_table referenced incorrect THD
object. To fix the problem we force re-initialization of this
object for each re-execution of statement.


mysql-test/r/trigger.result:
  Added test for bug#23651 "Server crashes when trigger which uses
  stored function invoked from different connections".
mysql-test/t/trigger.test:
  Added test for bug#23651 "Server crashes when trigger which uses
  stored function invoked from different connections".
sql/item_func.cc:
  To make Item_func_sp safe for usage in triggers (in other words safe
  for re-execution in different threads) we need to ensure that artificial
  TABLE object pointed by Item_func_sp::dummy_table references correct
  THD object. To achieve this we simply force its re-initialization for
  each re-execution of statement.
2006-11-13 11:10:49 +03:00
unknown
002fefaba7 Merge mysql.com:/home/hf/work/embt/my41-embt
into  mysql.com:/home/hf/work/embt/my50-embt


sql/item_func.cc:
  Auto merged
mysql-test/t/innodb.test:
  merging
libmysqld/lib_sql.cc:
  SCCS merged
2006-11-13 10:45:22 +04:00
unknown
28f6e13299 embedded-mode tests fixed
libmysqld/examples/test-run:
  mysql_embedded should be run here
libmysqld/lib_sql.cc:
  thd->real_id setup added
  bootstrap check added
mysql-test/t/innodb.test:
  paths can be different in embedded server - replace_result added
sql/item_func.cc:
  we should compare real_id-s in embedded server
2006-11-13 10:39:15 +04:00
unknown
463e9409bb Merge bk@192.168.21.1:mysql-5.1-opt
into  mysql.com:/home/hf/work/8663/my51-8663


mysql-test/r/type_newdecimal.result:
  Auto merged
mysql-test/t/type_newdecimal.test:
  Auto merged
sql/item_func.cc:
  Auto merged
2006-11-09 16:10:15 +04:00
unknown
d75c784ec2 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug10963/my50-bug10963
into  zippy.cornsilk.net:/home/cmiller/work/mysql/bug10963/my51-bug10963


mysql-test/r/func_str.result:
  Auto merged
mysql-test/t/func_str.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
2006-11-08 10:12:06 -05:00
unknown
3a86738289 Bug#10963: LEFT/RIGHT/SUBSTR/.. string functions returns wrong result \
on large length
  
Problem:  Most (all) of the numeric inputs were being coerced into
int (32 bit) sized variables.  Works OK for sane inputs; any input
larger than 2^32 (or 2^31 for signed vars) exihibited predictable
wrapping behavior (up to about 10^18) and then started having really
strange behaviour past that point (since the conversion to 64 bit int
from the DECIMAL type can do weird things on out of range numbers).

Solution: 1)  Add many tests.  2)  Convert input from (u)long type to
(u)longlong.  3)  Do (sometimes multiple) sanity checks on input,
keeping in mind that sometimes a negative longlong is not a negative
longlong (if the unsigned_flag is set).  4) Emulate existing behavior
w/rt negative and "small" out-of-bounds values.


mysql-test/r/func_str.result:
  Additional test results for #10963
mysql-test/t/func_str.test:
  Additional test results for #10963
sql/item_func.cc:
  Used larger type for counting, to avoid truncation.
sql/item_strfunc.cc:
  Fix for #10963, including comments and cleaned up logic
2006-11-08 10:11:02 -05:00
unknown
90d14d50a9 Merge mysql.com:/home/hf/work/mysql-5.0.clean
into  mysql.com:/home/hf/work/mysql-5.1.clean


include/my_time.h:
  Auto merged
mysql-test/r/func_group.result:
  Auto merged
mysql-test/r/gis-rtree.result:
  Auto merged
mysql-test/r/order_by.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/type_datetime.result:
  Auto merged
mysql-test/r/udf.result:
  Auto merged
mysql-test/t/func_group.test:
  Auto merged
mysql-test/t/gis-rtree.test:
  Auto merged
mysql-test/t/type_datetime.test:
  Auto merged
mysql-test/t/udf.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/filesort.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_subselect.h:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_sum.h:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/my_decimal.cc:
  Auto merged
sql/my_decimal.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/records.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_lex.h:
  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-common/my_time.c:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
mysql-test/r/type_newdecimal.result:
  SCCS merged
mysql-test/t/type_newdecimal.test:
  merging
sql/item.cc:
  merging
sql/item_subselect.cc:
  SCCS merged
sql/item_timefunc.h:
  merging
sql/sql_lex.cc:
  SCCS merged
sql/sql_select.h:
  merging
2006-11-08 19:09:39 +04:00
unknown
c7902f9c88 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug23411/my50-bug23411
into  zippy.cornsilk.net:/home/cmiller/work/mysql/bug23411/my51-bug23411


BitKeeper/etc/collapsed:
  auto-union
mysql-test/r/func_test.result:
  Auto merged
sql/item_func.cc:
  Auto merged
2006-11-06 17:46:50 -05:00
unknown
8f8ee04b14 Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug23411/my41-bug23411
into  zippy.cornsilk.net:/home/cmiller/work/mysql/bug23411/my50-bug23411


BitKeeper/deleted/.del-collapsed~fbec3523369aae99:
  Delete: BitKeeper/etc/collapsed
BitKeeper/etc/collapsed:
  'Auto converge'
mysql-test/r/func_test.result:
  Manual merge.
mysql-test/t/func_test.test:
  Manual merge.
sql/item_func.cc:
  Manual merge.
2006-11-06 17:45:47 -05:00
unknown
2b35fee8ab Bug#23411: ... MOD-ing zero returns strange result
The Item_func_mod objects never had maybe_null set, so users had no reason 
to expect that they can be NULL, and may therefore deduce wrong results.
Now, set maybe_null.


mysql-test/r/func_test.result:
  Verify that the predictions are true.
mysql-test/t/func_test.test:
  Verify that the predictions are true.
sql/item_func.cc:
  MOD functions may be NULL.
2006-11-06 17:13:19 -05:00
unknown
c0c56d13aa Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/8663/my50-8663


sql/item_func.cc:
  Auto merged
2006-11-06 14:57:47 +04:00
unknown
1142adc1ce Merge mysql.com:/home/hf/work/8663/my50-8663
into  mysql.com:/home/hf/work/8663/my51-8663


sql/item_func.cc:
  Auto merged
strings/decimal.c:
  Auto merged
mysql-test/r/type_newdecimal.result:
  merging
mysql-test/t/type_newdecimal.test:
  merging
2006-11-06 11:01:35 +04:00
unknown
2886e07d3f Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  bodhi.local:/opt/local/work/mysql-4.1-runtime


mysql-test/r/ps.result:
  Auto merged
mysql-test/t/func_gconcat.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_sum.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/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
2006-11-02 01:08:39 +03:00
unknown
37a823b774 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.gmz:/home/kgeorge/mysql/autopush/B21809-5.0-opt


sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
2006-10-31 16:15:35 +02:00
unknown
f00e6bd75d Bug #8663 (cant use bigint as input to CAST)
decimal->ulong conversion fixed to assign max possible ULONG if decimal
is bigger
Item_func_unsigned now handles DECIMAL parameter separately as we can't
rely on decimal::val_int result here.


mysql-test/r/type_newdecimal.result:
  result fixed
mysql-test/t/type_newdecimal.test:
  testcase
sql/item_func.cc:
  DECIMAL_RESULT should be handled separately here as it's
  always signed.
strings/decimal.c:
  here we assign max possible ULONG if the decimal value is bigger
2006-10-30 09:52:50 +04:00
unknown
f51d0812a7 Bug #21809: Error 1356 while selecting from view with grouping though underlying
select OK.
The SQL parser was using Item::name to transfer user defined function attributes
to the user defined function (udf). It was not distinguishing between user defined 
function call arguments and stored procedure call arguments. Setting Item::name 
was causing Item_ref::print() method to print the argument as quoted identifiers 
and caused views that reference aggregate functions as udf call arguments (and 
rely on Item::print() for the text of the view to store) to throw an undefined 
identifier error.
Overloaded Item_ref::print to print aggregate functions as such when printing
the references to aggregate functions taken out of context by split_sum_func2()
Fixed the parser to properly detect using AS clause in stored procedure arguments
as an error.
Fixed printing the arguments of udf call to print properly the udf attribute.


mysql-test/r/udf.result:
  Bug #21809: Error 1356 while selecting from view with grouping though underlying
              select OK.
   - test cases
mysql-test/t/udf.test:
  Bug #21809: Error 1356 while selecting from view with grouping though underlying
              select OK.
   - test cases
sql/item.cc:
  Bug #21809: Error 1356 while selecting from view with grouping though underlying
              select OK.
   - Don't print the refs to SUM functions as refs.
sql/item_func.cc:
  Bug #21809: Error 1356 while selecting from view with grouping though underlying
              select OK.
   - print the aliases in the udf calls
sql/item_func.h:
  Bug #21809: Error 1356 while selecting from view with grouping though underlying
              select OK.
   - print the aliases in the udf calls
sql/sql_lex.cc:
  Bug #21809: Error 1356 while selecting from view with grouping though underlying
              select OK.
   - disable aliases for arguments in stored routine calls
sql/sql_lex.h:
  Bug #21809: Error 1356 while selecting from view with grouping though underlying
              select OK.
   - disable aliases for arguments in stored routine calls
sql/sql_yacc.yy:
  Bug #21809: Error 1356 while selecting from view with grouping though underlying
              select OK.
   - disable aliases for arguments in stored routine calls
   - fix bison duplicate symbol warnings
2006-10-24 15:26:41 +03:00
unknown
f603c1cce8 BUG#21726: Incorrect result with multiple invocations of LAST_INSERT_ID.
Note: bug#21726 does not directly apply to 4.1, as it doesn't have stored
procedures.  However, 4.1 had some bugs that were fixed in 5.0 by the
patch for bug#21726, and this patch is a backport of those fixes.
Namely, in 4.1 it fixes:

  - LAST_INSERT_ID(expr) didn't return value of expr (4.1 specific).

  - LAST_INSERT_ID() could return the value generated by current
    statement if the call happens after the generation, like in

      CREATE TABLE t1 (i INT AUTO_INCREMENT PRIMARY KEY, j INT);
      INSERT INTO t1 VALUES (NULL, 0), (NULL, LAST_INSERT_ID());

  - Redundant binary log LAST_INSERT_ID_EVENTs could be generated.


mysql-test/r/rpl_insert_id.result:
  Add result for bug#21726: Incorrect result with multiple invocations
  of LAST_INSERT_ID.
mysql-test/t/rpl_insert_id.test:
  Add test case for bug#21726: Incorrect result with multiple invocations
  of LAST_INSERT_ID.
sql/item_func.cc:
  Add implementation of Item_func_last_insert_id::fix_fields(), where we
  set THD::last_insert_id_used when statement calls LAST_INSERT_ID().
  In Item_func_last_insert_id::val_int(), return THD::current_insert_id
  if called like LAST_INSERT_ID(), otherwise return value of argument if
  called like LAST_INSERT_ID(expr).
sql/item_func.h:
  Add declaration of Item_func_last_insert_id::fix_fields().
sql/log_event.cc:
  Do not set THD::last_insert_id_used on LAST_INSERT_ID_EVENT.  Though we
  know the statement will call LAST_INSERT_ID(), it wasn't called yet.
sql/set_var.cc:
  In sys_var_last_insert_id::value_ptr(), set THD::last_insert_id_used,
  and return THD::current_insert_id for @@LAST_INSERT_ID.
sql/sql_class.h:
  Update comments.
  Remove THD::insert_id(), as it has lost its purpose now.
sql/sql_insert.cc:
  Now it is OK to read THD::last_insert_id directly.
sql/sql_load.cc:
  Now it is OK to read THD::last_insert_id directly.
sql/sql_parse.cc:
  In mysql_execute_command(), remember THD::last_insert_id (first
  generated value of the previous statement) in THD::current_insert_id,
  which then will be returned for LAST_INSERT_ID() and @@LAST_INSERT_ID.
sql/sql_select.cc:
  If "IS NULL" is replaced with "= <LAST_INSERT_ID>", use right value,
  which is THD::current_insert_id, and also set THD::last_insert_id_used
  to issue binary log LAST_INSERT_ID_EVENT.
sql/sql_update.cc:
  Now it is OK to read THD::last_insert_id directly.
tests/mysql_client_test.c:
  Add test case for bug#21726: Incorrect result with multiple invocations
  of LAST_INSERT_ID.
2006-10-06 13:34:07 +04:00
unknown
37b5cbdc30 Fix for the patch for bug#21726: Incorrect result with multiple
invocations of LAST_INSERT_ID.

Reding of LAST_INSERT_ID inside stored function wasn't noted by caller,
and no LAST_INSERT_ID_EVENT was issued for binary log.

The solution is to add THD::last_insert_id_used_bin_log, which is much
like THD::last_insert_id_used, but is reset only for upper-level
statements.  This new variable is used to issue LAST_INSERT_ID_EVENT.


mysql-test/r/rpl_insert_id.result:
  For bug#21726, add result for statement-based replication of function
  calls.
mysql-test/t/rpl_insert_id.test:
  For bug#21726, add test case for statement-based replication of function
  calls.
sql/item_func.cc:
  Set THD::last_insert_id_used_bin_log for issuing of LAST_INSERT_ID_EVENT.
sql/log.cc:
  Issue LAST_INSERT_ID_EVENT if THD::last_insert_id_used_bin_log is set.
sql/set_var.cc:
  Set THD::last_insert_id_used_bin_log for issuing of LAST_INSERT_ID_EVENT.
sql/sql_class.cc:
  Initialize THD::last_insert_id_used_bin_log.
  Fix typo, add whitespace.
sql/sql_class.h:
  Add THD::last_insert_id_used_bin_log.
sql/sql_parse.cc:
  Reset THD::last_insert_id_used_bin_log for upper-level statements.
sql/sql_select.cc:
  Set THD::last_insert_id_used_bin_log for issuing of LAST_INSERT_ID_EVENT.
2006-10-03 13:38:16 +04:00
unknown
dc62ff5560 Merge mysql.com:/usr/home/bar/mysql-4.1.b8663
into  mysql.com:/usr/home/bar/mysql-4.1-rpl


mysql-test/r/cast.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
sql/item_func.cc:
  Auto merged
2006-10-03 11:53:01 +05:00
unknown
be929087ec BUG#21726: Incorrect result with multiple invocations of LAST_INSERT_ID
Non-upper-level INSERTs (the ones in the body of stored procedure,
stored function, or trigger) into a table that have AUTO_INCREMENT
column didn't affected the result of LAST_INSERT_ID() on this level.

The problem was introduced with the fix of bug 6880, which in turn was
introduced with the fix of bug 3117, where current insert_id value was
remembered on the first call to LAST_INSERT_ID() (bug 3117) and was
returned from that function until it was reset before the next
_upper-level_ statement (bug 6880).

The fix for bug#21726 brings back the behaviour of version 4.0, and
implements the following: remember insert_id value at the beginning
of the statement or expression (which at that point equals to
the first insert_id value generated by the previous statement), and
return that remembered value from LAST_INSERT_ID() or @@LAST_INSERT_ID.

Thus, the value returned by LAST_INSERT_ID() is not affected by values
generated by current statement, nor by LAST_INSERT_ID(expr) calls in
this statement.

Version 5.1 does not have this bug (it was fixed by WL 3146).


mysql-test/r/rpl_insert_id.result:
  Add results for bug#21726: Incorrect result with multiple invocations
  of LAST_INSERT_ID, and bug#20339: stored procedure using LAST_INSERT_ID()
  does not replicate statement-based.
mysql-test/t/rpl_insert_id.test:
  Add test cases for bug#21726: Incorrect result with multiple invocations
  of LAST_INSERT_ID, and bug#20339: stored procedure using LAST_INSERT_ID()
  does not replicate statement-based.
sql/item_func.cc:
  Add implementation of Item_func_last_insert_id::fix_fields(), where we
  remember in THD::current_insert_id the first value generated during
  execution of the previous statement, which is returned then from
  Item_func_last_insert_id::val_int().
sql/item_func.h:
  Add declaration of Item_func_last_insert_id::fix_fields().
sql/log_event.cc:
  Do not set THD::last_insert_id_used on LAST_INSERT_ID_EVENT.  Though we
  know the statement will call LAST_INSERT_ID(), it wasn't called yet.
sql/set_var.cc:
  In sys_var_last_insert_id::value_ptr() remember in
  THD::current_insert_id the first value generated during execution of the
  previous statement, and return this value for @@LAST_INSERT_ID.
sql/sql_class.cc:
  Reset THD::last_insert_id_used after each statement execution.
sql/sql_class.h:
  Rather then remember current insert_id value on first invocation of
  THD::insert_id(), remember it in Item_func_last_insert_id::fix_fields(),
  sys_var_last_insert_id::value_ptr(), or mysql_execute_command().
  Remove THD::insert_id(), as it lost its value now.
sql/sql_insert.cc:
  THD::insert_id() is removed, use THD::last_insert_id directly.
sql/sql_load.cc:
  THD::insert_id() is removed, using THD::last_insert_id directly is OK.
sql/sql_parse.cc:
  Remember in THD::current_insert_id first generated insert id value of
  the previous statement in mysql_execute_command().
  No need to reset THD::last_insert_id_used in
  mysql_reset_thd_for_next_command(), it will be reset after each
  statement.
sql/sql_select.cc:
  If "IS NULL" is replaced with "= <LAST_INSERT_ID>", use right value,
  which is THD::current_insert_id, and also set THD::last_insert_id_used
  to issue binary log LAST_INSERT_ID_EVENT.
sql/sql_update.cc:
  THD::insert_id() is removed, use THD::last_insert_id directly.
tests/mysql_client_test.c:
  Add test case for bug#21726: Incorrect result with multiple invocations
  of LAST_INSERT_ID.
2006-10-02 14:28:23 +04:00
unknown
665ebc05d0 Merge bk-internal:/home/bk/mysql-5.0
into  dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-opt


sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
2006-09-18 19:01:07 +04:00
unknown
5222b59093 Merge dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-opt
into  dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.1


mysql-test/r/func_gconcat.result:
  Auto merged
mysql-test/r/func_group.result:
  Auto merged
mysql-test/r/func_str.result:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/r/group_by.result:
  Auto merged
mysql-test/r/heap_hash.result:
  Auto merged
mysql-test/r/information_schema.result:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/join_outer.result:
  Auto merged
mysql-test/r/olap.result:
  Auto merged
mysql-test/r/query_cache.result:
  Auto merged
mysql-test/r/range.result:
  Auto merged
mysql-test/r/row.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/type_date.result:
  Auto merged
mysql-test/r/union.result:
  Auto merged
mysql-test/r/view_grant.result:
  Auto merged
mysql-test/t/func_group.test:
  Auto merged
mysql-test/t/func_str.test:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/log.cc:
  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/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_list.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/t/sp.test:
  SCCS merged
sql/item_cmpfunc.cc:
  SCCS merged
sql/sql_select.cc:
  SCCS merged
2006-09-18 12:57:20 +02:00
unknown
e4b044060c Merge dl145s.mysql.com:/data/bk/team_tree_merge/CLEAN/mysql-5.0
into  dl145s.mysql.com:/data/bk/team_tree_merge/MERGE/mysql-5.0-opt


sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/item.h:
  SCCS merged
2006-09-15 11:52:49 +02:00
unknown
c10a90f290 Fixed the faulty merge 2006-09-13 21:25:33 +04:00
unknown
12bc3c370b Fixed the faulty merge 2006-09-13 19:32:21 +04:00
unknown
a5a9b98054 Merge polly.local:/tmp/20924/bug20294/my50-bug20294
into  polly.local:/home/kaa/src/maint/m50-maint--07OGt


sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/sql_class.h:
  Auto merged
mysql-test/r/user_var.result:
  Manual merge
mysql-test/t/user_var.test:
  Manual merge
sql/item_func.cc:
  Manual merge
sql/item_func.h:
  Manual merge
2006-09-13 16:06:59 +04:00
unknown
3cae41c6f0 Merge polly.local:/tmp/20924/bug20294/my50-bug20294
into  polly.local:/tmp/20924/bug20294/my51-bug20294


mysql-test/r/case.result:
  Auto merged
mysql-test/r/func_if.result:
  Auto merged
mysql-test/r/func_test.result:
  Auto merged
mysql-test/t/case.test:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
mysql-test/r/user_var.result:
  Manual merge
mysql-test/t/user_var.test:
  Manual merge
sql/item_func.cc:
  Manual merge
sql/item_func.h:
  Manual merge
2006-09-13 16:00:15 +04:00
unknown
b419501e0d Merge polly.local:/tmp/20924/bug20294/my41-bug20294
into  polly.local:/tmp/20924/bug20294/my50-bug20294


sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.h:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
mysql-test/r/case.result:
  Manual merge
mysql-test/r/func_if.result:
  Manual merge
mysql-test/r/func_test.result:
  Manual merge
mysql-test/r/user_var.result:
  Manual merge
mysql-test/t/case.test:
  Manual merge
mysql-test/t/func_if.test:
  Manual merge
mysql-test/t/func_test.test:
  Manual merge
mysql-test/t/user_var.test:
  Manual merge
sql/item_func.cc:
  Manual merge
2006-09-13 15:18:14 +04:00
unknown
418ae41b48 Cset exclude: kaa@polly.local|ChangeSet|20060912122540|09861
Cset exclude: kaa@polly.local|ChangeSet|20060908100829|09983


sql/item_cmpfunc.cc:
  Exclude
sql/item_cmpfunc.h:
  Exclude
sql/item_func.cc:
  Exclude
sql/item_func.h:
  Exclude
sql/log_event.cc:
  Exclude
sql/sql_class.h:
  Exclude
mysql-test/r/case.result:
  Exclude
mysql-test/r/func_if.result:
  Exclude
mysql-test/r/func_test.result:
  Exclude
mysql-test/r/user_var.result:
  Exclude
mysql-test/t/case.test:
  Exclude
mysql-test/t/func_if.test:
  Exclude
mysql-test/t/func_test.test:
  Exclude
mysql-test/t/user_var.test:
  Exclude
2006-09-13 14:41:28 +04:00
unknown
76f18d7ff0 Merge polly.local:/tmp/20924/bug20294/my50-bug20294
into  polly.local:/home/kaa/src/maint/m50-maint--07OGt


sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/sql_class.h:
  Auto merged
mysql-test/r/user_var.result:
  Manual merge
mysql-test/t/user_var.test:
  Manual merge
sql/item_func.cc:
  Manual merge
sql/item_func.h:
  Manual merge
2006-09-12 19:35:44 +04:00
unknown
910c007553 Merge polly.local:/tmp/20924/bug20294/my50-bug20294
into  polly.local:/tmp/20924/bug20294/my51-bug20294


mysql-test/r/case.result:
  Auto merged
mysql-test/r/func_if.result:
  Auto merged
mysql-test/r/func_test.result:
  Auto merged
mysql-test/t/case.test:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
mysql-test/r/user_var.result:
  Manual merge
mysql-test/t/user_var.test:
  Manual merge
sql/item_func.cc:
  Manual merge
sql/item_func.h:
  Manual merge
2006-09-12 18:43:38 +04:00
unknown
d31a343465 Fixed compilation 2006-09-12 18:28:36 +04:00
unknown
db141b6b45 Merge polly.local:/tmp/20924/bug20294/my41-bug20294
into  polly.local:/tmp/20924/bug20294/my50-bug20294


sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.h:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
mysql-test/r/case.result:
  Manual merge
mysql-test/r/func_if.result:
  Manual merge
mysql-test/r/func_test.result:
  Manual merge
mysql-test/r/user_var.result:
  Manual merge
mysql-test/t/case.test:
  Manual merge
mysql-test/t/func_if.test:
  Manual merge
mysql-test/t/func_test.test:
  Manual merge
mysql-test/t/user_var.test:
  Manual merge
sql/item_func.cc:
  Manual merge
2006-09-12 17:57:15 +04:00
unknown
5aa6e8615e Post-review fixes for bug #20924
mysql-test/r/case.result:
  Post-review fix for bug #20924
mysql-test/r/func_if.result:
  Post-review fix for bug #20924
mysql-test/r/func_test.result:
  Post-review fix for bug #20924
mysql-test/r/user_var.result:
  Post-review fix for bug #20924
mysql-test/t/case.test:
  Post-review fix for bug #20924
mysql-test/t/func_if.test:
  Post-review fix for bug #20924
mysql-test/t/func_test.test:
  Post-review fix for bug #20924
mysql-test/t/user_var.test:
  Post-review fix for bug #20924
sql/item_func.cc:
  Post-review fix for bug #20924
sql/item_func.h:
  Post-review fix for bug #20924
sql/log_event.cc:
  Post-review fix for bug #20924
2006-09-12 16:25:40 +04:00
unknown
a65342f38d Post-pushbuild corrections for fix of bug #21698. 2006-09-09 09:43:09 -07:00
unknown
f64483cb90 Bug #20924: CAST(expr as UNSIGNED) returns SIGNED value when used in various functions
- Honor unsigned_flag in the corresponding functions
- Use compare_int_signed_unsigned()/compare_int_unsigned_signed() instead of explicit comparison in GREATEST() and LEAST()


mysql-test/r/case.result:
  Added test case for bug #20924
mysql-test/r/func_if.result:
  Added test case for bug #20924
mysql-test/r/func_test.result:
  Added test case for bug #20924
mysql-test/r/user_var.result:
  Added test case for bug #20924
mysql-test/t/case.test:
  Added test case for bug #20924
mysql-test/t/func_if.test:
  Added test case for bug #20924
mysql-test/t/func_test.test:
  Added test case for bug #20924
mysql-test/t/user_var.test:
  Added test case for bug #20924
sql/item_cmpfunc.cc:
  Bug #20924: CAST(expr as UNSIGNED) returns SIGNED value when used in various functions
  
  - Moved some code out of Arg_comparator to external functions to be reused in Item_func_min_max
  - Fixed IFNULL(), IF(), CASE() and COALESCE()
sql/item_cmpfunc.h:
  Bug #20924: CAST(expr as UNSIGNED) returns SIGNED value when used in various functions
  
  - Moved some code out of Arg_comparator to external functions to be reused in Item_func_min_max
sql/item_func.cc:
  Bug #20924: CAST(expr as UNSIGNED) returns SIGNED value when used in various functions
  
  Fixed LEAST(), GREATEST() and "SET @a=..." parts
sql/item_func.h:
  Bug #20924: CAST(expr as UNSIGNED) returns SIGNED value when used in various functions
  
  Fixed "SET @a=..." part
sql/sql_class.h:
  Bug #20924: CAST(expr as UNSIGNED) returns SIGNED value when used in various functions
  
  Fixed "SET @a=..." part
2006-09-08 14:08:29 +04:00
unknown
8716670229 Fixed bug #21698: erroneously a field could be replaced by an
equal constant under any circumstances.
In fact this substitution can be allowed if the field is
not of a type string or if the field reference serves as 
an argument of a comparison predicate.  


mysql-test/r/func_str.result:
  Added test cases for bug #21698.
mysql-test/r/heap_hash.result:
  Adjusted results after the fix for bug #21198.
mysql-test/t/func_str.test:
  Added test cases for bug #21698.
sql/item.cc:
  Fixed bug #21198.
  Added a method to check whether a field reference can be 
  substituted for a constant equal to the field.
  This substitution is allowed if the field is not of a type string
  or if the field reference serves as an argument of a comparison
  predicate.
sql/item.h:
  Fixed bug #21698.
  Added a new virtual transformation method for a item 'compile'
  with two callback function parameters.
  Added a new virtual method 'subst_argument_checker' to be used
  as an amnalyzer method.
  This method is supposed to set its in/out argument to NULL for
  the nodes where substitution of a string field for a constant
  is not valid.
sql/item_cmpfunc.cc:
  Fixed bug #21698.
  Added an implementation of the compile method for class Item_cond.
  First it processes the Item_cond node with a callback function and if
  the latter returns TRUE it proceeds with a transformation performed by
  another callback function.
sql/item_cmpfunc.h:
  Fixed bug #21698.
  Added the implementations of 'subst_argument_checker'
  for the Item_func and Item_cond classes.
  This method is supposed to set its in/out argument to NULL for
  the nodes where substitution of a string field for a constant
  is not valid.
  Added the declaration of an implementation of the compile method for 
  class Item_cond.
  First it processes the Item_cond node with a callback function and if
  the latter returns TRUE it proceeds with a transformation performed by
  another callback function.
sql/item_func.cc:
  Fixed bug #21698.
  Added an implementation of the compile method for class Item_func.
  First it processes the Item_func node with a callback function and if
  the latter returns TRUE it proceeds with a transformation performed by
  another callback function.
sql/item_func.h:
  Fixed bug #21698.
  Added the declaration of the implementation of the compile method for
  class Item_func.
  First it processes the Item_func node with a callback function and if
  the latter returns TRUE it proceeds with a transformation performed by
  another callback function.
sql/sql_select.cc:
  Fixed bug #21698.
  Limited the conditions at which a field can be substituted 
  a for an equal constant in a formula. 
  This substitution is allowed if the field is not of a type string
  or if the field reference serves as an argument of a comparison
  predicate.
2006-09-07 11:06:37 -07:00
unknown
16de51bc07 Merge moonbone.local:/home/evgen/bk-trees/mysql-5.1-opt
into  moonbone.local:/work/tmp_merge-5.1-mysql


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
mysql-test/r/view.result:
  SCCS merged
mysql-test/t/view.test:
  SCCS merged
2006-09-01 14:08:38 +04:00
unknown
5fab3969af Merge bodhi.local:/opt/local/work/mysql-5.0-runtime-safemerge
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge


BitKeeper/deleted/.del-im_check_os.inc:
  Auto merged
BitKeeper/deleted/.del-im_options_set.imtest~b53d9d60e5684833:
  Auto merged
BitKeeper/deleted/.del-im_options_set.result~59278f56be61d921:
  Auto merged
BitKeeper/deleted/.del-im_options_unset.imtest~768eb186b51d0048:
  Auto merged
configure.in:
  Auto merged
BitKeeper/deleted/.del-im_options_unset.result~20a4790cd3c70a4f:
  Auto merged
include/mysql_com.h:
  Auto merged
mysql-test/lib/mtr_io.pl:
  Auto merged
mysql-test/r/im_daemon_life_cycle.result:
  Auto merged
mysql-test/r/im_life_cycle.result:
  Auto merged
mysql-test/r/im_utils.result:
  Auto merged
mysql-test/r/sp-error.result:
  Auto merged
mysql-test/r/trigger.result:
  Auto merged
mysql-test/r/type_varchar.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/im_daemon_life_cycle.imtest:
  Auto merged
mysql-test/t/im_life_cycle.imtest:
  Auto merged
mysql-test/t/im_utils.imtest:
  Auto merged
mysql-test/t/sp-error.test:
  Auto merged
mysql-test/t/trigger.test:
  Auto merged
mysql-test/t/type_varchar.test:
  Auto merged
mysql-test/t/view.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_row.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/net_serv.cc:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_cache.h:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_error.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_trigger.h:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/mysql-test-run.pl:
  Use local. Alik will merge his changes manually.
mysql-test/lib/mtr_process.pl:
  Use local.
mysql-test/r/grant.result:
  Use local.
mysql-test/r/sp.result:
  Use local.
mysql-test/r/ps.result:
  Manual merge.
mysql-test/t/grant.test:
  Manual merge.
mysql-test/t/ps.test:
  Manual merge.
mysql-test/t/sp.test:
  Manual merge.
sql/Makefile.am:
  Manual merge.
sql/field.cc:
  Manual merge.
sql/mysqld.cc:
  Manual merge.
sql/share/errmsg.txt:
  Manual merge.
sql/sp.cc:
  Manual merge.
sql/sp_head.h:
  Manual merge.
sql/sql_trigger.cc:
  Manual merge.
sql/sql_view.cc:
  Manual merge.
2006-08-30 03:00:19 +04:00
unknown
8ea5f31a46 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-14897


configure.in:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/im_life_cycle.result:
  Auto merged
mysql-test/t/im_life_cycle.imtest:
  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_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
mysql-test/r/grant.result:
  Manual merge.
mysql-test/r/view.result:
  Manual merge.
mysql-test/t/grant.test:
  Manual merge.
mysql-test/t/view.test:
  Manual merge.
2006-08-30 00:45:33 +04:00
unknown
f57382196b Merge moonbone.local:/work/tmp_merge-5.0-mysql
into  moonbone.local:/work/tmp_merge-5.1-opt-mysql


BUILD/check-cpu:
  Auto merged
include/config-netware.h:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/r/group_by.result:
  Auto merged
mysql-test/r/join_outer.result:
  Auto merged
mysql-test/r/ndb_condition_pushdown.result:
  Auto merged
mysql-test/r/range.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/type_datetime.result:
  Auto merged
mysql-test/r/user_var.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
mysql-test/t/range.test:
  Auto merged
mysql-test/t/select.test:
  Auto merged
mysql-test/t/type_datetime.test:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/opt_range.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  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
storage/innobase/btr/btr0btr.c:
  Auto merged
storage/innobase/buf/buf0buf.c:
  Auto merged
storage/innobase/dict/dict0dict.c:
  Auto merged
storage/innobase/fil/fil0fil.c:
  Auto merged
storage/innobase/fsp/fsp0fsp.c:
  Auto merged
storage/innobase/include/buf0buf.ic:
  Auto merged
storage/innobase/log/log0log.c:
  Auto merged
storage/innobase/log/log0recv.c:
  Auto merged
storage/innobase/os/os0file.c:
  Auto merged
storage/innobase/row/row0sel.c:
  Auto merged
storage/innobase/srv/srv0start.c:
  Auto merged
storage/innobase/ut/ut0dbg.c:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
client/mysqltest.c:
  Manual merge
mysql-test/r/innodb_mysql.result:
  Manual merge
mysql-test/t/innodb_mysql.test:
  Manual merge
mysql-test/t/join_outer.test:
  Manual merge
sql/item_cmpfunc.cc:
  Manual merge
sql/mysql_priv.h:
  Manual merge
sql/opt_range.cc:
  Manual merge
sql/sql_base.cc:
  Manual merge
storage/innobase/include/btr0cur.ic:
  Manual merge
storage/innobase/row/row0mysql.c:
  Manual merge
2006-08-29 18:58:50 +04:00
unknown
965a3970c9 BUG#21166: Prepared statement causes signal 11 on second execution
Changes in an item tree done by optimizer weren't properly
registered and went unnoticed, which resulted in preliminary freeing
of used memory.


mysql-test/r/ps.result:
  Add result for bug#21166: Prepared statement causes signal 11
  on second execution.
mysql-test/t/ps.test:
  Add test case for bug#21166: Prepared statement causes signal 11
  on second execution.
sql/item.cc:
  Move Item::transform() and Item_default_value::transform() from
  item.h here and use THD::change_item_tree() instead of plain
  assignment.
  Change Item_field::set_no_const_sub() to be used with Item::walk()
  instead of Item::transform().
sql/item.h:
  Move definition of Item::transform() and Item_default_value::transform()
  to item.cc.
  Change Item::set_no_const_sub() to be used with Item::walk()
  instead of Item::transform().
sql/item_cmpfunc.cc:
  Use Item::walk() to execute Item::set_no_const_sub().
  Use THD::change_item_tree() instead of plain assignment.
sql/item_func.cc:
  Add assert and comment to Item_func::traverse_cond().
sql/item_row.cc:
  Use THD::change_item_tree() instead of plain assignment.
sql/item_strfunc.cc:
  Move Item_func_make_set::transform() from item_strfunc.h here and use
  THD::change_item_tree() instead of plain assignment.
sql/item_strfunc.h:
  Move definition of Item_func_make_set::transform() to item_strfunc.cc.
2006-08-24 15:49:12 +04:00
unknown
d8c9de79f4 item_cmpfunc.cc, item.cc:
Additional fix for bug #21475
item_func.h, item_func.cc:
  Additional fix for bug#16861


sql/item_func.h:
  Additional fix for bug#16861
sql/item_func.cc:
  Additional fix for bug#16861
sql/item_cmpfunc.cc:
  Additional fix for bug #21475
sql/item.cc:
  Additional fix for bug #21475
2006-08-23 01:03:28 +04:00
unknown
c623e54fb8 Fixed bug#16861: User defined variable can have a wrong value if a tmp table was
used.

Sorting by RAND() uses a temporary table in order to get a correct results.
User defined variable was set during filling the temporary table and later
on it is substituted for its value from the temporary table. Due to this
it contains the last value stored in the temporary table.

Now if the result_field is set for the Item_func_set_user_var object it 
updates variable from the result_field value when being sent to a client.

The Item_func_set_user_var::check() now accepts a use_result_field
parameter. Depending on its value the result_field or the args[0] is used
to get current value.


mysql-test/r/user_var.result:
  Added a test case for bug#16861: User defined variable can have a wrong value if a tmp table was used.
mysql-test/t/user_var.test:
  Added a test case for bug#16861: User defined variable can have a wrong value if a tmp table was used.
sql/item_func.cc:
  Fixed bug#16861: User defined variable can have a wrong value if a tmp table was used.
  Now if the result_field is set for the Item_func_set_user_var object it 
  updates variable from the result_field value when being sent to a client.
  
  The Item_func_set_user_var::check() now accepts a use_result_field
  parameter. Depending on its value the result_field or the args[0] is used
  to get current value.
sql/item_func.h:
  Fixed bug#16861: User defined variable can have a wrong value if a tmp table was used.
  Added a new SUSERVAR_FUNC function type.
  Updated the Item_func_set_user_var::check() function declaration.
  Added the Item_func_set_user_var::send() member function.
sql/set_var.cc:
  Fixed bug#16861: User defined variable can have a wrong value if a tmp table was used.
  Modified to use updated Item_func_set_user_var::check() function.
sql/sql_class.cc:
  Fixed bug#16861: User defined variable can have a wrong value if a tmp table was used.
  Modified to use updated Item_func_set_user_var::check() function.
sql/sql_select.cc:
  Fixed bug#16861: User defined variable can have a wrong value if a tmp table was used.
  Now an Item_func_set_user_var object isn't substituted for an Item_field object after filling a temporary table.
2006-08-22 17:37:41 +04:00
unknown
65ff243bb4 Merge bk-internal.mysql.com:/data0/bk/mysql-5.1
into  bk-internal.mysql.com:/data0/bk/mysql-5.1-kt


mysql-test/r/cast.result:
  Auto merged
sql/item_func.cc:
  Auto merged
2006-08-15 17:58:39 +02:00
unknown
f68085c4e7 Merge bodhi.local:/opt/local/work/tmp_merge
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge


BitKeeper/etc/ignore:
  auto-union
BitKeeper/deleted/.del-im_options_set.result~59278f56be61d921:
  Auto merged
BitKeeper/deleted/.del-mysqld.dsp~ffdbf2d234e23e56:
  Auto merged
BitKeeper/deleted/.del-mysys.dsp~32695fee91189326:
  Auto merged
BitKeeper/deleted/.del-im_options_set.imtest~b53d9d60e5684833:
  Auto merged
BitKeeper/deleted/.del-im_options_unset.imtest~768eb186b51d0048:
  Auto merged
BitKeeper/deleted/.del-im_options_unset.result~20a4790cd3c70a4f:
  Auto merged
client/mysql.cc:
  Auto merged
client/mysqlbinlog.cc:
  Auto merged
client/mysqlcheck.c:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqltest.c:
  Auto merged
dbug/dbug.c:
  Auto merged
extra/perror.c:
  Auto merged
extra/yassl/src/yassl_imp.cpp:
  Auto merged
extra/yassl/src/yassl_int.cpp:
  Auto merged
include/mysql.h:
  Auto merged
include/mysql_com.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
mysql-test/r/cast.result:
  Auto merged
mysql-test/r/date_formats.result:
  Auto merged
mysql-test/r/federated.result:
  Auto merged
mysql-test/r/func_compress.result:
  Auto merged
mysql-test/r/func_group.result:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/r/gis-rtree.result:
  Auto merged
mysql-test/r/gis.result:
  Auto merged
mysql-test/r/im_daemon_life_cycle.result:
  Auto merged
mysql-test/r/im_utils.result:
  Auto merged
mysql-test/r/join_outer.result:
  Auto merged
mysql-test/r/mysqlcheck.result:
  Auto merged
mysql-test/r/rpl_sp.result:
  Auto merged
mysql-test/r/rpl_trigger.result:
  Auto merged
mysql-test/r/sp-code.result:
  Auto merged
mysql-test/r/sp-security.result:
  Auto merged
mysql-test/r/strict.result:
  Auto merged
mysql-test/r/type_blob.result:
  Auto merged
mysql-test/r/type_datetime.result:
  Auto merged
mysql-test/r/type_ranges.result:
  Auto merged
mysql-test/r/udf.result:
  Auto merged
mysql-test/r/user_var.result:
  Auto merged
mysql-test/t/cast.test:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
mysql-test/t/func_group.test:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
mysql-test/t/im_daemon_life_cycle.imtest:
  Auto merged
mysql-test/t/im_life_cycle.imtest:
  Auto merged
mysql-test/t/im_utils.imtest:
  Auto merged
mysql-test/t/mysql.test:
  Auto merged
mysql-test/t/mysqlbinlog.test:
  Auto merged
mysql-test/t/mysqlcheck.test:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
mysql-test/t/rpl_trigger.test:
  Auto merged
mysql-test/t/sp-security.test:
  Auto merged
mysql-test/t/strict.test:
  Auto merged
mysql-test/t/udf.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_sum.h:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_udf.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql-common/client.c:
  Auto merged
sql-common/my_time.c:
  Auto merged
sql/table.h:
  Auto merged
storage/ndb/src/kernel/error/ndbd_exit_codes.c:
  Auto merged
storage/ndb/src/mgmsrv/ConfigInfo.cpp:
  Auto merged
mysql-test/r/im_life_cycle.result:
  e
  use local
mysql-test/r/ps.result:
  use local
client/Makefile.am:
  Manual merge.
client/mysqlimport.c:
  Manual merge.
configure.in:
  Manual merge.
mysql-test/mysql-test-run.pl:
  Manual merge.
mysql-test/r/mysqldump.result:
  Manual merge.
mysql-test/r/mysqltest.result:
  Manual merge.
mysql-test/r/ndb_basic.result:
  Manual merge.
mysql-test/r/rpl_view.result:
  Manual merge.
mysql-test/r/show_check.result:
  Manual merge.
mysql-test/r/sp-error.result:
  Manual merge.
mysql-test/r/sp.result:
  Manual merge.
mysql-test/r/union.result:
  Manual merge.
mysql-test/t/mysqldump.test:
  Manual merge.
mysql-test/t/mysqltest.test:
  Manual merge.
mysql-test/t/ndb_basic.test:
  Manual merge.
mysql-test/t/rpl_sp.test:
  Manual merge.
mysql-test/t/rpl_view.test:
  Manual merge.
mysql-test/t/show_check.test:
  Manual merge.
mysql-test/t/sp-error.test:
  Manual merge.
mysql-test/t/sp.test:
  Manual merge.
sql/item_sum.cc:
  Manual merge.
sql/mysql_priv.h:
  Manual merge.
sql/sp_head.cc:
  Manual merge.
sql/sql_db.cc:
  Manual merge.
sql/sql_delete.cc:
  Manual merge.
sql/sql_lex.h:
  Manual merge.
sql/sql_show.cc:
  Manual merge.
sql/sql_table.cc:
  Manual merge.
sql/sql_trigger.cc:
  Manual merge.
sql/sql_yacc.yy:
  Manual merge.
tests/mysql_client_test.c:
  Manual merge.
2006-08-12 21:06:51 +04:00
unknown
66f6b5ba12 Bug#16172 DECIMAL data type processed incorrectly
issue an 'overflow warning' if result value is bigger than max possible value


include/decimal.h:
  Bug#16172 DECIMAL data type processed incorrectly
  new function decimal_intg()
mysql-test/r/cast.result:
  Bug#16172 DECIMAL data type processed incorrectly
  result fix
mysql-test/r/type_newdecimal.result:
  Bug#16172 DECIMAL data type processed incorrectly
  test result
mysql-test/r/view.result:
  Bug#16172 DECIMAL data type processed incorrectly
  result fix
mysql-test/t/type_newdecimal.test:
  Bug#16172 DECIMAL data type processed incorrectly
  test case
sql/item_create.cc:
  Bug#16172 DECIMAL data type processed incorrectly
  do not increase decimal part on 2(according to manual)
sql/my_decimal.h:
  Bug#16172 DECIMAL data type processed incorrectly
  new function my_decimal_intg()
strings/decimal.c:
  Bug#16172 DECIMAL data type processed incorrectly
  new function decimal_intg()
2006-08-08 16:03:42 +05:00
unknown
ed44a2ee51 Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint


client/mysql.cc:
  Auto merged
client/mysqltest.c:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/date_formats.result:
  Auto merged
mysql-test/r/union.result:
  Auto merged
mysql-test/t/union.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/r/func_group.result:
  Merge manually
mysql-test/t/func_group.test:
  Merge manually
2006-08-03 09:32:58 +02:00
unknown
e44e344cac Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-runtime-merge


sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.h:
  Auto merged
mysql-test/r/sp.result:
  Manual merge.
mysql-test/r/udf.result:
  Manual merge.
mysql-test/t/sp.test:
  Manual merge.
mysql-test/t/udf.test:
  Manual merge.
2006-08-02 21:54:10 +04:00
unknown
ddb91478e8 Merge sunlight.local:/local_work/tmp_merge-5.0-opt-mysql
into  sunlight.local:/local_work/tmp_merge-5.1-opt-mysql


client/mysql.cc:
  Auto merged
mysql-test/r/date_formats.result:
  Auto merged
mysql-test/r/func_gconcat.result:
  Auto merged
mysql-test/r/func_group.result:
  Auto merged
mysql-test/r/func_str.result:
  Auto merged
mysql-test/r/group_min_max.result:
  Auto merged
BitKeeper/deleted/.del-make_win_src_distribution.sh~f80d8fca44e4e5f1:
  Auto merged
BitKeeper/deleted/.del-mysqld.dsp~ffdbf2d234e23e56:
  Auto merged
BitKeeper/deleted/.del-mysqld_ia64.dsp~7f8cf84d81ee04e2:
  Auto merged
BitKeeper/deleted/.del-mysqldump.dsp~a8bd23547d3fc27e:
  Auto merged
BitKeeper/deleted/.del-mysqldump_ia64.dsp~a2aabe898be35b31:
  Auto merged
mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/ps_7ndb.result:
  Auto merged
mysql-test/r/type_ranges.result:
  Auto merged
mysql-test/r/udf.result:
  Auto merged
mysql-test/r/union.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/date_formats.test:
  Auto merged
mysql-test/t/func_gconcat.test:
  Auto merged
mysql-test/t/func_group.test:
  Auto merged
mysql-test/t/group_min_max.test:
  Auto merged
mysql-test/t/innodb.test:
  Auto merged
mysql-test/t/innodb_mysql.test:
  Auto merged
mysql-test/t/mysql.test:
  Auto merged
mysql-test/t/select.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_subselect.h:
  Auto merged
sql/opt_range.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/time.cc:
  Auto merged
storage/ndb/test/ndbapi/Makefile.am:
  Auto merged
strings/decimal.c:
  Auto merged
mysql-test/r/analyse.result:
  Manual merge
mysql-test/r/bigint.result:
  Manual merge
mysql-test/r/create.result:
  Manual merge
mysql-test/r/information_schema.result:
  Manual merge
mysql-test/r/ps_2myisam.result:
  Manual merge
mysql-test/r/ps_3innodb.result:
  Manual merge
mysql-test/r/ps_4heap.result:
  Manual merge
mysql-test/r/ps_5merge.result:
  Manual merge
mysql-test/r/ps_6bdb.result:
  Manual merge
mysql-test/r/rpl_insert_id.result:
  Manual merge
mysql-test/r/select.result:
  Manual merge
mysql-test/r/sp.result:
  Manual merge
mysql-test/r/subselect.result:
  Manual merge
mysql-test/t/information_schema.test:
  Manual merge
mysql-test/t/rpl_insert_id.test:
  Manual merge
sql/field.h:
  Manual merge
sql/item.cc:
  Manual merge
sql/item.h:
  Manual merge
sql/item_strfunc.h:
  Manual merge
sql/item_sum.cc:
  Manual merge
sql/mysql_priv.h:
  Manual merge
sql/share/errmsg.txt:
  Manual merge
sql/sql_class.h:
  Manual merge
sql/sql_select.cc:
  Manual merge
2006-07-30 00:33:24 +04:00
unknown
5b6016c14e Merge bodhi.local:/opt/local/work/tmp_merge
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge


BitKeeper/etc/ignore:
  auto-union
BitKeeper/deleted/.del-libmysqld.dsp~78dc6a589e5a4149:
  Auto merged
BitKeeper/deleted/.del-libmysqld.vcproj~a75d5b9a5967dea0:
  Auto merged
BitKeeper/deleted/.del-mysqld.dsp~ffdbf2d234e23e56:
  Auto merged
BitKeeper/deleted/.del-mysqld.vcproj~6aa7b3f9c3e28fcb:
  Auto merged
libmysqld/Makefile.am:
  Auto merged
mysql-test/Makefile.am:
  Auto merged
mysql-test/r/date_formats.result:
  Auto merged
mysql-test/r/view_grant.result:
  Auto merged
mysql-test/t/date_formats.test:
  Auto merged
mysql-test/t/init_connect.test:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
mysql-test/t/view_grant.test:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_create.cc:
  Auto merged
sql/item_create.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/set_var.h:
  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_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_trigger.cc:
  Auto merged
sql/sql_udf.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
storage/ndb/include/kernel/GlobalSignalNumbers.h:
  Auto merged
storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbdict/Dbdict.hpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbdih/DbdihMain.cpp:
  Auto merged
storage/ndb/src/ndbapi/ndberror.c:
  Auto merged
support-files/mysql.spec.sh:
  Auto merged
mysql-test/r/federated.result:
  Use local.
mysql-test/r/myisam.result:
  Manual merge.
mysql-test/t/federated.test:
  Manual merge.
mysql-test/t/myisam.test:
  Manual merge.
sql/Makefile.am:
  Manual merge.
sql/set_var.cc:
  Manual merge.
sql/sql_parse.cc:
  Manual merge.
sql/sql_update.cc:
  Manual merge.
storage/myisam/mi_create.c:
  Manual merge.
2006-07-26 23:33:25 +04:00
unknown
1150869c4a item_func.h, item_func.cc, sql_select.cc, item.h:
Post review changes for bug#19862.


sql/sql_select.cc:
  Post review changes for bug#19862.
sql/item_func.h:
  Post review changes for bug#19862.
sql/item_func.cc:
  Post review changes for bug#19862.
sql/item.h:
  Post review changes for bug#19862.
2006-07-26 21:36:03 +04:00
unknown
9a63adc8fd Fixed bug#19862: Sort with filesort by function evaluates function twice
When there is no index defined filesort is used to sort the result of a
query. If there is a function in the select list and the result set should be
ordered by it's value then this function will be evaluated twice. First time to
get the value of the sort key and second time to send its value to a user.
This happens because filesort when sorts a table remembers only values of its
fields but not values of functions.
All functions are affected. But taking into account that SP and UDF functions
can be both expensive and non-deterministic a temporary table should be used 
to store their results and then sort it to avoid twice SP evaluation and to 
get a correct result.

If an expression referenced in an ORDER clause contains a SP or UDF 
function, force the use of a temporary table.

A new Item_processor function called func_type_checker_processor is added
to check whether the expression contains a function of a particular type.


mysql-test/t/udf.test:
  Added test case for bug#19862: Sort with filesort by function evaluates function twice
mysql-test/t/sp.test:
  Added test case for bug#19862: Sort with filesort by function evaluates function twice
mysql-test/r/sp.result:
  Added test case for bug#19862: Sort with filesort by function evaluates function twice
mysql-test/r/udf.result:
  Added test case for bug#19862: Sort with filesort by function evaluates function twice
sql/sql_select.cc:
  Fixed bug#19862: Sort with filesort by function evaluates function twice
  If an expression referenced in an ORDER clause contains a SP or UDF
  function, force the use of a temporary table.
sql/item_func.h:
  Fixed bug#19862: Sort with filesort by function evaluates function twice
  A new Item_processor function called func_type_checker_processor is added
  to check whether the expression contains a function of a particular type.
sql/item.h:
  Fixed bug#19862: Sort with filesort by function evaluates function twice
  A new Item_processor function called func_type_checker_processor is added
  to check whether the expression contains a function of a particular type.
sql/item_func.cc:
  Fixed bug#19862: Sort with filesort by function evaluates function twice
  A new Item_processor function called func_type_checker_processor is added
  to check whether the expression contains a function of a particular type.
2006-07-26 00:31:29 +04:00
unknown
22a963080b Merge neptunus.(none):/home/msvensson/mysql/bug7498/my50-bug7498
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint


sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
2006-07-20 13:41:50 +02:00
unknown
3c3f9d9022 Merge bodhi.local:/opt/local/work/tmp_merge
into  bodhi.local:/opt/local/work/mysql-5.1-runtime-merge-5.0


BitKeeper/etc/ignore:
  auto-union
BitKeeper/deleted/.del-mysqld_safe-watch.sh~37cbc9a97ffd2555:
  Auto merged
configure.in:
  Auto merged
include/my_global.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
mysql-test/r/func_sapdb.result:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/r/key.result:
  Auto merged
mysql-test/r/symlink.result:
  Auto merged
mysql-test/t/func_sapdb.test:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
mysql-test/t/key.test:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
mysys/my_handler.c:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
storage/heap/hp_test1.c:
  Auto merged
storage/heap/hp_test2.c:
  Auto merged
strings/ctype-mb.c:
  Auto merged
support-files/mysql.spec.sh:
  Auto merged
sql/table.cc:
  Use local (manual merge)
mysql-test/mysql-test-run.sh:
  Manual merge.
sql/ha_ndbcluster.cc:
  Manual merge.
sql/item.cc:
  Manual merge.
tests/mysql_client_test.c:
  Manual merge.
2006-07-13 22:09:36 +04:00
unknown
51dddb3ad1 Merge moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0
into  moonlight.intranet:/home/tomash/src/mysql_ab/mysql-5.0-bug18630


sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_trigger.cc:
  Auto merged
2006-07-13 17:21:44 +04:00
unknown
06bf59ad33 Bug#18630: Arguments of suid routine calculated in wrong security
context.

Routine arguments were evaluated in the security context of the routine
itself, not in the caller's context.

The bug is fixed the following way:

  - Item_func_sp::find_and_check_access() has been split into two
    functions: Item_func_sp::find_and_check_access() itself only
    finds the function and check that the caller have EXECUTE privilege
    on it.  New function set_routine_security_ctx() changes security
    context for SUID routines and checks that definer have EXECUTE
    privilege too.

  - new function sp_head::execute_trigger() is called from
    Table_triggers_list::process_triggers() instead of
    sp_head::execute_function(), and is effectively just as the
    sp_head::execute_function() is, with all non-trigger related code
    removed, and added trigger-specific security context switch.

  - call to Item_func_sp::find_and_check_access() stays outside
    of sp_head::execute_function(), and there is a code in
    sql_parse.cc before the call to sp_head::execute_procedure() that
    checks that the caller have EXECUTE privilege, but both
    sp_head::execute_function() and sp_head::execute_procedure() call
    set_routine_security_ctx() after evaluating their parameters,
    and restore the context after the body is executed.


mysql-test/r/sp-security.result:
  Add test case for bug#18630: Arguments of suid routine calculated
  in wrong security context.
mysql-test/t/sp-security.test:
  Add result for bug#18630: Arguments of suid routine calculated
  in wrong security context.
sql/item_func.cc:
  Do not change security context before executing the function, as it
  will be changed after argument evaluation.
  Do not change security context in Item_func_sp::find_and_check_access().
sql/item_func.h:
  Change prototype for Item_func_sp::find_and_check_access().
sql/sp_head.cc:
  Add set_routine_security_ctx() function.
  Add sp_head::execute_trigger() method.
  Change security context in sp_head::execute_trigger(), and in
  sp_head::execute_function() and sp_head::execute_procedure()
  after argument evaluation.
  Move pop_all_cursors() call to sp_head::execute().
sql/sp_head.h:
  Add declaration for sp_head::execute_trigger() and
  set_routine_security_ctx().
sql/sql_parse.cc:
  Do not change security context before executing the procedure, as it
  will be changed after argument evaluation.
sql/sql_trigger.cc:
  Call new sp_head::execute_trigger() instead of
  sp_head::execute_function(), which is responsible to switch
  security context.
2006-07-13 17:12:31 +04:00
unknown
60272e750e WL#3146 "less locking in auto_increment":
this is a cleanup patch for our current auto_increment handling:
new names for auto_increment variables in THD, new methods to manipulate them
(see sql_class.h), some move into handler::, causing less backup/restore
work when executing substatements. 
This makes the logic hopefully clearer, less work is is needed in
mysql_insert().
By cleaning up, using different variables for different purposes (instead
of one for 3 things...), we fix those bugs, which someone may want to fix
in 5.0 too:
BUG#20339 "stored procedure using LAST_INSERT_ID() does not replicate
statement-based"
BUG#20341 "stored function inserting into one auto_increment puts bad
data in slave"
BUG#19243 "wrong LAST_INSERT_ID() after ON DUPLICATE KEY UPDATE"
(now if a row is updated, LAST_INSERT_ID() will return its id)
and re-fixes:
BUG#6880 "LAST_INSERT_ID() value changes during multi-row INSERT"
(already fixed differently by Ramil in 4.1)
Test of documented behaviour of mysql_insert_id() (there was no test).
The behaviour changes introduced are:
- LAST_INSERT_ID() now returns "the first autogenerated auto_increment value
successfully inserted", instead of "the first autogenerated auto_increment
value if any row was successfully inserted", see auto_increment.test.
Same for mysql_insert_id(), see mysql_client_test.c.
- LAST_INSERT_ID() returns the id of the updated row if ON DUPLICATE KEY
UPDATE, see auto_increment.test. Same for mysql_insert_id(), see
mysql_client_test.c.
- LAST_INSERT_ID() does not change if no autogenerated value was successfully 
inserted (it used to then be 0), see auto_increment.test.
- if in INSERT SELECT no autogenerated value was successfully inserted,
mysql_insert_id() now returns the id of the last inserted row (it already
did this for INSERT VALUES), see mysql_client_test.c.
- if INSERT SELECT uses LAST_INSERT_ID(X), mysql_insert_id() now returns X
(it already did this for INSERT VALUES), see mysql_client_test.c.
- NDB now behaves like other engines wrt SET INSERT_ID: with INSERT IGNORE,
the id passed in SET INSERT_ID is re-used until a row succeeds; SET INSERT_ID
influences not only the first row now.

Additionally, when unlocking a table we check that the thread is not keeping
a next_insert_id (as the table is unlocked that id is potentially out-of-date);
forgetting about this next_insert_id is done in a new
handler::ha_release_auto_increment().

Finally we prepare for engines capable of reserving finite-length intervals
of auto_increment values: we store such intervals in THD. The next step
(to be done by the replication team in 5.1) is to read those intervals from
THD and actually store them in the statement-based binary log. NDB
will be a good engine to test that.


mysql-test/extra/binlog_tests/binlog.test:
  Testing that if INSERT_ID is set to a value too big for the
  column's type, the binlogged INSERT_ID is the truncated value
  (important if slave has a column of a "wider" numeric type).
  Testing binlogging of INSERT_ID with INSERT DELAYED, to be sure that 
  we binlog an INSERT_ID event only for the delayed rows which use one.
mysql-test/extra/rpl_tests/rpl_insert_id.test:
  Testcase for BUG#20339 "stored procedure using
  LAST_INSERT_ID() does not replicate statement-based".
  Testcase for BUG#20341 "stored function inserting into one
  auto_increment puts bad data in slave".
mysql-test/extra/rpl_tests/rpl_loaddata.test:
  Test that LOAD DATA INFILE sets a value for a future LAST_INSERT_ID().
mysql-test/r/auto_increment.result:
  behaviour change: when INSERT totally fails (not even succeeds
  partially and then rolls back), don't change last_insert_id().
  Behaviour change: LAST_INSERT_ID() is now the first successfully inserted,
  autogenerated, id.
  Behaviour change: if INSERT ON DUPLICATE KEY UPDATE, if the table has auto_increment
  and a row is updated, then LAST_INSERT_ID() returns the id of this row.
mysql-test/r/binlog_row_binlog.result:
  result update
mysql-test/r/binlog_stm_binlog.result:
  result update
mysql-test/r/insert.result:
  result update
mysql-test/r/rpl_insert_id.result:
  result update
mysql-test/r/rpl_loaddata.result:
  result update
mysql-test/r/rpl_ndb_auto_inc.result:
  ndb's behaviour is now like other engines wrt SET INSERT_ID
  in a multi-row INSERT:
  - with INSERT IGNORE: the id passed in SET INSERT_ID is re-used until
  a row succeeds.
  - generally, SET INSERT_ID sets the first value and other values are
  simply computed from this first value, instead of previously where
  the 2nd and subsequent values where not influenced by SET INSERT_ID;
  this good change is due to the removal of "thd->next_insert_id=0"
  from ha_ndbcluster.
mysql-test/t/auto_increment.test:
  A testcase of BUG#19243: if ON DUPLICATE KEY UPDATE updates a row,
  LAST_INSERT_ID() now returns the id of the row.
  Test of new behaviour of last_insert_id() when no autogenerated value was
  inserted, or when only some autogenerated value (not the first of them) was
  inserted.
mysql-test/t/insert.test:
  testing INSERT IGNORE re-using generated values
sql/ha_federated.cc:
  update for new variables.
sql/ha_ndbcluster.cc:
  handler::auto_increment_column_changed not needed, equivalent to
  (insert_id_for_cur_row > 0).
  thd->next_insert_id=0 not needed anymore; it was used to force
  handler::update_auto_increment() to call ha_ndbcluster::get_auto_increment()
  for each row of a multi-row INSERT, now this happens naturally
  because NDB says "I have reserved you *one* value" in get_auto_increment(),
  so handler::update_auto_increment() calls again for next row.
sql/handler.cc:
  More comments, use of new methods and variables. Hopes to be clearer
  than current code.
  thd->prev_insert_id not in THD anymore: it is managed locally by inserters
  (like mysql_insert()).
  THD::clear_next_insert_id is now equivalent to
  handler::next_insert_id > 0.
  get_auto_increment() reserves an interval of values from the engine,
  uses this interval for next rows of the statement, until interval
  is exhausted then it asks for another interval (of a bigger size
  than the first one; size doubles until reaching 65535 then it stays constant).
  If doing statement-based binlogging, intervals are remembered in a list
  for storage in the binlog.
  For "forced" insert_id values (SET INSERT_ID or replication slave),
  forced_auto_inc_intervals is non-empty and the handler takes its intervals
  from there, without calling get_auto_increment().
  ha_release_auto_increment() resets the handler's auto_increment variables;
  it calls release_auto_increment() which is handler-dependent and
  serves to return to the engine any unused tail of the last used
  interval.
  If ending a statement, next_insert_id>0 means that autoinc values have been
  generated or taken from the master's binlog (in a replication slave) so
  we clear those values read from binlog, so that next top- or sub-
  statement does not use them.
sql/handler.h:
  handler::auto_increment_changed can be replaced by
  (handler::insert_id_for_cur_row > 0).
  THD::next_insert_id moves into handler (more natural, and prepares
  for the day when we'll support a single statement inserting into
  two tables - "multi-table INSERT" like we have UPDATE - will this
  happen?).
  This move makes the backup/restore of THD::next_insert_id when entering
  a substatement unneeded, as each substatement has its own handler
  objects.
sql/item_func.cc:
  new names for variables.
  For the setting of what mysql_insert_id() will return to the client,
  LAST_INSERT_ID(X) used to simply pretend that the generated autoinc
  value for the current row was X, but this led to having no reliable
  way to know the really generated value, so we now have a bool:
  thd->arg_of_last_insert_id_function which enables us to know that
  LAST_INSERT_ID(X) was called (and then X can be found in
  thd->first_successful_insert_id_in_prev_stmt).
sql/log.cc:
  new variable names for insert_ids. Removing some unused variables in the slow
  log.
sql/log_event.cc:
  new variable names, comments. Preparing for when master's won't binlog
  LAST_INSERT_ID if it was 0.
sql/set_var.cc:
  new variable names.
  The last change repeats how Bar fixed BUG#20392
  "INSERT_ID session variable has weird value" in 5.0.
sql/sql_class.cc:
  new variables for insert_id. In THD::cleanup_after_query() we fix
  BUG#20339 "stored procedure using LAST_INSERT_ID() does not replicate
  statement-based" (will one want to fix it in 5.0?). Many comments
  about what stored functions do to auto_increment.
  In reset|restore_sub_statement_state(), we need to backup less
  auto_inc variables as some of them have moved to the handler;
  we backup/restore those which are about the current top- or sub-
  statement, *not* those about the statement-based binlog
  (which evolve as the top- and sub-statement execute).
  Because we split THD::last_insert_id into 
  THD::first_successful_insert_id_in_prev_stmt and
  THD::auto_inc_intervals_for_binlog (among others), we fix
  BUG#20341 "stored function inserting into one auto_increment
  puts bad data in slave": indeed we can afford to not backup/restore
  THD::auto_inc_intervals_for_binlog (which fixes the bug) while still
  backing up / restoring THD::first_successful_insert_id_in_prev_stmt
  (ensuring that the top-level LAST_INSERT_ID() is not affected by INSERTs
  done by sub-statements, as is desirable and tested in rpl_insert_id.test).
sql/sql_class.h:
  new variables and methods for auto_increment.
  Some THD members move into handler (those which are really about
  the table being inserted), some stay in THD (those which are
  about what a future LAST_INSERT_ID() should return, or about
  what should be stored into the statement-based binlog).
  THD::next_insert_id moves to handler::.
  THD::clear_next_insert_id removed (had become equivalent
  to next_insert_id > 0).
  THD::last_insert_id becomes four:
  THD::first_successful_insert_id_in_cur_stmt,
  THD::auto_inc_intervals_for_binlog,
  handler::insert_id_for_cur_row,
  THD::first_successful_insert_id_in_prev_stmt.
  THD::current_insert_id becomes:
  THD::first_successful_insert_id_in_prev_stmt_for_binlog
  THD::prev_insert_id is removed, handler can just use
  handler::insert_id_for_cur_row instead (which is more accurate:
  for the first row, prev_insert_id was set before get_auto_increment
  was called, so was 0, causing a call to
  get_auto_increment() for the 2nd row if the 1st row fails;
  here we don't need the call as insert_id_for_cur_row has
  the value of the first row).
  THD::last_insert_id_used becomes: stmt_depends_on_first_row_in_prev_stmt
  THD::insert_id_used is removed (equivalent to
  auto_inc_intervals_for_binlog non empty).
  The interval returned by get_auto_increment() and currently being
  consumed is handler::auto_inc_interval_for_cur_row.
  Comments to explain each of them.
  select_insert::last_insert_id becomes autoinc_value_of_last_inserted_row.
sql/sql_insert.cc:
  the "id" variable is not changed for each row now; it used to compensate for
  this contradiction:
  - thd->last_insert_id supposed job was to keep the id of the first row
  - but it was updated for every row
  - so mysql_insert() made sure to catch its first value and restore it at the end of stmt.
  Now THD keeps the first value in first_successful_insert_id_in_cur_stmt,
  and value of the row in insert_id_for_cur_row. So "id" only serves to fill
  mysql_insert_id(), as depending on some conditions, "id" must be different
  values.
  Prev_insert_id moves from THD to write_record().
  We now set LAST_INSERT_ID() in ON DUPLICATE KEY UPDATE too (BUG#19243).
  In an INSERT DELAYED, we still "reset auto-increment caching" but differently
  (by calling ha_release_auto_increment()).
sql/sql_load.cc:
  no need to fiddle with "id", THD maintains
  THD::first_successful_insert_id_in_cur_stmt by itself and correctly now.
  ha_release_auto_increment() is now (logically) called before we unlock
  the table.
sql/sql_parse.cc:
  update to new variable names.
  Assertion that reset_thd_for_next_command() is not called for every
  substatement of a routine (I'm not against it, but if we do this change,
  statement-based binlogging needs some adjustments).
sql/sql_select.cc:
  update for new variable names
sql/sql_table.cc:
  next_insert_id not needed in mysql_alter_table(), THD manages.
sql/sql_update.cc:
  update for new variable names.
  Even though this is UPDATE, an insert id can be generated (by
  LAST_INSERT_ID(X)) and should be recorded because mysql_insert_id() wants
  to know about it.
sql/structs.h:
  A class for "discrete" intervals (intervals of integer numbers with a certain
  increment between them): Discrete_interval, and a class for a list of such
  intervals: Discrete_intervals_list
tests/mysql_client_test.c:
  tests of behaviour of mysql_insert_id(): there were no such tests, while in
  our manual we document its behaviour. In comments you'll notice the behaviour
  changes introduced (there are 5).
2006-07-09 17:52:19 +02:00
unknown
46079624e2 Fix compiler warnings in sql_udf.h: ISO C++ forbids casting
between pointer to function and pointer to object.


sql/item_func.cc:
  Use typedef names instead of hard-coded types for udf init/deinit
  functions.
sql/sql_udf.cc:
  Use typedef names for udf function types.
2006-07-09 13:03:51 +04:00
unknown
d9cb536a55 BUG#20769: Dangling pointer in ctype_recoding test case.
In some functions dealing with strings and character sets, the wrong
pointers were saved for restoration in THD::rollback_item_tree_changes().
This could potentially cause random corruption or crashes.

Fixed by passing the original Item ** locations, not local stack copies.

Also remove unnecessary use of default arguments.


sql/item.cc:
  Function agg_item_charsets() now handles non-consequtive Item *'s.
sql/item.h:
  Remove use of default argument.
sql/item_cmpfunc.cc:
  Remove use of default argument.
sql/item_func.cc:
  Remove use of default argument.
sql/item_func.h:
  Function agg_item_charsets() now handles non-consequtive Item *'s.
sql/item_strfunc.cc:
  Pass original Item **'s to agg_arg_charsets(), not local copies, to ensure
  proper restoration in THD::rollback_item_tree_changes().
sql/item_sum.cc:
  Remove use of default argument.
2006-06-30 09:26:36 +02:00
unknown
610b1a4ebd Manually merged
configure.in:
  Auto merged
client/mysqlbinlog.cc:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/archive.result:
  Auto merged
mysql-test/r/auto_increment.result:
  Auto merged
mysql-test/r/cast.result:
  Auto merged
mysql-test/r/ctype_utf8.result:
  Auto merged
mysql-test/r/func_group.result:
  Auto merged
mysql-test/r/func_str.result:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/r/multi_update.result:
  Auto merged
mysql-test/r/ndb_lock.result:
  Auto merged
mysql-test/r/replace.result:
  Auto merged
mysql-test/r/union.result:
  Auto merged
mysql-test/t/archive.test:
  Auto merged
mysql-test/t/auto_increment.test:
  Auto merged
mysql-test/t/delayed.test:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
mysql-test/t/multi_update.test:
  Auto merged
mysql-test/t/ndb_lock.test:
  Auto merged
mysql-test/t/select.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/ha_ndbcluster.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_timefunc.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/opt_sum.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  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_select.cc:
  Auto merged
sql/sql_select.h:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/structs.h:
  Auto merged
storage/archive/ha_archive.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
2006-06-18 14:56:35 +04:00
unknown
3796e37c72 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/usr/home/ram/work/mysql-5.0


sql/item_func.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
2006-06-16 16:43:44 +05:00
unknown
0237d9b0af String::set(double) and set(longlong) -> set_real() and set_int()
fix Field::store(double) being used instead of store(longlong)

NB: overloading functions is evil
2006-06-16 12:17:20 +02:00
unknown
dd285aac1b after-merge fixes.
mysql-test/r/rpl_log.result:
  after-merge fix.
sql/ha_archive.cc:
  after-merge fix.
sql/item_func.cc:
  after-merge fix.
sql/sql_class.cc:
  after-merge fix.
sql/sql_class.h:
  after-merge fix.
2006-06-16 14:05:58 +05:00
unknown
710abe5390 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0


mysql-test/r/ctype_sjis.result:
  Auto merged
mysql-test/t/ctype_sjis.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
2006-06-16 10:01:13 +02:00
unknown
64c856c939 Bug#14708: Inconsistent treatment of NULLs in LEFT JOINed FULLTEXT matching without index
Don't rely on table->null_row when no index is used - it may be a multi-table search
2006-06-16 09:49:18 +02:00
unknown
7c1748a1a4 cleanup String::set(integer) 2006-06-14 23:09:03 +02:00
unknown
a1017b09b4 Bug#8663 cant use bgint unsigned as input to cast
Problem: cast to unsigned limited result to 
max signed bigint 9223372036854775808,
instead of max unsigned bigint 18446744073709551615.

Fix: don't use args[0]->val_int() when casting from
a floating point number, use val() instead, with range checkings,
special to unsigned data type.

item_func.cc:
  Special handling of cast from REAL_RESULT
  to unsigned int: we cannot execute args[0]->val_int()
  because it cuts max allowed value to LONGLONG_INT,
  instead of ULONGLONG_INT required.
count_distinct3.test:
  Getting rid of "Data truncated; out of range ..." warnings.
cast.test, cast.result:
  Adding test case.
ps.result:
  Fixing that cast from 6570515219.6535 
  to unsigned didn't round to 6570515220,
  and returned 6570515219 instead.


mysql-test/r/cast.result:
  Adding test case.
mysql-test/r/ps.result:
  Fixing that cast from 6570515219.6535 
  to unsigned didn't round to 6570515220,
  and returned 6570515219 instead.
mysql-test/t/cast.test:
  Adding test case.
mysql-test/t/count_distinct3.test:
  Get rid of "wring unsigned value"
  warnings.
sql/item_func.cc:
  Special handling of cast from REAL)RESULT
  to unsigned int: we cannot execute args[0]->val_int()
  because it cuts max allowed value to LONGLONG_INT,
  instead of ULONGLONG_INT required.
2006-06-14 13:40:21 +05:00
unknown
115cb627b0 Bug#14708: Inconsistent treatment of NULLs in LEFT JOINed FULLTEXT matching without index
Don't rely on table->null_row when no index is used - it may be a multi-table
2006-06-14 09:19:02 +02:00
unknown
f067dfe1c6 Bug #7498 User variable SET saves SIGNED BIGINT as UNSIGNED BIGINT
- Add unsigned flag to user_var_entry, used when 'type' is INT_RESULT
- Propagate unsigned flag from the query executed by Item_single_row_subselect


mysql-test/r/user_var.result:
  Update test results
mysql-test/t/user_var.test:
  Add test case
sql/item_func.cc:
  Add unsigned_flag to user_var_entry. Used when 'type' is INT_RESULT
  Pass unsigned_flag to 'update_hash' if type is INT_RESULT
sql/item_func.h:
  Removed unused variable save_buff
  Add parameter unsigned_arg to 'update_hash'
sql/item_subselect.cc:
  Propagate unsigned_flag to Item_singlerow_subselect from the items in the select to the cached items.
sql/sql_class.h:
  Add unsigned_flag to user_var_entry. Used when 'type' is INT_RESULT
2006-06-09 19:35:54 +02:00
unknown
febe7eb64a Fix for bug #6880: LAST_INSERT_ID() within a statement
mysql-test/r/auto_increment.result:
  Fix for bug #6880: LAST_INSERT_ID() within a statement
    - test result
mysql-test/r/rpl_log.result:
  Fix for bug #6880: LAST_INSERT_ID() within a statement
    - test result
mysql-test/t/auto_increment.test:
  Fix for bug #6880: LAST_INSERT_ID() within a statement
    - test case
mysql-test/t/rpl_log.test:
  Fix for bug #6880: LAST_INSERT_ID() within a statement
    - test case
sql/item_func.cc:
  Fix for bug #6880: LAST_INSERT_ID() within a statement
    - return the first thd->last_insert_id set (within a query)
2006-06-07 14:01:10 +05:00
unknown
555eb848f2 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-new
into  mysql.com:/home/my/mysql-5.1


BitKeeper/etc/ignore:
  auto-union
include/heap.h:
  Auto merged
include/my_base.h:
  Auto merged
include/mysql_com.h:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/mysql-test-run.sh:
  Auto merged
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
  Auto merged
mysql-test/r/binlog_stm_mix_innodb_myisam.result:
  Auto merged
mysql-test/r/func_time.result:
  Auto merged
mysql-test/r/ndb_index_unique.result:
  Auto merged
mysql-test/t/func_time.test:
  Auto merged
mysql-test/t/view_grant.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/ha_berkeley.cc:
  Auto merged
sql/ha_berkeley.h:
  Auto merged
mysql-test/r/view_grant.result:
  Auto merged
sql/ha_federated.cc:
  Auto merged
sql/ha_federated.h:
  Auto merged
sql/ha_heap.h:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/ha_innodb.h:
  Auto merged
sql/ha_myisam.h:
  Auto merged
sql/ha_myisammrg.cc:
  Auto merged
sql/ha_ndbcluster.h:
  Auto merged
sql/ha_partition.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_subselect.h:
  Auto merged
sql/log.cc:
  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/spatial.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_bitmap.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_partition.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
sql/sql_handler.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/table.h:
  Auto merged
storage/archive/ha_archive.cc:
  Auto merged
storage/archive/ha_archive.h:
  Auto merged
storage/example/ha_example.cc:
  Auto merged
storage/myisam/ft_boolean_search.c:
  Auto merged
unittest/mysys/base64-t.c:
  Auto merged
mysql-test/r/innodb_mysql.result:
  manual merge
mysql-test/t/innodb_mysql.test:
  manual merge
mysql-test/valgrind.supp:
  manual merge
sql/event.cc:
  manual merge
sql/ha_heap.cc:
  manual merge
sql/ha_myisam.cc:
  manual merge
sql/ha_ndbcluster.cc:
  manual merge
sql/ha_ndbcluster_binlog.cc:
  manual merge
sql/ha_partition.cc:
  manual merge
sql/handler.cc:
  manual merge
  renamed print_key_dupp_error to print_key_dup_error
sql/handler.h:
  manual merge
  renamed print_key_dupp_error to print_key_dup_error
sql/item.h:
  automatic merge
sql/item_cmpfunc.cc:
  automatic merge
sql/log_event.cc:
  manual merge
  Trivial cleanup
sql/mysql_priv.h:
  manual merge
  renamed print_key_dupp_error to print_key_dup_error
sql/opt_range.cc:
  manual merge
  renamed print_key_dupp_error to print_key_dup_error
sql/sql_delete.cc:
  manual merge
  renamed print_key_dupp_error to print_key_dup_error
sql/sql_insert.cc:
  manual merge
  renamed print_key_dupp_error to print_key_dup_error
sql/sql_load.cc:
  manual merge
  renamed print_key_dupp_error to print_key_dup_error
sql/sql_select.cc:
  manual merge
  renamed print_key_dupp_error to print_key_dup_error
sql/sql_show.cc:
  manual merge
  renamed print_key_dupp_error to print_key_dup_error
sql/sql_table.cc:
  manual merge
  renamed print_key_dupp_error to print_key_dup_error
sql/sql_update.cc:
  manual merge
  renamed print_key_dupp_error to print_key_dup_error
sql/table.cc:
  manual merge
  renamed print_key_dupp_error to print_key_dup_error
storage/blackhole/ha_blackhole.cc:
  manual merge
  renamed print_key_dupp_error to print_key_dup_error
storage/csv/ha_tina.cc:
  manual merge
  renamed print_key_dupp_error to print_key_dup_error
mysql-test/valgrind.supp.orig:
  Manual merge
2006-06-04 21:05:22 +03:00
unknown
01d03e7b4b This changeset is largely a handler cleanup changeset (WL#3281), but includes fixes and cleanups that was found necessary while testing the handler changes
Changes that requires code changes in other code of other storage engines.
(Note that all changes are very straightforward and one should find all issues
by compiling a --debug build and fixing all compiler errors and all
asserts in field.cc while running the test suite),

- New optional handler function introduced: reset()
  This is called after every DML statement to make it easy for a handler to
  statement specific cleanups.
  (The only case it's not called is if force the file to be closed)

- handler::extra(HA_EXTRA_RESET) is removed. Code that was there before
  should be moved to handler::reset()

- table->read_set contains a bitmap over all columns that are needed
  in the query.  read_row() and similar functions only needs to read these
  columns
- table->write_set contains a bitmap over all columns that will be updated
  in the query. write_row() and update_row() only needs to update these
  columns.
  The above bitmaps should now be up to date in all context
  (including ALTER TABLE, filesort()).

  The handler is informed of any changes to the bitmap after
  fix_fields() by calling the virtual function
  handler::column_bitmaps_signal(). If the handler does caching of
  these bitmaps (instead of using table->read_set, table->write_set),
  it should redo the caching in this code. as the signal() may be sent
  several times, it's probably best to set a variable in the signal
  and redo the caching on read_row() / write_row() if the variable was
  set.

- Removed the read_set and write_set bitmap objects from the handler class

- Removed all column bit handling functions from the handler class.
  (Now one instead uses the normal bitmap functions in my_bitmap.c instead
  of handler dedicated bitmap functions)

- field->query_id is removed. One should instead instead check
  table->read_set and table->write_set if a field is used in the query.

- handler::extra(HA_EXTRA_RETRIVE_ALL_COLS) and
  handler::extra(HA_EXTRA_RETRIEVE_PRIMARY_KEY) are removed. One should now
  instead use table->read_set to check for which columns to retrieve.

- If a handler needs to call Field->val() or Field->store() on columns
  that are not used in the query, one should install a temporary
  all-columns-used map while doing so. For this, we provide the following
  functions:

  my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->read_set);
  field->val();
  dbug_tmp_restore_column_map(table->read_set, old_map);

  and similar for the write map:

  my_bitmap_map *old_map= dbug_tmp_use_all_columns(table, table->write_set);
  field->val();
  dbug_tmp_restore_column_map(table->write_set, old_map);

  If this is not done, you will sooner or later hit a DBUG_ASSERT
  in the field store() / val() functions.
  (For not DBUG binaries, the dbug_tmp_restore_column_map() and
  dbug_tmp_restore_column_map() are inline dummy functions and should
  be optimized away be the compiler).

- If one needs to temporary set the column map for all binaries (and not
  just to avoid the DBUG_ASSERT() in the Field::store() / Field::val()
  methods) one should use the functions tmp_use_all_columns() and
  tmp_restore_column_map() instead of the above dbug_ variants.

- All 'status' fields in the handler base class (like records,
  data_file_length etc) are now stored in a 'stats' struct. This makes
  it easier to know what status variables are provided by the base
  handler.  This requires some trivial variable names in the extra()
  function.

- New virtual function handler::records().  This is called to optimize
  COUNT(*) if (handler::table_flags() & HA_HAS_RECORDS()) is true.
  (stats.records is not supposed to be an exact value. It's only has to
  be 'reasonable enough' for the optimizer to be able to choose a good
  optimization path).

- Non virtual handler::init() function added for caching of virtual
  constants from engine.

- Removed has_transactions() virtual method. Now one should instead return
  HA_NO_TRANSACTIONS in table_flags() if the table handler DOES NOT support
  transactions.

- The 'xxxx_create_handler()' function now has a MEM_ROOT_root argument
  that is to be used with 'new handler_name()' to allocate the handler
  in the right area.  The xxxx_create_handler() function is also
  responsible for any initialization of the object before returning.

  For example, one should change:

  static handler *myisam_create_handler(TABLE_SHARE *table)
  {
    return new ha_myisam(table);
  }

  ->

  static handler *myisam_create_handler(TABLE_SHARE *table, MEM_ROOT *mem_root)
  {
    return new (mem_root) ha_myisam(table);
  }

- New optional virtual function: use_hidden_primary_key().
  This is called in case of an update/delete when
  (table_flags() and HA_PRIMARY_KEY_REQUIRED_FOR_DELETE) is defined
  but we don't have a primary key. This allows the handler to take precisions
  in remembering any hidden primary key to able to update/delete any
  found row. The default handler marks all columns to be read.

- handler::table_flags() now returns a ulonglong (to allow for more flags).

- New/changed table_flags()
  - HA_HAS_RECORDS	    Set if ::records() is supported
  - HA_NO_TRANSACTIONS	    Set if engine doesn't support transactions
  - HA_PRIMARY_KEY_REQUIRED_FOR_DELETE
                            Set if we should mark all primary key columns for
			    read when reading rows as part of a DELETE
			    statement. If there is no primary key,
			    all columns are marked for read.
  - HA_PARTIAL_COLUMN_READ  Set if engine will not read all columns in some
			    cases (based on table->read_set)
 - HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS
   			    Renamed to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION.
 - HA_DUPP_POS              Renamed to HA_DUPLICATE_POS
 - HA_REQUIRES_KEY_COLUMNS_FOR_DELETE
			    Set this if we should mark ALL key columns for
			    read when when reading rows as part of a DELETE
			    statement. In case of an update we will mark
			    all keys for read for which key part changed
			    value.
  - HA_STATS_RECORDS_IS_EXACT
			     Set this if stats.records is exact.
			     (This saves us some extra records() calls
			     when optimizing COUNT(*))
			    

- Removed table_flags()
  - HA_NOT_EXACT_COUNT     Now one should instead use HA_HAS_RECORDS if
			   handler::records() gives an exact count() and
			   HA_STATS_RECORDS_IS_EXACT if stats.records is exact.
  - HA_READ_RND_SAME	   Removed (no one supported this one)

- Removed not needed functions ha_retrieve_all_cols() and ha_retrieve_all_pk()

- Renamed handler::dupp_pos to handler::dup_pos

- Removed not used variable handler::sortkey


Upper level handler changes:

- ha_reset() now does some overall checks and calls ::reset()
- ha_table_flags() added. This is a cached version of table_flags(). The
  cache is updated on engine creation time and updated on open.


MySQL level changes (not obvious from the above):

- DBUG_ASSERT() added to check that column usage matches what is set
  in the column usage bit maps. (This found a LOT of bugs in current
  column marking code).

- In 5.1 before, all used columns was marked in read_set and only updated
  columns was marked in write_set. Now we only mark columns for which we
  need a value in read_set.

- Column bitmaps are created in open_binary_frm() and open_table_from_share().
  (Before this was in table.cc)

- handler::table_flags() calls are replaced with handler::ha_table_flags()

- For calling field->val() you must have the corresponding bit set in
  table->read_set. For calling field->store() you must have the
  corresponding bit set in table->write_set. (There are asserts in
  all store()/val() functions to catch wrong usage)

- thd->set_query_id is renamed to thd->mark_used_columns and instead
  of setting this to an integer value, this has now the values:
  MARK_COLUMNS_NONE, MARK_COLUMNS_READ, MARK_COLUMNS_WRITE
  Changed also all variables named 'set_query_id' to mark_used_columns.

- In filesort() we now inform the handler of exactly which columns are needed
  doing the sort and choosing the rows.

- The TABLE_SHARE object has a 'all_set' column bitmap one can use
  when one needs a column bitmap with all columns set.
  (This is used for table->use_all_columns() and other places)

- The TABLE object has 3 column bitmaps:
  - def_read_set     Default bitmap for columns to be read
  - def_write_set    Default bitmap for columns to be written
  - tmp_set          Can be used as a temporary bitmap when needed.
  The table object has also two pointer to bitmaps read_set and write_set
  that the handler should use to find out which columns are used in which way.

- count() optimization now calls handler::records() instead of using
  handler->stats.records (if (table_flags() & HA_HAS_RECORDS) is true).

- Added extra argument to Item::walk() to indicate if we should also
  traverse sub queries.

- Added TABLE parameter to cp_buffer_from_ref()

- Don't close tables created with CREATE ... SELECT but keep them in
  the table cache. (Faster usage of newly created tables).


New interfaces:

- table->clear_column_bitmaps() to initialize the bitmaps for tables
  at start of new statements.

- table->column_bitmaps_set() to set up new column bitmaps and signal
  the handler about this.

- table->column_bitmaps_set_no_signal() for some few cases where we need
  to setup new column bitmaps but don't signal the handler (as the handler
  has already been signaled about these before). Used for the momement
  only in opt_range.cc when doing ROR scans.

- table->use_all_columns() to install a bitmap where all columns are marked
  as use in the read and the write set.

- table->default_column_bitmaps() to install the normal read and write
  column bitmaps, but not signaling the handler about this.
  This is mainly used when creating TABLE instances.

- table->mark_columns_needed_for_delete(),
  table->mark_columns_needed_for_delete() and
  table->mark_columns_needed_for_insert() to allow us to put additional
  columns in column usage maps if handler so requires.
  (The handler indicates what it neads in handler->table_flags())

- table->prepare_for_position() to allow us to tell handler that it
  needs to read primary key parts to be able to store them in
  future table->position() calls.
  (This replaces the table->file->ha_retrieve_all_pk function)

- table->mark_auto_increment_column() to tell handler are going to update
  columns part of any auto_increment key.

- table->mark_columns_used_by_index() to mark all columns that is part of
  an index.  It will also send extra(HA_EXTRA_KEYREAD) to handler to allow
  it to quickly know that it only needs to read colums that are part
  of the key.  (The handler can also use the column map for detecting this,
  but simpler/faster handler can just monitor the extra() call).

- table->mark_columns_used_by_index_no_reset() to in addition to other columns,
  also mark all columns that is used by the given key.

- table->restore_column_maps_after_mark_index() to restore to default
  column maps after a call to table->mark_columns_used_by_index().

- New item function register_field_in_read_map(), for marking used columns
  in table->read_map. Used by filesort() to mark all used columns

- Maintain in TABLE->merge_keys set of all keys that are used in query.
  (Simplices some optimization loops)

- Maintain Field->part_of_key_not_clustered which is like Field->part_of_key
  but the field in the clustered key is not assumed to be part of all index.
  (used in opt_range.cc for faster loops)

-  dbug_tmp_use_all_columns(), dbug_tmp_restore_column_map()
   tmp_use_all_columns() and tmp_restore_column_map() functions to temporally
   mark all columns as usable.  The 'dbug_' version is primarily intended
   inside a handler when it wants to just call Field:store() & Field::val()
   functions, but don't need the column maps set for any other usage.
   (ie:: bitmap_is_set() is never called)

- We can't use compare_records() to skip updates for handlers that returns
  a partial column set and the read_set doesn't cover all columns in the
  write set. The reason for this is that if we have a column marked only for
  write we can't in the MySQL level know if the value changed or not.
  The reason this worked before was that MySQL marked all to be written
  columns as also to be read. The new 'optimal' bitmaps exposed this 'hidden
  bug'.

- open_table_from_share() does not anymore setup temporary MEM_ROOT
  object as a thread specific variable for the handler. Instead we
  send the to-be-used MEMROOT to get_new_handler().
  (Simpler, faster code)



Bugs fixed:

- Column marking was not done correctly in a lot of cases.
  (ALTER TABLE, when using triggers, auto_increment fields etc)
  (Could potentially result in wrong values inserted in table handlers
  relying on that the old column maps or field->set_query_id was correct)
  Especially when it comes to triggers, there may be cases where the
  old code would cause lost/wrong values for NDB and/or InnoDB tables.

- Split thd->options flag OPTION_STATUS_NO_TRANS_UPDATE to two flags:
  OPTION_STATUS_NO_TRANS_UPDATE and OPTION_KEEP_LOG.
  This allowed me to remove some wrong warnings about:
  "Some non-transactional changed tables couldn't be rolled back"

- Fixed handling of INSERT .. SELECT and CREATE ... SELECT that wrongly reset
  (thd->options & OPTION_STATUS_NO_TRANS_UPDATE) which caused us to loose
  some warnings about
  "Some non-transactional changed tables couldn't be rolled back")

- Fixed use of uninitialized memory in ha_ndbcluster.cc::delete_table()
  which could cause delete_table to report random failures.

- Fixed core dumps for some tests when running with --debug

- Added missing FN_LIBCHAR in mysql_rm_tmp_tables()
  (This has probably caused us to not properly remove temporary files after
  crash)

- slow_logs was not properly initialized, which could maybe cause
  extra/lost entries in slow log.

- If we get an duplicate row on insert, change column map to read and
  write all columns while retrying the operation. This is required by
  the definition of REPLACE and also ensures that fields that are only
  part of UPDATE are properly handled.  This fixed a bug in NDB and
  REPLACE where REPLACE wrongly copied some column values from the replaced
  row.

- For table handler that doesn't support NULL in keys, we would give an error
  when creating a primary key with NULL fields, even after the fields has been
  automaticly converted to NOT NULL.

- Creating a primary key on a SPATIAL key, would fail if field was not
  declared as NOT NULL.


Cleanups:

- Removed not used condition argument to setup_tables

- Removed not needed item function reset_query_id_processor().

- Field->add_index is removed. Now this is instead maintained in
  (field->flags & FIELD_IN_ADD_INDEX)

- Field->fieldnr is removed (use field->field_index instead)

- New argument to filesort() to indicate that it should return a set of
  row pointers (not used columns). This allowed me to remove some references
  to sql_command in filesort and should also enable us to return column
  results in some cases where we couldn't before.

- Changed column bitmap handling in opt_range.cc to be aligned with TABLE
  bitmap, which allowed me to use bitmap functions instead of looping over
  all fields to create some needed bitmaps. (Faster and smaller code)

- Broke up found too long lines

- Moved some variable declaration at start of function for better code
  readability.

- Removed some not used arguments from functions.
  (setup_fields(), mysql_prepare_insert_check_table())

- setup_fields() now takes an enum instead of an int for marking columns
   usage.

- For internal temporary tables, use handler::write_row(),
  handler::delete_row() and handler::update_row() instead of
  handler::ha_xxxx() for faster execution.

- Changed some constants to enum's and define's.

- Using separate column read and write sets allows for easier checking
  of timestamp field was set by statement.

- Remove calls to free_io_cache() as this is now done automaticly in ha_reset()

- Don't build table->normalized_path as this is now identical to table->path
  (after bar's fixes to convert filenames)

- Fixed some missed DBUG_PRINT(.."%lx") to use "0x%lx" to make it easier to
  do comparision with the 'convert-dbug-for-diff' tool.


Things left to do in 5.1:

- We wrongly log failed CREATE TABLE ... SELECT in some cases when using
  row based logging (as shown by testcase binlog_row_mix_innodb_myisam.result)
  Mats has promised to look into this.

- Test that my fix for CREATE TABLE ... SELECT is indeed correct.
  (I added several test cases for this, but in this case it's better that
  someone else also tests this throughly).
  Lars has promosed to do this.


BitKeeper/etc/ignore:
  added mysys/test_bitmap
include/base64.h:
  Removed my_global.h, as this must be included first in any program
include/heap.h:
  Added heap_reset() (Required by new handler interface)
include/my_base.h:
  Removed HA_EXTRA_RESET. MySQL will now call ::reset() instead of ::extra(HA_EXTRA_RESET).
  HA_EXTRA_RETRIVE_ALL_COLS and HA_EXTRA_RETRIVE_PRIMARY key are deleted as the column bitmaps makes these unnecessary
include/my_bitmap.h:
  Remove my_pthread.h (should be included at upper level)
  Introduced my_bitmap_map typedef to make it the bitmap handling more like a black box
  Added bitmap_is_overlapping(), bitmap_test_and_clear(), bitmap_copy() and bitmap_cmp()
  Made bitmap_set_bit(), bitmap_flip_bit(), bitmap_clear_bit() return void
include/myisam.h:
  Added mi_reset() (Required by new handler interface)
include/myisammrg.h:
  Added myrg_reset() (Required by new handler interface)
include/mysql_com.h:
  Added flag FIELD_IN_ADD_INDEX to be able to remove Field->add_index
mysql-test/extra/binlog_tests/mix_innodb_myisam_binlog.test:
  Added testing of CREATE ... SELECT in a mixed environment
  (This found some bugs that Mats is going to fix shortly)
mysql-test/install_test_db.sh:
  Simplify ldata usage
  Added --tmpdir=. option to mysqld bootstrap (Removed some warnings when TMPDIR was wrongly set)
mysql-test/mysql-test-run.pl:
  Added --tmpdir=. to bootstrap
mysql-test/mysql-test-run.sh:
  Use copy instead of INSTALL_DB for master and slave databases.
  (Speeds up startup time a lot!)
  Remove snapshot directories at startup (removes some strange warnings)
mysql-test/r/binlog_row_mix_innodb_myisam.result:
  Added testing of CREATE ... SELECT in a mixed environment
  (This found some bugs that Mats is going to fix shortly)
mysql-test/r/binlog_stm_mix_innodb_myisam.result:
  Added testing of CREATE ... SELECT in a mixed environment
mysql-test/r/create.result:
  Some extra tests of warnings and number of tables opened by CREATE ... SELECT
mysql-test/r/federated.result:
  Drop some left over tables
  Added testing of multiple table update and multiple table delete (with and without keys)
mysql-test/r/func_gconcat.result:
  Enable some disabled tests (converted them slightly to be predictable)
mysql-test/r/func_time.result:
  Added drop of test function
mysql-test/r/innodb_mysql.result:
  Added tests for CREATE ... SELECT
mysql-test/r/insert.result:
  More tests
  Added testing of duplicate columns in insert
mysql-test/r/loaddata.result:
  Added testing LOAD DATA ... SET ...
mysql-test/r/multi_update.result:
  Test multi updates and deletes using primary key and without
mysql-test/r/ndb_index_unique.result:
  Better error message
mysql-test/r/ndb_replace.result:
  New correct result after fixing REPLACE handling with NDB
mysql-test/r/rpl_ddl.result:
  Now we don't get these (wrong) warnings anymore
mysql-test/r/view_grant.result:
  Drop used views
mysql-test/t/create.test:
  Some extra tests of warnings and number of tables opened by CREATE ... SELECT
mysql-test/t/federated.test:
  Drop some left over tables
  Added testing of multiple table update and multiple table delete (with and without keys)
mysql-test/t/func_gconcat.test:
  Enable some disabled tests (converted them slightly to be predictable)
mysql-test/t/func_time.test:
  Added drop of test function
mysql-test/t/innodb_mysql.test:
  Added tests for CREATE ... SELECT
mysql-test/t/insert.test:
  More tests
  Added testing of duplicate columns in insert
mysql-test/t/loaddata.test:
  Added testing LOAD DATA ... SET ...
mysql-test/t/multi_update.test:
  Test multi updates and deletes using primary key and without
mysql-test/t/view_grant.test:
  Drop used views
mysql-test/valgrind.supp:
  Added supression of not needed warnings when printing stack trace
mysys/base64.c:
  Include my_global.h first
mysys/my_bitmap.c:
  Added bitmap_is_overlapping(), bitmap_test_and_clear() and bitmap_copy()
  Changed logic of bitmap handling to be a bit more efficent (Did this together with Mikael Ronström)
  Now the 'extra, not used bits' in the bitmap are assumed to have a 'random value' and the bitmap functions are free to change them whenever needed.
  Changed how mutex is allocated to make 'bitmap_free()' function simpler.
mysys/thr_lock.c:
  Added 0x before thread pointers (for easier comparison of DBUG traces)
sql/event.cc:
  Ensure 'use_all_columns()' is used for event tables
  Don't print warning that event table is damaged if it doesn't exists.
sql/field.cc:
  Added ASSERT_COLUMN_MARKED_FOR_WRITE in all store() methods and ASSERT_COLUMN_MARKED_FOR_READ in all val() methods to catch wrong setting if table->read_set and table->write_set
  (Rest of changes are only indentation cleanups)
sql/field.h:
  Removed Field->query_id (replaced by table->read_set and table->write_set)
  Removed Field->fieldnr (use Field->field_index instead)
  Removed Field->add_index (Use Field->flags instead)
  Add Field->part_of_key_not_clustered (for usage in opt_range.cc)
sql/filesort.cc:
  Added paramater sort_postion to filesort() to force sorting by position instead of storing all fields in the result set.
  This allowed me to remove checking of sql_command.
  Create a temporary column bitmap for fields that are used by the sorting process.
  Use column bitmaps instead of query_id
sql/ha_berkeley.cc:
  Update to 'newer' table handler interface
sql/ha_berkeley.h:
  Update to 'newer' table handler interface
sql/ha_federated.cc:
  Update to 'newer' table handler interface
  Only read columns that are needed from remote server.
  In case of eq ranges, don't generate two conditions in the WHERE clause
  (this can still be optimized, but would require a bigger code change)
  Use 'simpler to use' XXXX_LEN' macros
  A bit simpler logic in ::write_row() when creating statements.
  In update, only include test of fields actually read.
  (This greatly simplifies the queries sent by the federated engine)
  Similar changes done for delete_row()
sql/ha_federated.h:
  Update to 'newer' table handler interface
  Changed XXX_LEN macros to use sizeof(...)-1, to simplify usage in ha_federated.cc
  Added HA_PRIMARY_KEY_REQUIRED_FOR_DELETE to tell MySQL to read all primary key columns in case of DELETE
sql/ha_heap.cc:
  Update to 'newer' table handler interface
sql/ha_heap.h:
  Update to 'newer' table handler interface
sql/ha_innodb.cc:
  Update to 'newer' table handler interface
  - Update innobase_create_handler() to new interface
  - Removed HA_NOT_EXACT_COUNT (not needed)
  - Renamed HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION.
  - Prefixed base status variables with 'stats'
  - Use table column bitmaps instead of ha_get_bit_in_read_set()
  - Added ::reset(), with code from ::extra(HA_EXTRA_RESET)
  - Removed HA_EXTRA_RETRIVE_ALL_COLS and HA_EXTRA_RETRIEVE_PRIMARY_KEY as
    the table->read_set and table->write_set bitmaps now are accurate
sql/ha_innodb.h:
  Update to 'newer' table handler interface
  - table_flags are now ulonglong
  - Added reset() method
  - Removed not needed ha_retrieve_all_cols() and ha_retrieve_all_pk() columns.
  - Made build_template() a class function to be able to easier access class variables
sql/ha_myisam.cc:
  Update to 'newer' table handler interface
sql/ha_myisam.h:
  Update to 'newer' table handler interface
sql/ha_myisammrg.cc:
  Update to 'newer' table handler interface
sql/ha_myisammrg.h:
  Update to 'newer' table handler interface
sql/ha_ndbcluster.cc:
  Update to 'newer' table handler interface
  Fixed use_blob_value() to be accurate
  In ::complemented_read() we have to check both the read and write bitmap as the old code did mark all changed columns also in the read map
  Correct dumping of field data with DBUG_DUMP
  Prefix addresses in DBUG_PRINT with 0x
  Fixed usage of not initialized memory
  Update to use field->flags & FIELD_IN_ADD_INDEX instead of field->add_index.
sql/ha_ndbcluster.h:
  Update to 'newer' table handler interface
sql/ha_ndbcluster_binlog.cc:
  Mark usage of all columns in ndbcluster binlog tables
  false -> FALSE, true -> TRUE
  Use table->s->all_set instead of creating a temporary bitmap.
sql/ha_partition.cc:
  Update to 'newer' table handler interface
  Added memroot to initialise_partitions() and related functions to get faster memory allocation.
  partition_create_handler() is now responsible for initialisation of the partition object
  Some trivial optimizations and indentation fixes
  Ensure that table_flags() are up to date
  Removed documentation for removed HA_EXTRA flags
  Fixed 'strange' usage of m_file[i] in new_handlers_from_part_info()that worked in current code 'by chance'
sql/ha_partition.h:
  Update to 'newer' table handler interface
sql/handler.cc:
  create_xxx handler now takes MEMROOT as an argument to simplify memory allocation.
  Much simpler get_new_handler()
  (Initialization of the object is now handled by the create method for the engine)
  Moved all allocation of bitmap handling to the TABLE object (in table.cc)
  Added column_bitmaps_signal() to signal column usage changes.
  Changed binlog_log_row() to use the exiusting all_set bitmap in the table object.
  Added ha_reset() function to test that the file object is ok at end of statement and call handler::reset()
  Added use_hidden_primary_key() to signal handler that we we are going to read and update + delete the row and the handler should thus remember the position for the row
sql/handler.h:
  Added HA_NO_TRANSACTIONS, HA_PARTIAL_COLUMN_READ, HA_REQUIRES_KEY_COLUMNS_FOR_DELETE,HA_PRIMARY_KEY_REQUIRED_FOR_DELETE and HA_HAS_RECORDS
  Removed HA_NOT_EXACT_COUNT, HA_READ_RND_SAME
  HA_DUPP_POS -> HA_DUPLICATE_POS
  HA_NOT_EXACT_COUNT replaced by HA_STATS_RECORDS_IS_EXACT, HA_HAS_RECORDS and records()
  HA_PRIMARY_KEY_ALLOW_RANDOM_ACCESS renamed to HA_PRIMARY_KEY_REQUIRED_FOR_POSITION
  Added future row type 'ROW_TYPE_PAGES'
  Added MEM_ROOT to handlerton 'create' function
  Added ha_statistics, a structure for all status variable in the base handler class.
  Moved all status variables in the handler class into a stats structs to improve readability.
  ha_table_flags() is now a cached (not virtual) version of table_flags()
  reset() doesn't anymore call extra(HA_EXTRA_RESET) but is a function of it's own.
  Renamed dupp_ref to dup_ref
  Renamed not used handler::sortkey
  Moved read_set and write_set to TABLE structure
  handler::init() function added for cacheing of virtual constants from engine.
sql/item.cc:
  Added register_field_in_read_map() for marking used columns in expression.
  This is used by filesort() for creating an optimal column bitmap while retrieving columns for sorting.
  Initalize value.cs_info.character_set_client to fix core dump bug with --debug
  set_query_id -> mark_used_columns
  Mark used columns in read_set OR write_set.
sql/item.h:
  Removed reset_query_id_processor() as it's not needed anymore.
  Added register_field_in_read_map()
  Added extra argument to Item::walk() to indicate if we should also
  traverse sub queries.
sql/item_cmpfunc.cc:
  Temporary mark used columns to be read/writable
  Update Item::walk to new interface
sql/item_cmpfunc.h:
  Added extra argument to Item::walk() to indicate if we should also traverse sub queries.
sql/item_func.cc:
  Update Item::walk() to new interface
  table_flags() -> ha_table_flags()
sql/item_func.h:
  Update Item::walk() to new interface
sql/item_row.cc:
  Update Item::walk() to new interface
sql/item_row.h:
  Update Item::walk() to new interface
sql/item_strfunc.h:
  Update Item::walk() to new interface
sql/item_subselect.cc:
  Added Item_subselect::walk()
  (It was a bug it was missing before. Not sure what kind of bugs this could have caused)
sql/item_subselect.h:
  Update Item::walk() to new interface
sql/item_sum.cc:
  Update Item::walk() to new interface
  Updates for new handler interace
sql/item_sum.h:
  Update Item::walk() to new interface
sql/key.cc:
  Updates for new handler interace
sql/log.cc:
  Mark all columns used for log tables
  Split options flag
  Ensured that second argument to trans_register_ha is a bool
sql/log_event.cc:
  Fixed comments to be withing 79 characters
  Use OPTION_KEEP_LOG instead of OPTION_STATUS_NO_TRANS_UPDATE to remove wrong warnings
  Updates for new handler interface
  Use 0x%lx instead of %p (portability problem)
sql/mysql_priv.h:
  Added OPTION_KEEP_LOG to indicate that we should replicate the binlog even on rollback
  Removed not used 'conds' argument to setup_tables
sql/mysqld.cc:
  Indentation fixes and removed old comment
sql/opt_range.cc:
  Update to new handler and bitmap interface.
  Fixed calls to cp_buffer_from_ref() and walk() (new argument).
  Create new temporary bitmaps for ror scans.
  (Needed because of handler changes and to get more accurate column bitmaps than before)
  Remove not needed file->ha_reset() call before file->close().
  Some trivial optimization and indentation fixes.
  Use Field->part_of_key_not_clustered() to check if field is part of a key, instead of looping over all key parts.
  
  Added flag 'in_ror_merged_scan' to allow ::get_next() to know that we need a special column bitmap to only fetch pointer to record.
  This is needed because ror scan uses the same TABLE object but different file objects, which creates problem for the column bitmap handling.
  (This is a temporary solution. A better one would be to allocate an own TABLE object for ROR scans)
  
  Optimized bitmap handling in ror scans:
  - Start bitmap at position 0, not 1
  - Use same bitmap size as in TABLE
  - Use table->read_set and table->write_set to create column bitmaps instead of looping over all fields in table
sql/opt_range.h:
  Added 'in_ror_merged_scan' to indicate if we are doing a ROR scan
  Added temporary column bitmaps used in ROR scans
sql/opt_sum.cc:
  Added get_ext_record_count() which is used in COUNT() optimization if handler has HA_HAS_RECORDS
  Note that we don't call this if handler has HA_STATS_RECORDS_IS_EXACT set.
sql/protocol.cc:
  We need to mark columns as readable in ::store() as we sometimes return default value for fields to the user
sql/records.cc:
  Updates for new handler interface
sql/set_var.cc:
  Handle splitting OPTION_STATUS_NO_TRANS_UPDATE to two flags
sql/share/errmsg.txt:
  Fixed wrong
sql/sp.cc:
  Mark that we are using all columns for the proc table
  Update call to setup_tables() to use new prototype
sql/sp_head.cc:
  Removed QQ comment
sql/spatial.cc:
  Removed wrong QQ comment
sql/sql_acl.cc:
  Mark that we need all columns for acl tables
  Supply memroot to some 'new' calls.
  Indentation fixes
sql/sql_base.cc:
  set_query_id removed
  Ensure we call ha_reset() at end of each statement
  Mark read columns in read_set and changed columns in write_set (Before all columns was marked in read set)
  Fixed marking of some columns that was not proplerly marked before
  Maintain in TABLE->merge_keys set of all keys that are used in some way
  Removed not used 'conds' argument from setup_tables()
  Remove not used setting of 'dupp_field' in insert_fields()
  Added missing FN_LIBCHAR in mysql_rm_tmp_tables()
  (This has probably caused us to not properly remove temporary files after crash)
sql/sql_bitmap.h:
  Added is_overlapping()
sql/sql_class.cc:
  Slow_logs was not properly initialized, which could maybe cause extra/lost entries in slow log.
  set_query_id -> mark_used_columns
  Simpler variable usage in pack_row()  (cleanup)
  Moved some variable declartion at start of function for better code readability
sql/sql_class.h:
  Added enum_mark_columns
  Updated comments
  Renamed dupp_field -> dup_field
  Added virtual function 'can_rollback_data()' to select_insert() to be used in CREATE ... SELECT to optimize use of OPTION_STATUS_NO_TRANS_UPDATE.
  (This fixes a bug in CREATE ... SELECT where we did give wrong warnings when using non transacational tables)
sql/sql_delete.cc:
  Updates to new handler interface
  Call table->mark_columns_needed_for_delete() to allow us to put additional columns in column usage maps if handler so requires.
  Call table->prepare_for_position() to tell handler that we are going to call ha_position().
  Removed call to free_io_cache(). (io_cache is now removed in ha_reset()).
  Fixed calls to setup_tables()
sql/sql_do.cc:
  Update call to setup_fields()
sql/sql_handler.cc:
  Tell handler tables to always read all columns.
  Use temporary column map when storing value in field for later index usage
sql/sql_help.cc:
  Makr all used fields to be read
  Update call to setup_fields()
sql/sql_insert.cc:
  Tell handler we are going to update the auto_increment column
  dupp_field -> dup_field
  Set column usage bits for timestamp field.
  Call table->mark_columns_needed_for_insert() and table->mark_auto_increment_column()
  Removed not used argument from mysql_prepare_insert_check_table().
  
  If we get an duplicate row on insert, change column map to read and write all columns while retrying the operatation.
  This is required by the definition of REPLACE and also ensures that fields that are only part of UPDATE are properly handled.
  This fixed a bug in NDB and REPLACE where REPLACE wrongly copied some column values from the replaced row.
  
  Setup new bitmaps for delayed insert rows
  Remove reseting of next_number_fields as it will be reset on next call to handler_insert()
  
  Fixed usage of thd->options and OPTION_STATUS_NO_TRANS_UPDATE.
  The issue was that one should not to reset this flag as it may be set by a previous statement.
  The way it was now used caused us to loose some warnings and get other wrong warnings when using non transactional tables mixed with transactional.
  I fixed it by introducing 'select_insert::can_rollback_data' to inform send_error() that the given statement can be rolled back (which in case of CREATE TABLE can always be done)
  Don't close tables created with CREATE ... SELECT but keep them in the table cache.
  
  Moved out MY_HOOKS from inside function (better readability)
sql/sql_load.cc:
  Update to use new handler and column marking interface
  Update using setup_tables()
sql/sql_olap.cc:
  Update calls to setup_tables
  Use enums instead of constants to setup_fields()
sql/sql_parse.cc:
  Handle OPTION_KEEP_LOG:
  - Set it on CREATE TEMPORARY TABLE / DROP TABLE
  - Reset it when OPTION_STATUS_NO_TRANS_UPDATE is reset
  - Don't set it for CREATE ... SELECT (this is handled in select_create class)
  Remove reseting of OPTION_STATUS_NO_TRANS_UPDATE in begin_trans() as this should already be reset.
  If in autocommit mode, reset OPTION_KEEP_LOG and OPTION_STATUS_NO_TRANS_UPDATE to not give warnings in future commands
sql/sql_partition.cc:
  Update walk() usage
  Trivial indentation fixes
sql/sql_plugin.cc:
  Mark all columns as used for plugins
sql/sql_prepare.cc:
  Added assert to find out hidden bugs in character_set_client (got an error in debug binary when this not set correctly)
  Updates for new handler interface
  Update calls to setup_fields()
sql/sql_repl.cc:
  Indentation fixes
sql/sql_select.cc:
  Update call to setup_tables() and setup_fields()
  Remove some old disabled code
  Update to new hadler interface
  Indentation cleanups
  Added column bitmaps for temporary tables.
  Remove updating of the removed slots in the Field class
  Added TABLE argument to cp_buffer_from_ref() (To be able to install temporary column maps)
  For internal temporary tables, use handler::write_row(), handler::delete_row() and handler::update_row() instead of handler::ha_xxxx() for faster execution.
sql/sql_select.h:
  Indentaition fixes.
  Install temporary column usage maps when needed
  Added TABLE element to cp_buffer_from_ref()
sql/sql_show.cc:
  Update to new handler interface
  Mark all columns used for internal tables.
  Style fixes.
  Added support for 'future' ROW_TYPE_PAGES.
  Don't allocate TMP_TABLE_PARAM with calloc. The 'init()' function will initialize the structure properly.
sql/sql_table.cc:
  Update to new handler interface
  Simple my_snprintf -> strmake()
  Changed some constants to defines
  Don't test for NULL in primary key (as we a couple of line above force the PRIMARY KEY to be NOT NULL)
  Change field->add_index to use field->flags & FIELD_IN_ADD_INDEX
  Mark all columns as used for ALTER TABLE
  Style fixes
  Update call to filesort()
sql/sql_trigger.h:
  Added friend functions to be able to test if triggers exists for table we are going to insert/update or delete in.
sql/sql_udf.cc:
  Mark all columns as used for udf system table.
sql/sql_union.cc:
  Update call to walk()
  Update to new handler interface
sql/sql_update.cc:
  Remove query_id argument from compare_record()
  Use column bitmaps instead of query_id.
  We can't use compare_records() to skip updates for handlers that returns a partial column set and the read_set doesn't cover all columns in the write set, because compare_record() can't in this case know if a not read column changed value.
  Update call to setup_fields()
  Using separate column read and write sets allows for easier checking of timestamp field was set by statement.
  Removed call to free_io_cache() as this is now done in ha_reset()
  Call table->mark_columns_needed_for_update() and table->prepare_for_position()
  Style fixes
sql/sql_view.cc:
  Style fixes
sql/table.cc:
  Remove implicitely include 'errno.h'
  Remove code for building normalized path, as this is now identical to 'path'
  Remove field->fieldnr
  Added update of field->part_of_key_not_clustered()
  Create column bitmaps in TABLE and TABLE_SHARE
  Don't setup a temporary MEM_ROOT object as a thread specific variable for the handler. Instead we send the to-be-used MEMROOT to get_new_handler()
  Update to new handler interface
  Update call to walk()
  Added new functions:
  - st_table::clear_column_bitmaps()
  - st_table::prepare_for_position()
  - st_table::mark_columns_used_by_index()
  - st_table::restore_column_maps_after_mark_index()
  - st_table::mark_columns_used_by_index_no_reset()
  - st_table::mark_auto_increment_column()
  - st_table::mark_columns_needed_for_delete()
  - st_table::mark_columns_needed_for_update()
  - st_table::mark_columns_needed_for_insert()
sql/table.h:
  Moved column usage bitmaps from handler to TABLE
  Added to TABLE_SHARE all_set and column_bitmap_size
  Added to TABLE merge_keys, bitmap_init_values, def_read_set, def_write_set, tmp_set, read_set and write_set.
  Declared all new table column bitmap functions
  Added TABLE functions column_bitmaps_set(), column_bitmaps_set_no_signal(), use_all_columns() and default_column_bitmaps()
  Added functions: tmp_use_all_columns() and tmp_restore_column_map() to temporarly switch column bitmaps
  Added functions: dbug_tmp_use_all_columns() and dbug_tmp_restore_column_map() to temporarly switch column bitmaps to avoid asserts in Field::store() and Field::val().
sql/tztime.cc:
  Mark all columns as used for timezone tables
storage/archive/ha_archive.cc:
  Update to new handler interface
storage/archive/ha_archive.h:
  Update to new handler interface
storage/blackhole/ha_blackhole.cc:
  Update to new handler interface
storage/blackhole/ha_blackhole.h:
  Update to new handler interface
  removed not needed flag HA_DUPP_POS
storage/csv/ha_tina.cc:
  Update to new handler interface
storage/csv/ha_tina.h:
  Update to new handler interface
storage/example/ha_example.cc:
  Update to new handler interface
storage/example/ha_example.h:
  Update to new handler interface
storage/heap/hp_extra.c:
  Added heap_reset() (Required by new handler interface)
storage/heap/hp_test2.c:
  Use heap_reset()
storage/myisam/ft_boolean_search.c:
  Fixed compiler warning
storage/myisam/mi_extra.c:
  Added mi_reset() (Required by new handler interface)
storage/myisam/mi_search.c:
  Fixed DBUG_PRINT messages to use 0x%lx instead of %lx
storage/myisam/mi_test2.c:
  Use mi_reset()
storage/myisam/myisampack.c:
  Use mi_reset()
storage/myisammrg/myrg_extra.c:
  Added myrg_reset() (Required by new handler interface)
unittest/mysys/base64.t.c:
  Include my_global.h
  Don't include implictely include file 'stdlib.h'
2006-06-04 18:52:22 +03:00
unknown
650fea23b1 Merge mysql.com:/home/jimw/my/mysql-5.0-clean
into  mysql.com:/home/jimw/my/mysql-5.1-clean


include/my_pthread.h:
  Auto merged
mysql-test/r/func_str.result:
  Auto merged
mysql-test/r/join_outer.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/variables.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/rpl_temporary.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
mysql-test/t/view.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/item_subselect.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
storage/ndb/test/ndbapi/Makefile.am:
  Auto merged
storage/ndb/test/ndbapi/testInterpreter.cpp:
  Auto merged
sql/set_var.cc:
  Resolve conflict
storage/ndb/src/kernel/blocks/dbtup/DbtupExecQuery.cpp:
  Resolve conflict
2006-05-19 19:07:33 -07:00
unknown
1875f3155c Merge mysql.com:/usr/local/mysql/tmp_merge
into  mysql.com:/usr/local/mysql/merge-5.1


mysql-test/lib/mtr_process.pl:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/sp-error.result:
  Auto merged
mysql-test/r/sp.result:
  Auto merged
mysql-test/r/trigger-grant.result:
  Auto merged
mysql-test/r/trigger.result:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
mysql-test/t/trigger-grant.test:
  Auto merged
mysql-test/t/trigger.test:
  Auto merged
server-tools/instance-manager/options.h:
  Auto merged
sql/field_conv.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
server-tools/instance-manager/options.cc:
  Manual merge
sql/item_func.cc:
  Manual merge
sql/mysql_priv.h:
  Manual merge
sql/sp_head.cc:
  Manual merge
sql/sql_table.cc:
  Manual merge
2006-05-18 11:56:50 +02:00
unknown
1c6beaee06 Fixed bug#19077: A nested materialized derived table is used before being populated.
The convert_constant_item() function converts constant items to ints on
prepare phase to optimize execution speed. In this case it tries to evaluate
subselect which contains a derived table and is contained in a derived table. 
All derived tables are filled only after all derived tables are prepared.
So evaluation of subselect with derived table at the prepare phase will
return a wrong result.

A new flag with_subselect is added to the Item class. It indicates that
expression which this item represents is a subselect or contains a subselect.
It is set to 0 by default. It is set to 1 in the Item_subselect constructor
for subselects.
For Item_func and Item_cond derived classes it is set after fixing any argument
in Item_func::fix_fields() and Item_cond::fix_fields accordingly.
The convert_constant_item() function now doesn't convert a constant item
if the with_subselect flag set in it. 


mysql-test/t/view.test:
  Added test case for bug#19077: A nested materialized derived table is used before being populated.
mysql-test/t/subselect.test:
  Added test case for bug#19077: A nested materialized derived table is used before being populated.
mysql-test/r/view.result:
  Added test case for bug#19077: A nested materialized derived table is used before being populated.
mysql-test/r/subselect.result:
  Added test case for bug#19077: A nested materialized derived table is used before being populated.
sql/item_subselect.cc:
  Fixed bug#19077: A nested materialized derived table is used before being populated.
  The Item_subselect class constructor sets new with_subselect flag to 1.
sql/item_func.cc:
  Fixed bug#19077: A nested materialized derived table is used before being populated.
  
  The Item_func::fix_fields() sets new with_subselect flag from with_subselect flags of its arguments.
sql/item_cmpfunc.cc:
  Fixed bug#19077: A nested materialized derived table is used before being populated.
  The convert_constant_item() function now doesn't convert a constant item
  with the with_subselect flag set.
  The Item_cond::fix_fields() sets new with_subselect flag from with_subselect flags of its arguments.
sql/item.cc:
  Fixed bug#19077: A nested materialized derived table is used before being populated.
  Set new with_subselect flag to default value - 0 in the Item constructor.
sql/item.h:
  Fixed bug#19077: A nested materialized derived table is used before being populated.
  A new flag with_subselect is added to the Item class. It indicates that
  expression which this item represents is a subselect or contains a subselect.
  It is set to 0 by default.
2006-05-18 00:55:28 +04:00
unknown
798e910bad After-merge fixes; some function signatures changed from Item * to Item **.
sql/item.cc:
  After-merge fixes.
sql/item.h:
  After-merge fixes.
sql/item_func.cc:
  After-merge fixes.
sql/item_func.h:
  After-merge fixes.
sql/sp_head.cc:
  After-merge fixes.
2006-05-15 19:57:10 +02:00
unknown
2ce5e54e0a Merge mysql.com:/opt/local/work/mysql-5.0-root
into  mysql.com:/opt/local/work/mysql-5.0-runtime-merge


mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/im_options_set.result:
  Auto merged
mysql-test/r/im_options_unset.result:
  Auto merged
mysql-test/r/trigger-grant.result:
  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/sp_head.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2006-05-15 00:51:12 +04:00
unknown
afe2520ecf Bug#14635: Accept NEW.x as INOUT parameters to stored procedures
from within triggers

Add support for passing NEW.x as INOUT and OUT parameters to stored
procedures.  Passing NEW.x as INOUT parameter requires SELECT and
UPDATE privileges on that column, and passing it as OUT parameter
requires only UPDATE privilege.


mysql-test/r/sp-error.result:
  Update the result for new message.
mysql-test/r/trigger-grant.result:
  Add result for bug#14635.
mysql-test/r/trigger.result:
  Add result for bug#14635.
mysql-test/t/trigger-grant.test:
  Add test case for bug#14635.
mysql-test/t/trigger.test:
  Add test case for bug#14635.
sql/item.cc:
  Add implementations of set_value() and set_required_privilege() methods
  of Settable_routine_parameter interface.
  
  Use Item_trigger_field::want_privilege instead of
  Item_trigger_field::access_type.
  
  Reset privileges on Item_trigger_field::cleanup().
sql/item.h:
  Add interface class Settable_routine_parameter and interface query
  method to Item class.  Item_splocal and Item_trigger_field implement
  this interface.
  
  For Item_trigger_field:
   - add read_only attribute and is_read_only() method.
   - remove access_type and add original_privilege and want_privilege
     instead.
   - add set_value() method.
   - add reset_privilege() method.
sql/item_func.cc:
  Add implementations of set_value() method of Settable_routine_parameter
  interface.
sql/item_func.h:
  Item_func_get_user_var implements Settable_routine_parameter interface.
sql/share/errmsg.txt:
  Update english ER_SP_NOT_VAR_ARG message.
sql/sp_head.cc:
  Use Settable_routine_parameter interface for parameter update.
sql/sql_yacc.yy:
  Set read_only and want_privilege members in Item_trigger_field
  appropriately.  For NEW.x trigger variable used in left-hand-side
  of SET statement the latter is set to UPDATE_ACL, otherwise it is
  set to SELECT_ACL (but see Item_trigger_field::set_required_privilege(),
  where it may be updated to different value).
2006-05-12 13:55:21 +04:00
unknown
24a0b385fb Fix for BUG#18587: Function that accepts and returns TEXT
garbles data if longer than 766 chars.

The problem is that a stored routine returns BLOBs to the previous
caller, BLOBs are shallow-copied (i.e. only pointers to the data are
copied). The fix is to also copy data of BLOBs.


mysql-test/r/sp.result:
  Updated result file.
mysql-test/t/sp.test:
  Added a test case for BUG#18587.
sql/field_conv.cc:
  Do not jump to optimization if the field type is BLOB and
  the destination table requires copying of BLOBs.
sql/item_func.cc:
  Request copying BLOBs for the result table.
2006-05-10 23:16:30 +04:00
unknown
f296bb095d Merge ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0
into  ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.1-new


BitKeeper/deleted/.del-changelog-4.0.xml~8f56ee8a913e848b:
  Auto merged
BitKeeper/deleted/.del-changelog-4.1.xml~8aa496ebed09d868:
  Auto merged
BitKeeper/deleted/.del-changelog-5.0.xml~f4c50926ccdd7434:
  Auto merged
BitKeeper/deleted/.del-client-req.pem~efd482e1d290d4d8:
  Auto merged
BitKeeper/deleted/.del-server-req.pem~16301893cacf1be4:
  Auto merged
client/mysql.cc:
  Auto merged
configure.in:
  Auto merged
BitKeeper/deleted/.del-Makefile.am~de166d6fcac3b9b6:
  Auto merged
BitKeeper/deleted/.del-NOTES~e926d3e6929ac052:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqlimport.c:
  Auto merged
client/mysqltest.c:
  Auto merged
include/mysql.h:
  Auto merged
libmysql/libmysql.c:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/auto_increment.result:
  Auto merged
mysql-test/r/date_formats.result:
  Auto merged
mysql-test/r/func_misc.result:
  Auto merged
mysql-test/r/gis-rtree.result:
  Auto merged
mysql-test/r/information_schema.result:
  Auto merged
mysql-test/r/ndb_condition_pushdown.result:
  Auto merged
mysql-test/r/symlink.result:
  Auto merged
mysql-test/std_data/cacert.pem:
  Auto merged
mysql-test/std_data/client-cert.pem:
  Auto merged
mysql-test/std_data/client-key.pem:
  Auto merged
mysql-test/std_data/server-cert.pem:
  Auto merged
mysql-test/std_data/server-key.pem:
  Auto merged
mysql-test/t/date_formats.test:
  Auto merged
mysql-test/t/having.test:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
mysql-test/t/ndb_condition_pushdown.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_acl.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql-common/client.c:
  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
storage/ndb/include/ndbapi/NdbOperation.hpp:
  Auto merged
storage/ndb/include/util/NdbSqlUtil.hpp:
  Auto merged
storage/ndb/src/common/util/NdbSqlUtil.cpp:
  Auto merged
storage/ndb/src/kernel/blocks/dbtc/DbtcInit.cpp:
  Auto merged
vio/vio.c:
  Auto merged
client/client_priv.h:
  manual merge
include/violite.h:
  Automatic
mysql-test/Makefile.am:
  manual merge
mysql-test/r/mysqldump.result:
  Automatic
mysql-test/r/rpl_user_variables.result:
  Manual merge (diff is because lars removed displaying of binlog)
mysql-test/t/disabled.def:
  manual merge
mysql-test/t/mysqldump.test:
  manual merge
mysql-test/t/rpl_user_variables.test:
  manual merge (Changes becasue of lars removed binlog logging)
sql/mysqld.cc:
  manual merge
vio/viossl.c:
  manual merge
vio/viosslfactories.c:
  manual merge
client/client_priv.h.rej:
  merge 5.0 -> 5.1
2006-05-09 20:50:29 +03:00
unknown
c7e2527c9a Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0


sql/item_func.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
2006-05-09 10:44:19 +02:00
unknown
048469eb79 Merge mysql.com:/usr_rh9/home/elkin.rh9/4.1
into  mysql.com:/usr_rh9/home/elkin.rh9/MySQL/Merge/5.0-bug19136


sql/item_func.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
mysql-test/r/rpl_user_variables.result:
  manual merge use local
mysql-test/t/rpl_user_variables.test:
  manual merge use version 5.0's "show binlog events from 98"
2006-05-07 16:02:55 +03:00
unknown
ce6a2d32b3 Merge mysql.com:/usr_rh9/home/elkin.rh9/MySQL/BARE/4.1
into  mysql.com:/usr_rh9/home/elkin.rh9/MySQL/FIXES/4.1-bug19136_unass_user_var


sql/item_func.cc:
  Auto merged
2006-05-07 11:43:27 +03:00
unknown
77b7a71dd4 Merge mysql.com:/home/tomash/src/mysql_ab/tmp_merge
into  mysql.com:/home/tomash/src/mysql_ab/mysql-5.0-merge


mysql-test/r/func_misc.result:
  Manual merge of the fix for bug#16501.
mysql-test/t/func_misc.test:
  Manual merge of the fix for bug#16501.
sql/item_func.cc:
  Manual merge of the fix for bug#16501.
sql/sql_acl.cc:
  For the fix of bug#16372, use local version, since the fix for 5.0 is
  different, and will go in separate ChangeSet.
2006-05-06 11:18:42 +04:00
unknown
4ab4631b06 Bug#19136: Crashing log-bin and uninitialized user variables in a derived table
The reason of the bug is in that `get_var_with_binlog' performs missed
assingment of
the variables as side-effect. Doing that it eventually calls
`free_underlaid_joins' to pass as an argument `thd->lex->select_lex' of the lex
which belongs to the user query, not 
to one which is emulated i.e SET @var1:=NULL.


`get_var_with_binlog' is refined to supply a temporary lex to sql_set_variables's stack.


mysql-test/r/rpl_user_variables.result:
  results changed
mysql-test/t/rpl_user_variables.test:
  a problematic query to be binlogged is added
sql/item_func.cc:
  BUG#19136: Crashing log-bin and uninitialized user variables
  
  The reason of the bug is in that how `get_var_with_binlog' performs missed
  assingment of the variables: `free_underlaid_joins' gets as an argument `thd->lex->select_lex'
  which belongs to the user query, not to one which is emulated i.e SET @var1:=NULL.
  
  `get_var_with_binlog' is refined to supply a temporary lex to sql_set_variables's stack.
2006-05-05 11:21:21 +03:00
unknown
9f7548ae36 Merge mysql.com:/home/jimw/my/tmp_merge
into  mysql.com:/home/jimw/my/mysql-5.1-clean


mysql-test/r/user_var.result:
  Auto merged
mysql-test/r/variables.result:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
mysql-test/mysql-test-run.pl:
  Resolve conflict
mysql-test/ndb/ndbcluster.sh:
  Resolve conflict
sql/set_var.cc:
  Resolve conflict
sql/share/errmsg.txt:
  Resolve conflict
2006-04-30 09:43:26 -07:00
unknown
d0ed411f79 Fix small bug in udf_example.cc, it was processing one char too much and thus returning junk
Add more DBUG_PRINT's in udf_handler::val_str
Enable udf.test


mysql-test/t/disabled.def:
  Enable udf.test
sql/item_func.cc:
  Add DBUG_ printouts for easier debugging of installed udf's
sql/udf_example.cc:
  Bug fix, break for loop when "n < n_end"
2006-04-28 11:37:20 +02:00
unknown
8d52b8a6b7 Merge mysql.com:/home/jimw/my/mysql-5.0-12792
into  mysql.com:/home/jimw/my/mysql-5.0-clean


sql/item_func.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
mysql-test/r/variables.result:
  Resolve conflict
mysql-test/t/variables.test:
  Resolve conflict
2006-04-26 11:39:48 -07:00
unknown
225330cd5b Merge mysql.com:/extern/mysql/5.1/generic/mysql-5.0-merge
into  mysql.com:/extern/mysql/5.1/generic/mysql-5.1-new


mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/sp.result:
  Auto merged
mysql-test/r/timezone_grant.result:
  Auto merged
mysql-test/r/trigger.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/innodb.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
mysql-test/t/trigger.test:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/lex.h:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
mysql-test/r/rpl_insert_id.result:
  Manual merge.
mysql-test/t/disabled.def:
  Manual merge.
mysql-test/t/rpl_insert_id.test:
  Manual merge.
sql/item_func.cc:
  Manual merge.
sql/sql_yacc.yy:
  Manual merge - not complete yet.
2006-04-25 16:20:49 +02:00
unknown
9fc25141a2 Bug#16501: IS_USED_LOCK does not appear to work
Update User_level_lock::thread_id on acquiring an existing lock,
and reset it on lock release.


mysql-test/r/func_misc.result:
  Add result for bug#16501.
mysql-test/t/func_misc.test:
  Add test case for bug#16501.
sql/item_func.cc:
  Update User_level_lock::thread_id on acquiring an existing lock,
  and reset it on lock release (for safety).
2006-04-24 18:06:43 +04:00
unknown
4cfc649d25 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-merge-5.1


configure.in:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/share/errmsg.txt:
  merge
2006-04-24 13:32:07 +03:00
unknown
38c4f0b769 Merge mysql.com:/opt/local/work/tmp_merge
into  mysql.com:/opt/local/work/mysql-5.1-merge


mysql-test/r/trigger.result:
  Auto merged
mysql-test/t/trigger.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_create.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/mysqld.cc:
  Manual merge.
sql/sp_head.cc:
  Manual merge.
sql/sql_parse.cc:
  Manual merge.
2006-04-23 04:04:36 +04:00
unknown
4e5bed78df Bug #12792: @@system_time_zone is not SELECTable
Bug #15684: @@version_* are not all SELECTable

  Added the appropriate information as read-only system variables, and
  also removed some special-case handling of @@version along the way.

  @@version_bdb was added, but isn't included in the test because it
  depends on the presence of BDB.


mysql-test/r/variables.result:
  Update results
mysql-test/t/variables.test:
  Fix error from setting @@version, reset sql_select_limit to avoid confusion
  in later tests, and add new regression tests.
sql/item_func.cc:
  Remove special-case handling of VERSION, it's just a read-only server
  variable like the others now.
sql/set_var.cc:
  Add system_time_zone and various version-related system variables
2006-04-20 21:56:53 -07:00
unknown
c7cd7951cf Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mysql.com:/home/dlenev/mysql-5.0-bg16021


sql/item_func.cc:
  Auto merged
2006-04-19 19:35:32 +04:00
unknown
750bc26998 Merge mysql.com:/extern/mysql/bk/mysql-5.0-runtime
into  mysql.com:/extern/mysql/5.0/bug18787/mysql-5.0-runtime


mysql-test/r/sp.result:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
sql/item_func.cc:
  Auto merged
2006-04-18 11:20:18 +02:00
unknown
d9142f992e Post-review fix for BUG#18787. Renamed a local variable in
Item_func_sp::tmp_table_field() to something more descriptive.


sql/item_func.cc:
  Renamed local variable 'res' to 'field' in Item_func_sp::tmp_table_field(),
  because it is.
2006-04-18 11:16:39 +02:00
unknown
8dc06e0f06 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-5.0


sql/item_func.cc:
  Auto merged
2006-04-14 02:02:28 +03:00
unknown
1cc27df05d Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into  sanja.is.com.ua:/home/bell/mysql/bk/work-5.0


BitKeeper/deleted/.del-acinclude.m4~f4ab416bac5003:
  Auto merged
configure.in:
  Auto merged
mysql-test/r/func_op.result:
  Auto merged
sql/item_func.cc:
  Auto merged
2006-04-13 15:07:50 +03:00
unknown
a2066982f1 Fixed bug#14169: type of group_concat() result changed to blob if tmp_table was
used

In a simple queries a result of the GROUP_CONCAT() function was always of 
varchar type.
But if length of GROUP_CONCAT() result is greater than 512 chars and temporary
table is used during select then the result is converted to blob, due to
policy to not to store fields longer than 512 chars in tmp table as varchar
fields.

In order to provide consistent behaviour, result of GROUP_CONCAT() now
will always be converted to blob if it is longer than 512 chars.
Item_func_group_concat::field_type() is modified accordingly.


mysql-test/t/func_gconcat.test:
  Added test case for bug#14169: type of group_concat() result changed to blob if tmp_table was used
mysql-test/r/func_gconcat.result:
  Added test case for bug#14169: type of group_concat() result changed to blob if tmp_table was used
sql/unireg.h:
  Added the CONVERT_IF_BIGGER_TO_BLOB constant
sql/sql_select.cc:
  Fixed bug#14169: type of group_concat() result changed to blob if tmp_table was used
  The unnamed constant 255 in the create_tmp_field() and create_tmp_field_from_item() functions now defined as the CONVERT_IF_BIGGER_TO_BLOB constant.
  The create_tmp_field() function now converts the Item_sum string result to a blob field based on its char length.
sql/item_sum.h:
  Fixed bug#14169: type of group_concat() result changed to blob if tmp_table was used
  To the Item_func_group_concat calls added the member function field_type() which returns the BLOB or VAR_STRING type based on the items length.
sql/item_func.cc:
  Fixed bug#14169: type of group_concat() result changed to blob if tmp_table was used
  In the Item_func::tmp_table_field() function the unnamed constant 255 is changed to the CONVERT_IF_BIGGER_TO_BLOB constant.
  The Item_func::tmp_table_field() function now measures the result length in chars rather than bytes when converting string result to a blob.
2006-04-12 23:05:38 +04:00
unknown
886a35bd82 Bug#16461: connection_id() does not work properly inside trigger
CONNECTION_ID() was implemented as a constant Item, i.e. an instance of
Item_static_int_func class holding value computed at creation time.
Since Items are created on parsing, and trigger statements are parsed
on table open, the first connection to open a particular table would
effectively set its own CONNECTION_ID() inside trigger statements for
that table.

Re-implement CONNECTION_ID() as a class derived from Item_int_func, and
compute connection_id on every call to fix_fields().


mysql-test/r/trigger.result:
  Add result for bug#16461.
mysql-test/t/trigger.test:
  Add test case for bug#16461.
sql/item.cc:
  Remove now unused class Item_static_int_func.
sql/item.h:
  Remove now unused class Item_static_int_func.
sql/item_create.cc:
  Use new implementation of CONNECTION_ID().
sql/item_func.cc:
  Re-implement CONNECTION_ID() as Item_func_connection_id
  (was Item_static_int_func).  Set max_length to 10, as it was before.
  Compute connection_id dynamically on every call to fix_fields().
sql/item_func.h:
  Re-implement CONNECTION_ID() as Item_func_connection_id
  (was Item_static_int_func).
2006-04-12 19:31:00 +04:00
unknown
9381c8a089 Fixed BUG#18787: Server crashed when calling a stored procedure containing
a misnamed function
  ... in the presence of a continue handler. The problem was that with a
  handler, it continued to execute as if function existed and had set a
  useful return value (which it hadn't).
  The fix is to set a null return value and do an error return when a function
  wasn't found.


mysql-test/r/sp.result:
  Updated results for a new test case (BUG#18787).
mysql-test/t/sp.test:
  New testcase for BUG#18787.
sql/item_func.cc:
  Don't set "out of resources" error in Item_func_sp::execute() if no
  result field is returned, it's simply wrong, it can be sometthing else,
  like a function not found. Instead set null_value and return error.
  Also, set "out of resources" when field creation fails in
  Item_func_sp::sp_result_field() and Item_func_sp::tmp_table_field().
2006-04-11 12:17:57 +02:00
unknown
974752bc1e Merge mysql.com:/usr/home/ram/work/mysql-4.0
into  mysql.com:/usr/home/ram/work/mysql-4.1


mysql-test/r/func_op.result:
  Auto merged
sql/item_func.cc:
  Auto merged
mysql-test/t/func_op.test:
  SCCS merged
2006-04-11 13:53:44 +05:00
unknown
8ac1d55286 Remove compiler warnings
Add missing DBUG_RETURN
Fixed stack overflow in NdbBlob (found by ndb_gis.test)
Fixed access to freed memory in ndb_cluster_real_free_share()


mysys/mf_keycache.c:
  Add missing DBUG_RETURN
sql/ha_ndbcluster.cc:
  Move free_root to after share handling, as otherwise we will free things needed by free_table_share()
sql/item_func.cc:
  Add missing DBUG_RETURN
sql/item_strfunc.cc:
  Add missing DBUG_RETURN
sql/sp_head.cc:
  Add missing DBUG_RETURN
sql/sql_base.cc:
  Add missing DBUG_RETURN
storage/csv/ha_tina.cc:
  Add missing DBUG_RETURN
storage/myisam/mi_key.c:
  Add missing DBUG_RETURN
storage/myisam/mi_keycache.c:
  Add missing DBUG_RETURN
storage/ndb/include/kernel/signaldata/ArbitSignalData.hpp:
  Remove compiler warning
storage/ndb/include/kernel/signaldata/DictTabInfo.hpp:
  Remove compiler warning
storage/ndb/include/transporter/TransporterDefinitions.hpp:
  Remove compiler warning
storage/ndb/include/util/SimpleProperties.hpp:
  Remove compiler warning
storage/ndb/include/util/SocketServer.hpp:
  Remove compiler warning
storage/ndb/src/ndbapi/ClusterMgr.hpp:
  Remove compiler warning
storage/ndb/src/ndbapi/NdbBlob.cpp:
  Fix stack overflow
storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp:
  Remove compiler warning
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
  Remove compiler warning
2006-03-29 17:04:00 +03:00
unknown
2711b9d5de Remove DBUG print that looks at args[0] even if arg_count is 0 2006-03-23 21:45:00 +01:00
unknown
ae7974b112 Bug#11835 CREATE FUNCTION crashes server
- Update for 5.1
 - Add "have_dlopen"
 - Remove requirement to load udf's only in "opt_plugin_dir" 


include/my_global.h:
  Remove duplicate defines
mysql-test/include/have_udf.inc:
  Use "have_dlopen" to check if we "have udf"
mysql-test/r/have_udf.require:
  Use "have_dlopen" to check if we "have udf"
mysql-test/r/udf.result:
  Update for new error message "function"->"symbol"
sql/item_func.cc:
  Remove "evil" dbug printour that checks args[0] even if arg_count is 0
sql/mysql_priv.h:
  Add "have_dlopen"
sql/mysqld.cc:
  Add "have_dlopen"
  Move HAVE_DLOPEN defined to only surround "udf_free" and "udf_init"
sql/set_var.cc:
  Add "have_dlopen"
sql/sql_plugin.cc:
  Surround 'dlclose' with HAVE_DLOPEN
sql/sql_udf.cc:
  Remove the requirement to load udf's only from "opt_plugin_dir".
  Fix spelling error
2006-03-21 10:54:26 +01:00
unknown
c7f8c632eb Merge neptunus.(none):/home/msvensson/mysql/mysql-5.1
into  neptunus.(none):/home/msvensson/mysql/bug11835/my51-bug11835


client/mysqltest.c:
  Auto merged
configure.in:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_udf.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
2006-03-20 21:41:27 +01:00
unknown
6219f23b94 Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/bug11835/my50-bug11835


client/mysqltest.c:
  Auto merged
configure.in:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_udf.cc:
  Auto merged
2006-03-20 21:35:05 +01:00
unknown
b1aacfac72 Merge neptunus.(none):/home/msvensson/mysql/bug11835/my50-bug11835
into  neptunus.(none):/home/msvensson/mysql/bug11835/my51-bug11835


client/mysqltest.c:
  Auto merged
configure.in:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/Makefile.am:
  Merge
sql/share/errmsg.txt:
  Merge
sql/sql_udf.cc:
  Merge
2006-03-20 20:16:53 +01:00
unknown
b9f6f9bc64 Fixes to the replication mixed mode (patch approved by Monty):
- detect the need for row-based binlogging not at execution stage but earlier at parsing stage; needed for example for CREATE TABLE SELECT UUID().
- more tests of this mixed mode.


mysql-test/r/rpl_switch_stm_row_mixed.result:
  result update
mysql-test/t/rpl_switch_stm_row_mixed.test:
  testing more scenarios for the mixed replication mode.
  Added support for manual testing of UDFs vs the mixed mode (behind a variable in the test).
  Changing old file names to better ones.
sql/item_create.cc:
  at parse time, when we see a UUID(), put up a flag in LEX to say this binlogs properly only with row-based binlogging.
sql/item_func.cc:
  it's not perfect to put up the flag at this execution stage, better do it at parse stage.
sql/item_strfunc.cc:
  it's not perfect to put up the flag at this execution stage, better do it at parse stage
sql/set_var.cc:
  this assertion is wrong, this piece of code can happen in RBR mode too.
sql/sql_lex.cc:
  when we reinitialize the LEX members before every query, we have to reinitialize the new flag
sql/sql_lex.h:
  A new flag, set at parsing stage, which tells if some items seen during parsing stage require row-based replication to binlog/replicate correctly
  when this statement is later executed.
  It has to be in LEX and not directly in THD, for this to work in prepared statements.
sql/sql_parse.cc:
  Parsing stage happened at some time in the past and set up the flag in LEX, now that we execute the statement we actually turn on row-based binlogging
  if the thread's binlog format is "mixed". We then turn it off when leaving mysql_execute_command().
  Some cleanup code was not executed if leaving mysql_execute_command() at the "error" label, fixing this. A better fix than the "goto end" would be
  to modify each "goto error" to "res=1; goto end" but it required changing many lines which I don't want to do now ("make smallest possible patch").
sql/sql_yacc.yy:
  When at parsing stage we see a UDF we put up a flag to say that row-based binlogging is preferred.
2006-03-13 15:34:30 +01:00
unknown
123bcd5e84 Merge mysql.com:/Users/kent/mysql/bk/mysql-5.0-tmp
into mysql.com:/Users/kent/mysql/bk/mysql-5.1-new


mysql-test/r/sp.result:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
sql/item_func.cc:
  Auto merged
2006-03-06 12:15:26 +01:00
unknown
6ea2c3cd57 Fix for bug #17615: invalid handling of function results in UPDATE...SET statement.
sql/item_func.cc:
  Fix for bug #17615: invalid handling of function results in UPDATE...SET statement.
  - set proper collation
2006-03-02 15:05:55 +04:00
unknown
7cac0ddfd0 WL#2977 and WL#2712 global and session-level variable to set the binlog format (row/statement),
and new binlog format called "mixed" (which is statement-based except if only row-based is correct,
in this cset it means if UDF or UUID is used; more cases could be added in later 5.1 release):
SET GLOBAL|SESSION BINLOG_FORMAT=row|statement|mixed|default;
the global default is statement unless cluster is enabled (then it's row) as in 5.1-alpha.
It's not possible to use SET on this variable if a session is currently in row-based mode and has open temporary tables (because CREATE
TEMPORARY TABLE was not binlogged so temp table is not known on slave),  or if NDB is enabled (because
NDB does not support such change on-the-fly, though it will later), of if in a stored function (see below).
The added tests test the possibility or impossibility to SET, their effects, and the mixed mode,
including in prepared statements and in stored procedures and functions.
Caveats:
a) The mixed mode will not work for stored functions: in mixed mode, a stored function will
always be binlogged as one call and in a statement-based way (e.g. INSERT VALUES(myfunc()) or SELECT myfunc()).
b) for the same reason, changing the thread's binlog format inside a stored function is
refused with an error message.
c) the same problems apply to triggers; implementing b) for triggers will be done later (will ask
Dmitri).
Additionally, as the binlog format is now changeable by each user for his session, I remove the implication
which was done at startup, where row-based automatically set log-bin-trust-routine-creators to 1
(not possible anymore as a user can now switch to stmt-based and do nasty things again), and automatically
set --innodb-locks-unsafe-for-binlog to 1 (was anyway theoretically incorrect as it disabled
phantom protection).
Plus fixes for compiler warnings.


mysql-test/r/rpl_row_4_bytes.result:
  update
mysql-test/t/rpl_row_4_bytes.test:
  don't influence next tests
sql/ha_archive.cc:
  please pay attention to this structure when you change it...
sql/ha_berkeley.cc:
  please pay attention to this structure when you change it...
sql/ha_blackhole.cc:
  please pay attention to this structure when you change it...
sql/ha_federated.cc:
  please pay attention to this structure when you change it...
sql/ha_heap.cc:
  please pay attention to this structure when you change it...
sql/ha_innodb.cc:
  please pay attention to this structure when you change it...
sql/ha_myisam.cc:
  please pay attention to this structure when you change it...
sql/ha_myisammrg.cc:
  please pay attention to this structure when you change it...
sql/ha_ndbcluster_binlog.cc:
  no more global 'binlog_row_based'
sql/ha_partition.cc:
  please pay attention to this structure when you change it...
sql/handler.cc:
  please pay attention to this structure when you change it...
sql/handler.h:
  it's good to initialize statically (to get no compiler warning) even if to a null value.
sql/item_func.cc:
  UDFs require row-based if this is the "mixed" binlog format.
sql/item_strfunc.cc:
  UUID() requires row-based binlogging if this is the "mixed" binlog format
sql/log.cc:
  binlog_row_based -> thd->current_stmt_binlog_row_based
sql/log.h:
  the enum enum_binlog_format moves to log.h from mysqld.cc as we need it in several places.
sql/log_event.cc:
  binlog_row_based -> thd->current_stmt_binlog_row_based
sql/log_event.h:
  this global variable not used anymore
sql/mysql_priv.h:
  these global variables not used anymore
sql/mysqld.cc:
  simplification in the handling of --binlog-format (but with no user-visible change), thanks to
  the new global system variable.
  RBR does not anymore turn on --log-bin-trust-function-creators and --innodb-locks-unsafe-for-binlog
  as these are global options and RBR is now settable per session.
sql/partition_info.cc:
  compiler warnings
sql/set_var.cc:
  new class of thread's variable, to handle the binlog_format (like sys_var_thd_enum except
  that is_readonly() is overriden for more checks before update).
  compiler warnings (ok'd by Serg)
sql/set_var.h:
  new class for the thread's binlog_format (see set_var.cc)
sql/share/errmsg.txt:
  some messages for when one can't toggle from one binlog format to another
sql/sp_head.cc:
  binlog_row_based -> thd->current_stmt_binlog_row_based
sql/sql_base.cc:
  binlog_row_based -> thd->current_stmt_binlog_row_based
sql/sql_class.cc:
  When a THD is initialized, we set its current_stmt_binlog_row_based
sql/sql_class.h:
  new THD::variables.binlog_format (the value of the session variable set by SET
  or inherited from the global value), and THD::current_stmt_binlog_row_based which tells if the
  current statement does row-based or statement-based binlogging. Both members are needed
  as the 2nd one cannot be derived only from the first one (the statement's type plays a role too),
  and the 1st one is needed to reset the 2nd one.
sql/sql_delete.cc:
  binlog_row_based -> thd->current_stmt_binlog_row_based
sql/sql_insert.cc:
  binlog_row_based -> thd->current_stmt_binlog_row_based
sql/sql_load.cc:
  binlog_row_based -> thd->current_stmt_binlog_row_based.
sql/sql_parse.cc:
  when we are done with a statement, we reset the current_stmt_binlog_row_based to the value
  derived from THD::variables.binlog_format.
sql/sql_partition.cc:
  compiler warning
sql/sql_show.cc:
  compiler warning
sql/sql_table.cc:
  binlog_row_based -> thd->current_stmt_binlog_row_based
tests/mysql_client_test.c:
  compiler warning
mysql-test/r/ndb_binlog_basic2.result:
  new result
mysql-test/r/rpl_switch_stm_row_mixed.result:
  new result
mysql-test/t/ndb_binlog_basic2.test:
  new test to verify that if cluster is enabled, can't change binlog format on the fly.
mysql-test/t/rpl_switch_stm_row_mixed.test:
  test to see if one can switch between SBR, RBR, and "mixed" mode, and when one cannot,
  and test to see if the switching, and the mixed mode, work properly (using UUID() to test,
  as using UDFs is not possible in the testsuite for portability reasons).
2006-02-25 22:21:03 +01:00
unknown
79258e4480 Bug#17261 Passing a variable from a stored procedure to UDF crashes mysqld
- Pass "buffers[i]" to val_str() in udf_handler::fix_fields insteead of NULL.
 - Add testcase for UDF that will load and run the udf_example functions 
   if available


sql/item_func.cc:
  Instead of passing a NULL pointer into val_str, use the "buffers" array to provide a temp string buffer.
sql/udf_example.cc:
  Spelling error"on"->"one"
mysql-test/include/have_udf.inc:
  New BitKeeper file ``mysql-test/include/have_udf.inc''
mysql-test/r/have_udf.require:
  New BitKeeper file ``mysql-test/r/have_udf.require''
mysql-test/r/udf.result:
  New BitKeeper file ``mysql-test/r/udf.result''
mysql-test/t/udf.test:
  New BitKeeper file ``mysql-test/t/udf.test''
2006-02-15 17:11:24 +01:00
unknown
d7becbc2c8 Merge mysql.com:/home/kostja/mysql/mysql-5.0-root
into  mysql.com:/home/kostja/mysql/mysql-5.1-merge


BitKeeper/deleted/.del-ndb_load.result:
  Delete: mysql-test/r/ndb_load.result
BitKeeper/deleted/.del-ndb_load.test:
  Delete: mysql-test/t/ndb_load.test
extra/perror.c:
  Auto merged
mysql-test/r/fulltext.result:
  Auto merged
mysql-test/r/ndb_blob.result:
  Auto merged
mysql-test/r/sp-code.result:
  Auto merged
mysql-test/r/sp.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/fulltext.test:
  Auto merged
mysql-test/t/sp-destruct.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_ndbcluster.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sp.h:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.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_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
storage/ndb/src/kernel/blocks/dbacc/Dbacc.hpp:
  Auto merged
storage/ndb/src/kernel/main.cpp:
  Auto merged
storage/ndb/src/kernel/vm/Configuration.cpp:
  Auto merged
storage/ndb/src/kernel/vm/Configuration.hpp:
  Auto merged
storage/ndb/src/ndbapi/NdbBlob.cpp:
  Auto merged
storage/ndb/test/ndbapi/testBlobs.cpp:
  Auto merged
storage/ndb/tools/delete_all.cpp:
  Auto merged
mysql-test/t/disabled.def:
  Manual merge.
2006-02-09 13:35:59 +03:00
unknown
c9bb7e1f02 item_func.cc:
fix for bug#8461

  BUG 8461 - TRUNCATE returns incorrect result if 2nd argument is negative
  Reason: Both TRUNCATE/ROUND converts INTEGERS to DOUBLE and back to INTEGERS
  Changed the integer routine to work on integers only.
  This bug affects 4.1, 5.0 and 5.1
  Fixing in 4.1 will need to change the routine to handle different types individually.
  5.0 did had different routines for different types already just the INTEGER routine was bad.


sql/item_func.cc:
  fix for bug#8461
  BUG 8461 - TRUNCATE returns incorrect result if 2nd argument is negative
  Reason: TRUNCATE converts INTEGERS to DOUBLE and back to INTEGERS
  Both ROUND and TRUNCATE are affected by this.
  Changed the integer routine to work on integers only.
  This bug affects 4.1 5,0 and 5
  Fixing in 4.1 will need to change the routine to handle different types individually.
2006-02-07 13:26:35 +01:00
unknown
d297a221fe Merge mysql.com:/home/kostja/mysql/tmp_merge
into  mysql.com:/home/kostja/mysql/mysql-5.1-merge


BitKeeper/etc/ignore:
  auto-union
configure.in:
  Auto merged
libmysql/libmysql.c:
  Auto merged
mysql-test/ndb/ndbcluster.sh:
  Auto merged
mysql-test/r/rpl_sp.result:
  Auto merged
mysql-test/r/sp-error.result:
  Auto merged
mysql-test/r/sp.result:
  Auto merged
mysql-test/r/type_float.result:
  Auto merged
mysql-test/t/rpl_sp.test:
  Auto merged
mysql-test/t/sp-error.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/protocol.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
storage/myisam/ft_update.c:
  Auto merged
storage/ndb/include/logger/LogHandler.hpp:
  Auto merged
storage/ndb/include/logger/Logger.hpp:
  Auto merged
storage/ndb/include/mgmapi/mgmapi.h:
  Auto merged
storage/ndb/include/mgmcommon/ConfigRetriever.hpp:
  Auto merged
storage/ndb/src/common/logger/FileLogHandler.cpp:
  Auto merged
storage/ndb/src/common/logger/LogHandler.cpp:
  Auto merged
storage/ndb/src/common/logger/Logger.cpp:
  Auto merged
storage/ndb/src/common/logger/SysLogHandler.cpp:
  Auto merged
storage/ndb/src/common/mgmcommon/ConfigRetriever.cpp:
  Auto merged
storage/ndb/src/common/util/SocketServer.cpp:
  Auto merged
storage/ndb/src/kernel/main.cpp:
  Auto merged
storage/ndb/src/kernel/vm/Configuration.cpp:
  Auto merged
storage/ndb/src/kernel/vm/Configuration.hpp:
  Auto merged
storage/ndb/src/mgmapi/mgmapi.cpp:
  Auto merged
storage/ndb/src/mgmclient/CommandInterpreter.cpp:
  Auto merged
storage/ndb/src/mgmsrv/MgmtSrvr.cpp:
  Auto merged
storage/ndb/src/mgmsrv/MgmtSrvr.hpp:
  Auto merged
storage/ndb/src/mgmsrv/Services.cpp:
  Auto merged
storage/ndb/src/mgmsrv/Services.hpp:
  Auto merged
storage/ndb/src/mgmsrv/main.cpp:
  Auto merged
storage/ndb/tools/ndb_size.pl:
  Auto merged
zlib/Makefile.am:
  Auto merged
mysql-test/r/information_schema.result:
  SCCS merged
mysql-test/t/information_schema.test:
  Manual merge.
sql/ha_archive.cc:
  Manual merge.
sql/share/errmsg.txt:
  SCCS merged
tests/mysql_client_test.c:
  Manual merge.
2006-02-02 23:27:06 +03:00
unknown
494bccf044 Merging
mysql-test/ndb/ndbcluster.sh:
  Auto merged
mysql-test/r/func_gconcat.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/t/func_math.test:
  Auto merged
mysql-test/t/type_float.test:
  Auto merged
sql/spatial.h:
  Auto merged
mysql-test/r/type_float.result:
  merging
sql/item_func.cc:
  merging
2006-01-21 18:50:06 +04:00
unknown
32fc680089 Merge hf@192.168.21.12:work/mysql-4.1.9855
into eagle.intranet.mysql.r18.ru:/home/hf/work/mysql-4.1.mrg


sql/item_func.cc:
  Auto merged
2006-01-21 17:53:29 +04:00
unknown
c489cdebea merged
myisam/mi_delete.c:
  Auto merged
sql/field.cc:
  Auto merged
sql/field.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
2006-01-03 18:12:03 +01:00
unknown
307c0b77a1 many warnings (practically safe but annoying) corrected
client/mysqladmin.cc:
  don't use the handler after it's closed
client/mysqlbinlog.cc:
  memory leak
client/mysqldump.c:
  many "ignore return value" warnings, one "NULL dereference"
cmd-line-utils/libedit/history.c:
  memory leak
include/my_base.h:
  cleanup
libmysql/libmysql.c:
  "return value ignored" warning
myisam/mi_delete.c:
  "return value ignored" warning
myisam/myisampack.c:
  "out-of-bound access" warning
myisam/sort.c:
  "double free" warning
mysys/default_modify.c:
  "double free" warning
mysys/mf_iocache2.c:
  "return value ignored" warnings
mysys/my_bitmap.c:
  s/return/DBUG_RETURN/
mysys/my_error.c:
  memory leak
server-tools/instance-manager/parse.cc:
  "NULL dereference" warning
sql-common/client.c:
  "NULL dereference" warning
sql/field.cc:
  deadcode, "NULL dereference", "uninitialized" warnings
sql/field.h:
  unused parameters removed from constructor
sql/ha_myisam.cc:
  "return value ignored" warnings
sql/item.cc:
  "return value ignored" warnings
  changed constructor
sql/item_func.cc:
  "return value ignored" warnings
sql/log_event.cc:
  uninitialized warning
sql/opt_range.cc:
  "double free" and uninitialized warnings
sql/opt_range.h:
  "return value ignored" warning
sql/repl_failsafe.cc:
  "return value ignored" warning
sql/set_var.cc:
  "return value ignored" warning
sql/slave.cc:
  "return value ignored" warnings
sql/slave.h:
  new prototype
sql/sql_acl.cc:
  deadcode and "NULL dereference" warnings
sql/sql_db.cc:
  "return value ignored" warning
sql/sql_handler.cc:
  "NULL dereference" warning
sql/sql_help.cc:
  "NULL dereference" warning
sql/sql_insert.cc:
  "return value ignored" warning
sql/sql_parse.cc:
  "return value ignored" warning
  one more DBUG_ASSERT
sql/sql_repl.cc:
  "return value ignored" and memory leak warnings
sql/sql_show.cc:
  "return value ignored" and "NULL dereference"  warnings
sql/sql_test.cc:
  "return value ignored" warning
sql/table.cc:
  memory leak
sql/uniques.cc:
  "return value ignored" warning
  endspaces deleted
2006-01-03 17:54:54 +01:00
unknown
6a53fec551 Merge mysql.com:/home/jimw/my/mysql-5.0-clean
into  mysql.com:/home/jimw/my/mysql-5.1-clean


mysql-test/r/sp.result:
  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.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_db.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_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/sql_base.cc:
  Resolve conflict
2005-12-12 11:57:07 -08:00
unknown
53f8fed437 Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-2


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.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_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2005-12-10 23:31:03 -08:00
unknown
16bca98267 Merge mysql.com:/home/alik/MySQL/devel/5.0-wl2984
into  mysql.com:/home/alik/MySQL/devel/5.1-wl2984-merge


mysql-test/r/show_check.result:
  Auto merged
mysql-test/r/sp.result:
  Auto merged
BitKeeper/deleted/.del-type_newdecimal-big.result:
  Auto merged
BitKeeper/deleted/.del-type_newdecimal-big.test:
  Auto merged
mysql-test/t/show_check.test:
  Auto merged
sql/field.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.h:
  Auto merged
sql/sql_trigger.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/field.cc:
  Merge.
sql/sp_head.cc:
  Merge.
sql/sql_select.cc:
  Merge.
2005-12-09 15:14:19 +03:00
unknown
6b2f13098a Patch for WL#2894: Make stored routine variables work
according to the standard.

The idea is to use Field-classes to implement stored routines
variables. Also, we should provide facade to Item-hierarchy
by Item_field class (it is necessary, since SRVs take part
in expressions).

The patch fixes the following bugs:
  - BUG#8702: Stored Procedures: No Error/Warning shown for inappropriate data 
    type matching; 
 
  - BUG#8768: Functions: For any unsigned data type, -ve values can be passed 
    and returned; 
 
  - BUG#8769: Functions: For Int datatypes, out of range values can be passed 
    and returned; 
 
  - BUG#9078: STORED PROCDURE: Decimal digits are not displayed when we use 
    DECIMAL datatype; 
 
  - BUG#9572: Stored procedures: variable type declarations ignored; 
 
  - BUG#12903: upper function does not work inside a function; 
 
  - BUG#13705: parameters to stored procedures are not verified; 
 
  - BUG#13808: ENUM type stored procedure parameter accepts non-enumerated
    data; 
 
  - BUG#13909: Varchar Stored Procedure Parameter always BINARY string (ignores 
    CHARACTER SET); 
 
  - BUG#14161: Stored procedure cannot retrieve bigint unsigned;

  - BUG#14188: BINARY variables have no 0x00 padding;

  - BUG#15148: Stored procedure variables accept non-scalar values;


mysql-test/r/ctype_ujis.result:
  Explicitly specify correct charset.
mysql-test/r/schema.result:
  Drop our test database to not affect this test if some test
  left it cause of failure.
mysql-test/r/show_check.result:
  Drop our test database to not affect this test if some test
  left it cause of failure.
mysql-test/r/skip_name_resolve.result:
  Ignore columns with unpredictable values.
mysql-test/r/sp-big.result:
  Add cleanup statement.
mysql-test/r/sp-dynamic.result:
  Add cleanup statements.
mysql-test/r/sp.result:
  Update result file.
mysql-test/r/sum_distinct-big.result:
  Update result file.
mysql-test/r/type_newdecimal-big.result:
  Update result file.
mysql-test/t/ctype_ujis.test:
  Explicitly specify correct charset.
mysql-test/t/schema.test:
  Drop our test database to not affect this test if some test
  left it cause of failure.
mysql-test/t/show_check.test:
  Drop our test database to not affect this test if some test
  left it cause of failure.
mysql-test/t/skip_name_resolve.test:
  Ignore columns with unpredictable values.
mysql-test/t/sp-big.test:
  Add cleanup statement.
mysql-test/t/sp-dynamic.test:
  Add cleanup statements.
mysql-test/t/sp.test:
  Non-scalar values prohibited for assignment to SP-vars;
  polishing.
mysql-test/t/type_newdecimal-big.test:
  Update type specification so that the variables
  can contain the large values used in the test.
sql/field.cc:
  Extract create_field::init() to initialize an existing
  instance of create_field from new_create_field().
sql/field.h:
  Extract create_field::init() to initialize an existing
  instance of create_field from new_create_field().
sql/item.cc:
  - Introduce a new class: Item_sp_variable -- a base class
    of stored-routine-variables classes;
  - Introduce Item_case_expr -- an Item, which is used to access
    to the expression of CASE statement;
sql/item.h:
  - Introduce a new class: Item_sp_variable -- a base class
    of stored-routine-variables classes;
  - Introduce Item_case_expr -- an Item, which is used to access
    to the expression of CASE statement;
sql/item_func.cc:
  Pass the Field (instead of Item) for the return value of
  a function to the function execution routine.
sql/item_func.h:
  Pass the Field (instead of Item) for the return value of
  a function to the function execution routine.
sql/mysql_priv.h:
  Move create_virtual_tmp_table() out of sql_select.h.
sql/sp.cc:
  Use create_result_field() instead of make_field().
sql/sp_head.cc:
  - Add a function to map enum_field_types to Item::Type;
  - Add sp_instr_push_case_expr instruction -- an instruction
    to push CASE expression into the active running context;
  - Add sp_instr_pop_case_expr instruction -- an instruction
    to pop CASE expression from the active running context;
  - Adapt the SP-execution code to using Fields instead of Items
    for SP-vars;
  - Use create_field structure for field description instead of
    a set of members.
sql/sp_head.h:
  - Add a function to map enum_field_types to Item::Type;
  - Add sp_instr_push_case_expr instruction -- an instruction
    to push CASE expression into the active running context;
  - Add sp_instr_pop_case_expr instruction -- an instruction
    to pop CASE expression from the active running context;
  - Adapt the SP-execution code to using Fields instead of Items
    for SP-vars;
  - Use create_field structure for field description instead of
    a set of members.
sql/sp_pcontext.cc:
  - Change rules to assign an index of SP-variable: use
    transparent index;
  - Add an operation to retrieve a list of defined SP-vars
    from the processing context recursively.
sql/sp_pcontext.h:
  - Change rules to assign an index of SP-variable: use
    transparent index;
  - Add an operation to retrieve a list of defined SP-vars
    from the processing context recursively.
sql/sp_rcontext.cc:
  - Change rules to assign an index of SP-variable: use
    transparent index;
  - Use a tmp virtual table to store SP-vars instead of Items;
  - Provide operations to work with CASE expresion.
sql/sp_rcontext.h:
  - Change rules to assign an index of SP-variable: use
    transparent index;
  - Use a tmp virtual table to store SP-vars instead of Items;
  - Provide operations to work with CASE expresion.
sql/sql_class.cc:
  - Reflect Item_splocal ctor changes;
  - Item_splocal::get_offset() has been renamed to get_var_idx().
sql/sql_class.h:
  Polishing.
sql/sql_parse.cc:
  Extract create_field::init() to initialize an existing
  instance of create_field from new_create_field().
sql/sql_select.cc:
  Take care of BLOB columns in create_virtual_tmp_table().
sql/sql_select.h:
  Move create_virtual_tmp_table() out of sql_select.h.
sql/sql_trigger.cc:
  Use boolean constants for boolean type instead of numerical ones.
sql/sql_yacc.yy:
  Provide an instance of create_field for each SP-var.
mysql-test/include/sp-vars.inc:
  The definitions of common-procedures, which are created
  under different circumstances.
mysql-test/r/sp-vars.result:
  Result file for the SP-vars test.
mysql-test/sp-vars.test:
  A new test for checking SP-vars functionality.
2005-12-07 17:01:17 +03:00
unknown
e324da302f Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-2


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.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_sum.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2005-12-02 20:42:36 -08:00
unknown
176f36fa55 Merge mysql.com:/usr/local/bk/mysql-5.0
into  mysql.com:/usr/home/pem/mysql-5.1-new


mysql-test/r/sp.result:
  Auto merged
sql/field.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2005-12-02 18:43:08 +01:00
unknown
858eef452f Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/usr/home/ram/work/5.0.b12956


mysql-test/r/ps.result:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
2005-12-02 11:57:26 +04:00
unknown
6cc4218f21 Fix for bug #12956: cast make differ rounding.
sql/item_func.cc:
  Fix for bug #12956: cast make differ rounding.
  - call rint() as we do in the Field_*int*::store(double)
2005-11-28 14:52:38 +04:00
unknown
039168c2fa Merge mysql.com:/home/my/mysql-5.1
into  mysql.com:/home/my/mysql-5.1-TDC


mysql-test/r/variables.result:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
sql/ha_berkeley.cc:
  Auto merged
sql/ha_federated.cc:
  Auto merged
sql/ha_federated.h:
  Auto merged
sql/ha_innodb.cc:
  Auto merged
sql/ha_myisammrg.cc:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/key.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/parse_file.cc:
  Auto merged
sql/set_var.cc:
  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_acl.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_load.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_trigger.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/structs.h:
  Auto merged
sql/field.cc:
  Merge with global tree
sql/sql_base.cc:
  Merge with global tree
sql/table.cc:
  Merge with global tree
2005-11-23 22:58:53 +02:00
unknown
f631b361b6 Table definition cache, part 2
The table opening process now works the following way:
- Create common TABLE_SHARE object
- Read the .frm file and unpack it into the TABLE_SHARE object
- Create a TABLE object based on the information in the TABLE_SHARE
  object and open a handler to the table object

Other noteworthy changes:
- In TABLE_SHARE the most common strings are now LEX_STRING's
- Better error message when table is not found
- Variable table_cache is now renamed 'table_open_cache'
- New variable 'table_definition_cache' that is the number of table defintions that will be cached
- strxnmov() calls are now fixed to avoid overflows
- strxnmov() will now always add one end \0 to result
- engine objects are now created with a TABLE_SHARE object instead of a TABLE object.
- After creating a field object one must call field->init(table) before using it

- For a busy system this change will give you:
 - Less memory usage for table object
 - Faster opening of tables (if it's has been in use or is in table definition cache)
 - Allow you to cache many table definitions objects
 - Faster drop of table


mysql-test/mysql-test-run.sh:
  Fixed some problems with --gdb option
  Test both with socket and tcp/ip port that all old servers are killed
mysql-test/r/flush_table.result:
  More tests with lock table with 2 threads + flush table
mysql-test/r/information_schema.result:
  Removed old (now wrong) result
mysql-test/r/innodb.result:
  Better error messages (thanks to TDC patch)
mysql-test/r/merge.result:
  Extra flush table test
mysql-test/r/ndb_bitfield.result:
  Better error messages (thanks to TDC patch)
mysql-test/r/ndb_partition_error.result:
  Better error messages (thanks to TDC patch)
mysql-test/r/query_cache.result:
  Remove tables left from old tests
mysql-test/r/temp_table.result:
  Test truncate with temporary tables
mysql-test/r/variables.result:
  Table_cache -> Table_open_cache
mysql-test/t/flush_table.test:
  More tests with lock table with 2 threads + flush table
mysql-test/t/merge.test:
  Extra flush table test
mysql-test/t/multi_update.test:
  Added 'sleep' to make test predictable
mysql-test/t/query_cache.test:
  Remove tables left from old tests
mysql-test/t/temp_table.test:
  Test truncate with temporary tables
mysql-test/t/variables.test:
  Table_cache -> Table_open_cache
mysql-test/valgrind.supp:
  Remove warning that may happens becasue threads dies in different order
mysys/hash.c:
  Fixed wrong DBUG_PRINT
mysys/mf_dirname.c:
  More DBUG
mysys/mf_pack.c:
  Better comment
mysys/mf_tempdir.c:
  More DBUG
  Ensure that we call cleanup_dirname() on all temporary directory paths.
  
  If we don't do this, we will get a failure when comparing temporary table
  names as in some cases the temporary table name is run through convert_dirname())
mysys/my_alloc.c:
  Indentation fix
sql/examples/ha_example.cc:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/examples/ha_example.h:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/examples/ha_tina.cc:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/examples/ha_tina.h:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/field.cc:
  Update for table definition cache:
  - Field creation now takes TABLE_SHARE instead of TABLE as argument
    (This is becasue field definitions are now cached in TABLE_SHARE)
    When a field is created, one now must call field->init(TABLE) before using it
  - Use s->db instead of s->table_cache_key
  - Added Field::clone() to create a field in TABLE from a field in TABLE_SHARE
  - make_field() takes TABLE_SHARE as argument instead of TABLE
  - move_field() -> move_field_offset()
sql/field.h:
  Update for table definition cache:
  - Field creation now takes TABLE_SHARE instead of TABLE as argument
    (This is becasue field definitions are now cached in TABLE_SHARE)
    When a field is created, one now must call field->init(TABLE) before using it
  - Added Field::clone() to create a field in TABLE from a field in TABLE_SHARE
  - make_field() takes TABLE_SHARE as argument instead of TABLE
  - move_field() -> move_field_offset()
sql/ha_archive.cc:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_archive.h:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_berkeley.cc:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
  Changed name of argument create() to not hide internal 'table' variable.
  table->s  -> table_share
sql/ha_berkeley.h:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_blackhole.cc:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_blackhole.h:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_federated.cc:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
  Fixed comments
  Remove index variable and replace with pointers (simple optimization)
  move_field() -> move_field_offset()
  Removed some strlen() calls
sql/ha_federated.h:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_heap.cc:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
  Simplify delete_table() and create() as the given file names are now without extension
sql/ha_heap.h:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_innodb.cc:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_innodb.h:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_myisam.cc:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
  Remove not needed fn_format()
  Fixed for new table->s structure
sql/ha_myisam.h:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_myisammrg.cc:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
  Don't set 'is_view' for MERGE tables
  Use new interface to find_temporary_table()
sql/ha_myisammrg.h:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
  Added flag HA_NO_COPY_ON_ALTER
sql/ha_ndbcluster.cc:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
  Fixed wrong calls to strxnmov()
  Give error HA_ERR_TABLE_DEF_CHANGED if table definition has changed
  drop_table -> intern_drop_table()
  table->s -> table_share
  Move part_info to TABLE
  Fixed comments & DBUG print's
  New arguments to print_error()
sql/ha_ndbcluster.h:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
sql/ha_partition.cc:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
  We can't set up or use part_info when creating handler as there is not yet any table object
  New ha_intialise() to work with TDC (Done by Mikael)
sql/ha_partition.h:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
  Got set_part_info() from Mikael
sql/handler.cc:
  We new use TABLE_SHARE instead of TABLE when creating engine handlers
  ha_delete_table() now also takes database as an argument
  handler::ha_open() now takes TABLE as argument
  ha_open() now calls ha_allocate_read_write_set()
  Simplify ha_allocate_read_write_set()
  Remove ha_deallocate_read_write_set()
  Use table_share (Cached by table definition cache)
sql/handler.h:
  New table flag: HA_NO_COPY_ON_ALTER (used by merge tables)
  Remove ha_deallocate_read_write_set()
  get_new_handler() now takes TABLE_SHARE as argument
  ha_delete_table() now gets database as argument
sql/item.cc:
  table_name and db are now LEX_STRING objects
  When creating fields, we have now have to call field->init(table)
  move_field -> move_field_offset()
sql/item.h:
  tmp_table_field_from_field_type() now takes an extra paramenter 'fixed_length' to allow one to force usage of CHAR
   instead of BLOB
sql/item_cmpfunc.cc:
  Fixed call to tmp_table_field_from_field_type()
sql/item_create.cc:
  Assert if new not handled cast type
sql/item_func.cc:
  When creating fields, we have now have to call field->init(table)
  dummy_table used by 'sp' now needs a TABLE_SHARE object
sql/item_subselect.cc:
  Trivial code cleanups
sql/item_sum.cc:
  When creating fields, we have now have to call field->init(table)
sql/item_timefunc.cc:
  Item_func_str_to_date::tmp_table_field() now replaced by call to
   tmp_table_field_from_field_type() (see item_timefunc.h)
sql/item_timefunc.h:
  Simply tmp_table_field()
sql/item_uniq.cc:
  When creating fields, we have now have to call field->init(table)
sql/key.cc:
  Added 'KEY' argument to 'find_ref_key' to simplify code
sql/lock.cc:
  More debugging
  Use create_table_def_key() to create key for table cache
  Allocate TABLE_SHARE properly when creating name lock
  Fix that locked_table_name doesn't test same table twice
sql/mysql_priv.h:
  New functions for table definition cache
  New interfaces to a lot of functions.
  New faster interface to find_temporary_table() and close_temporary_table()
sql/mysqld.cc:
  Added support for table definition cache of size 'table_def_size'
  Fixed som calls to strnmov()
  Changed name of 'table_cache' to 'table_open_cache'
sql/opt_range.cc:
  Use new interfaces
  Fixed warnings from valgrind
sql/parse_file.cc:
  Safer calls to strxnmov()
  Fixed typo
sql/set_var.cc:
  Added variable 'table_definition_cache'
  Variable table_cache renamed to 'table_open_cache'
sql/slave.cc:
  Use new interface
sql/sp.cc:
  Proper use of TABLE_SHARE
sql/sp_head.cc:
  Remove compiler warnings
  We have now to call field->init(table)
sql/sp_head.h:
  Pointers to parsed strings are now const
sql/sql_acl.cc:
  table_name is now a LEX_STRING
sql/sql_base.cc:
  Main implementation of table definition cache
  (The #ifdef's are there for the future when table definition cache will replace open table cache)
  Now table definitions are cached indepndent of open tables, which will speed up things when a table is in use at once from several places
  Views are not yet cached; For the moment we only cache if a table is a view or not.
  
  Faster implementation of find_temorary_table()
  Replace 'wait_for_refresh()' with the more general function 'wait_for_condition()'
  Drop table is slightly faster as we can use the table definition cache to know the type of the table
sql/sql_cache.cc:
  table_cache_key and table_name are now LEX_STRING
  'sDBUG print fixes
sql/sql_class.cc:
  table_cache_key is now a LEX_STRING
  safer strxnmov()
sql/sql_class.h:
  Added number of open table shares (table definitions)
sql/sql_db.cc:
  safer strxnmov()
sql/sql_delete.cc:
  Use new interface to find_temporary_table()
sql/sql_derived.cc:
  table_name is now a LEX_STRING
sql/sql_handler.cc:
  TABLE_SHARE->db and TABLE_SHARE->table_name are now LEX_STRING's
sql/sql_insert.cc:
  TABLE_SHARE->db and TABLE_SHARE->table_name are now LEX_STRING's
sql/sql_lex.cc:
  Make parsed string a const (to quickly find out if anything is trying to change the query string)
sql/sql_lex.h:
  Make parsed string a const (to quickly find out if anything is trying to change the query string)
sql/sql_load.cc:
  Safer strxnmov()
sql/sql_parse.cc:
  Better error if wrong DB name
sql/sql_partition.cc:
  part_info moved to TABLE from TABLE_SHARE
  Indentation changes
sql/sql_select.cc:
  Indentation fixes
  Call field->init(TABLE) for new created fields
  Update create_tmp_table() to use TABLE_SHARE properly
sql/sql_select.h:
  Call field->init(TABLE) for new created fields
sql/sql_show.cc:
  table_name is now a LEX_STRING
  part_info moved to TABLE
sql/sql_table.cc:
  Use table definition cache to speed up delete of tables
  Fixed calls to functions with new interfaces
  Don't use 'share_not_to_be_used'
  Instead of doing openfrm() when doing repair, we now have to call
  get_table_share() followed by open_table_from_share().
  Replace some fn_format() with faster unpack_filename().
  Safer strxnmov()
  part_info is now in TABLE
  Added Mikaels patch for partition and ALTER TABLE
  Instead of using 'TABLE_SHARE->is_view' use 'table_flags() & HA_NO_COPY_ON_ALTER
sql/sql_test.cc:
  table_name and table_cache_key are now LEX_STRING's
sql/sql_trigger.cc:
  TABLE_SHARE->db and TABLE_SHARE->table_name are now LEX_STRING's
  safer strxnmov()
  Removed compiler warnings
sql/sql_update.cc:
  Call field->init(TABLE) after field is created
sql/sql_view.cc:
  safer strxnmov()
  Create common TABLE_SHARE object for views to allow us to cache if table is a view
sql/structs.h:
  Added SHOW_TABLE_DEFINITIONS
sql/table.cc:
  Creation and destruct of TABLE_SHARE objects that are common for many TABLE objects
  
  The table opening process now works the following way:
  - Create common TABLE_SHARE object
  - Read the .frm file and unpack it into the TABLE_SHARE object
  - Create a TABLE object based on the information in the TABLE_SHARE
    object and open a handler to the table object
  
  open_table_def() is written in such a way that it should be trival to add parsing of the .frm files in new formats
sql/table.h:
  TABLE objects for the same database table now share a common TABLE_SHARE object
  In TABLE_SHARE the most common strings are now LEX_STRING's
sql/unireg.cc:
  Changed arguments to rea_create_table() to have same order as other functions
  Call field->init(table) for new created fields
sql/unireg.h:
  Added OPEN_VIEW
strings/strxnmov.c:
  Change strxnmov() to always add end \0
  This makes usage of strxnmov() safer as most of MySQL code assumes that strxnmov() will create a null terminated string
2005-11-23 22:45:02 +02:00
unknown
c3c232a88c Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-2


mysql-test/r/func_gconcat.result:
  Auto merged
mysql-test/t/func_gconcat.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.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/sql_base.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_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2005-11-22 23:00:57 -08:00
unknown
aa06123f83 Merge sanja.is.com.ua:/home/bell/mysql/bk/work-bug7-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-merge-5.0


mysql-test/r/sp-error.result:
  Auto merged
mysql-test/r/trigger.result:
  Auto merged
mysql-test/t/sp-error.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
mysql-test/t/trigger.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
mysql-test/r/sp.result:
  merge
sql/share/errmsg.txt:
  merge
2005-11-23 01:28:32 +02:00
unknown
164ce4c5cd Recursion support made for SP (BUG#10100).
client/mysqltest.c:
  An expected error messages hiding from the log if disable_result_log is in force.
mysql-test/r/sp-dynamic.result:
  The test expanded for case of allowed/disalowed recursion.
mysql-test/r/sp-error.result:
  Error messages changed.
  Test of bug11394() made with allowed recursion.
mysql-test/r/sp.result:
  Tests for recursion.
mysql-test/r/trigger.result:
  Check that triggers are not affected by this patch.
mysql-test/r/variables.result:
  Test of max_sp_recursion_depth variable.
mysql-test/t/sp-dynamic.test:
  The test expanded for case of allowed/disalowed recursion.
mysql-test/t/sp-error.test:
  Error messages changed.
  Test of bug11394() made with allowed recursion.
mysql-test/t/sp.test:
  Tests for recursion.
mysql-test/t/trigger.test:
  Check that triggers are not affected by this patch.
mysql-test/t/variables.test:
  Test of max_sp_recursion_depth variable.
sql/item_func.cc:
  sp_find_function() and sp_find_procedure() joined to sp_find_routine()
    function as it was mentioned in TODO.
sql/mysqld.cc:
  max_sp_recursion_depth variable added.
sql/set_var.cc:
  max_sp_recursion_depth variable added.
sql/share/errmsg.txt:
  An error message changed.
  An error message added.
sql/sp.cc:
  sp_find_function() and sp_find_procedure() joined to sp_find_routine()
    function as it was mentioned in TODO.
  Temory LEX is allocated on a stack, not on a heap.
  Recursion support added for stored procedures.
sql/sp.h:
  sp_find_function() and sp_find_procedure() joined to sp_find_routine()
    function as it was mentioned in TODO.
sql/sp_head.cc:
  Initialization of new sp_head fields to get correct list of instances
    contained one instance only.
  Stack requirement for SP instruction is increased.
  Stack free space is checked before mem root initialisation to avoid
    memory leak.
  Pointer to the free instance management added before and after
    SP execution.
sql/sp_head.h:
  New sp_head variables added to support inst of instances of SP
    for recursion and pointer on ths first free to use instance.
sql/sql_base.cc:
  open_table() consume a lot of stack space so we check free stack space before it.
sql/sql_class.h:
  max_sp_recursion_depth variable added.
sql/sql_parse.cc:
  sp_find_function() and sp_find_procedure() joined to sp_find_routine()
    function as it was mentioned in TODO.
2005-11-23 01:11:19 +02:00
unknown
fe63e09581 Inefficient usage of String::append() fixed.
Bad examples of usage of a string with its length fixed.
The incorrect length in the trigger file configuration descriptor
  fixed (BUG#14090).
A hook for unknown keys added to the parser to support old .TRG files.


sql/field.cc:
  Inefficient usage of String::append() fixed.
  Bad examples of usage of a string with its length fixed.
sql/ha_berkeley.cc:
  A bad example of usage of a string with its length fixed.
sql/ha_federated.cc:
  Inefficient usage of String::append() fixed.
sql/ha_myisammrg.cc:
  Bad examples of usage of a string with its length fixed.
sql/handler.cc:
  Inefficient usage of String::append() fixed.
sql/item.cc:
  Bad examples of usage of a string with its length fixed.
sql/item.h:
  A bad example of usage of a string with its length fixed.
sql/item_cmpfunc.cc:
  Bad examples of usage of a string with its length fixed.
sql/item_func.cc:
  Bad examples of usage of a string with its length fixed.
sql/item_strfunc.cc:
  Bad examples of usage of a string with its length fixed.
sql/item_subselect.cc:
  Bad examples of usage of a string with its length fixed.
sql/item_sum.cc:
  Bad examples of usage of a string with its length fixed.
  Inefficient usage of String::append() fixed.
sql/item_timefunc.cc:
  Inefficient using of String::append() fixed.
  Bad examples of usage of a string with its length fixed.
sql/item_uniq.h:
  Bad examples of usage of a string with its length fixed.
sql/key.cc:
  Bad examples of usage of a string with its length fixed.
sql/log.cc:
  Bad examples of usage of a string with its length fixed.
sql/log_event.cc:
  Bad examples of usage of a string with its length fixed.
sql/mysqld.cc:
  The dummy parser hook allocated.
sql/opt_range.cc:
  Inefficient usage of String::append() fixed.
sql/parse_file.cc:
  Bad examples of usage of a string with its length fixed.
  A hook for unknown keys added to the parser.
sql/parse_file.h:
  A hook for unknown keys added to the parser.
sql/protocol.cc:
  A bad example of usage of a string with its length fixed.
sql/repl_failsafe.cc:
  Bad examples of usage of a string with its length fixed.
sql/share/errmsg.txt:
  A warning for old format config file.
sql/slave.cc:
  Bad examples of usage of a string with its length fixed.
sql/sp.cc:
  Bad examples of usage of a string with its length fixed.
sql/sp_head.cc:
  Bad examples of usage of a string with its length fixed.
sql/spatial.cc:
  A bad example of usage of a string with its length fixed.
sql/sql_acl.cc:
  Bad examples of usage of a string with its length fixed.
sql/sql_analyse.cc:
  Bad examples of usage of a string with its length fixed.
  Inefficient usage of String::append() fixed.
sql/sql_lex.cc:
  Bad examples of usage of a string with its length fixed.
sql/sql_load.cc:
  A bad example of usage of a string with its length fixed.
sql/sql_parse.cc:
  Bad examples of usage of a string with its length fixed.
sql/sql_prepare.cc:
  A bad example of usage of a string with its length fixed.
sql/sql_select.cc:
  Bad examples of usage of a string with its length fixed.
sql/sql_show.cc:
  Bad examples of usage of a string with its length fixed.
sql/sql_string.cc:
  Bad examples of usage of a string with its length fixed.
sql/sql_string.h:
  The macro definition moved to sql_string.h to
    be accessible in all parts of server.
sql/sql_table.cc:
  Bad examples of usage of a string with its length fixed.
sql/sql_trigger.cc:
  Bad examples of usage of a string with its length fixed.
  The incorrect length in the trigger file configuration descriptor
    fixed (BUG#14090).
  The hook for processing incorrect sql_mode record added.
sql/sql_view.cc:
  A dummy  hook used for parsing views.
sql/structs.h:
  The macro definition moved to sql_string.h to be
    accessible in all parts of server.
sql/table.cc:
  A bad example of usage of a string with its length fixed.
sql/tztime.cc:
  A bad example of usage of a string with its length fixed.
2005-11-20 20:47:07 +02:00
unknown
2c748c3ef9 Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-2


sql/item.cc:
  Auto merged
sql/item_func.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_yacc.yy:
  Auto merged
sql/mysql_priv.h:
  Manual merge
2005-11-13 17:56:20 -08:00
unknown
2ee2747bd2 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/alik/MySQL/devel/5.0-wl2818


mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/t/mysqldump.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_trigger.cc:
  Auto merged
mysql-test/r/rpl_sp.result:
  Manual merge.
2005-11-10 22:48:00 +03:00
unknown
7dbea7df27 WL#2818 (Add creator to the trigger definition for privilege
checks on trigger activation)


mysql-test/r/information_schema.result:
  Update result file: a new column DEFINER has been added to
  INFORMATION_SCHEMA.TRIGGERS.
mysql-test/r/mysqldump.result:
  Update result file: a new column DEFINER has been added to
  INFORMATION_SCHEMA.TRIGGERS.
mysql-test/r/rpl_ddl.result:
  Update result file: a new column DEFINER has been added to
  INFORMATION_SCHEMA.TRIGGERS.
mysql-test/r/rpl_sp.result:
  Update result file: a new clause DEFINER has been added to
  CREATE TRIGGER statement.
mysql-test/r/rpl_trigger.result:
  Results for new test cases were added.
mysql-test/r/skip_grants.result:
  Error message has been changed.
mysql-test/r/trigger.result:
  Added DEFINER column.
mysql-test/r/view.result:
  Error messages have been changed.
mysql-test/r/view_grant.result:
  Error messages have been changed.
mysql-test/t/mysqldump.test:
  Drop created procedure to not affect further tests.
mysql-test/t/rpl_trigger.test:
  Add tests for new column in information schema.
mysql-test/t/skip_grants.test:
  Error tag has been renamed.
mysql-test/t/view.test:
  Error tag has been renamed.
mysql-test/t/view_grant.test:
  Error tag has been changed.
sql/item_func.cc:
  Fix typo in comments.
sql/mysql_priv.h:
  A try to minimize copy&paste:
    - introduce operations to be used from sql_yacc.yy;
    - introduce an operation to be used from trigger and
      view processing code.
sql/share/errmsg.txt:
  - Rename ER_NO_VIEW_USER to ER_MALFORMED_DEFINER in order to
    be shared for view and trigger implementations;
  - Fix a typo;
  - Add a new error code for trigger warning.
sql/sp.cc:
  set_info() was split into set_info() and set_definer().
sql/sp_head.cc:
  set_info() was split into set_info() and set_definer().
sql/sp_head.h:
  set_info() was split into set_info() and set_definer().
sql/sql_acl.cc:
  Add a new check: exit from the cycle if the table is NULL.
sql/sql_lex.h:
  - Rename create_view_definer to definer, since it is used for views
    and triggers;
  - Change st_lex_user to LEX_USER, since st_lex_user is a structure.
    So, formally, it should be "struct st_lex_user", which is longer
    than just LEX_USER;
  - Add trigger_definition_begin.
sql/sql_parse.cc:
  - Add a new check: exit from the cycle if the table is NULL;
  - Implement definer-related functions.
sql/sql_show.cc:
  Add DEFINER column.
sql/sql_trigger.cc:
  Add DEFINER support for triggers.
sql/sql_trigger.h:
  Add DEFINER support for triggers.
sql/sql_view.cc:
  Rename create_view_definer to definer.
sql/sql_yacc.yy:
  Add support for DEFINER-clause in CREATE TRIGGER statement.
  
  Since CREATE TRIGGER and CREATE VIEW can be similar at the start,
  yacc is unable to distinguish between them. So, had to modify both
  statements in order to make it parsable by yacc.
mysql-test/r/trigger-compat.result:
  Result file for triggers backward compatibility test.
mysql-test/r/trigger-grant.result:
  Result file of the test for WL#2818.
mysql-test/t/trigger-compat.test:
  Triggers backward compatibility test: check that the server
  still can load triggers w/o definer attribute and modify
  tables with such triggers (add a new trigger, etc).
mysql-test/t/trigger-grant.test:
  Test for WL#2818 -- check that DEFINER support in triggers
  works properly
2005-11-10 22:25:03 +03:00
unknown
5d9c8e9543 WL#2971 "change log-bin-trust-routine-creators=0 to apply only to functions".
Indeed now that stored procedures CALL is not binlogged, but instead the invoked substatements are,
the restrictions applied by log-bin-trust-routine-creators=0 are superfluous for procedures.
They still need to apply to functions where function calls are written to the binlog (for example as "DO myfunc(3)").
We rename the variable to log-bin-trust-function-creators but allow the old name until some future version (and issue a warning if old name is used).


mysql-test/mysql-test-run.pl:
  update to new option name
mysql-test/mysql-test-run.sh:
  update to new option name
mysql-test/mysql_test_run_new.c:
  update to new option name
mysql-test/r/rpl_sp.result:
  result update
mysql-test/t/rpl_sp-slave.opt:
  we need to skip this error to not hit BUG#14769
mysql-test/t/rpl_sp.test:
  Test update:
  1) as log-bin-trust-routine-creators now affects only functions, the testing of this option, which was
  mainly done on procedures, is moved to functions
  2) cleanup is simplified; and instead of many SHOW BINLOG EVENTS we do a big one in the end, which is more
  maintainable.
  3) we test a few more function and procedures cases to see how they replicate.
  4) removing out-of-date comments
sql/item_func.cc:
  This warning is wrong since binlogging of functions was changed in August. If a function fails
  in the middle, it will be binlogged with its error code (i.e. properly).
sql/mysql_priv.h:
  variable name changed
sql/mysqld.cc:
  option name changes. A precision about --read-only.
sql/set_var.cc:
  a new class sys_var_trust_routine_creators to be able to issue a "this is a deprecated variable" warning if used.
sql/set_var.h:
  new class to be able to issue a "this is a deprecated variable" warning if used.
sql/share/errmsg.txt:
  routine -> function
sql/sp.cc:
  log-bin-trust-routine-creators now applies only to functions.
sql/sql_parse.cc:
  1) sending ER_FAILED_ROUTINE_BREAK_BINLOG is wrong since August as we don't binlog CALL anymore but instead binlog the substatements;
  the clear_error() goes away too as it was necessary only when we created a binlog event from the "CALL" statement.
  2) log-bin-trust-routine-creators now applies only to functions.
sql/sql_trigger.cc:
  comments.
2005-11-10 17:50:51 +01:00
unknown
ee84f5c728 Merge spachev@bk-internal.mysql.com:/home/bk/mysql-4.1
into  asksasha.com:/reiser-data/mysql-dev/mysql-4.1-bug7947


sql/item_func.cc:
  Auto merged
2005-11-07 15:10:48 -07:00
unknown
3004c8de2d fix for BUG#7947 - failure to log DO RELEASE_LOCK() if we disconnect in the middle of
transaction while holding the lock. Also test to make sure other binlogging issues
reported in the bug have been addressed.


sql/item_func.cc:
  fix for BUG#7947
mysql-test/r/rpl_bug7947.result:
  New BitKeeper file ``mysql-test/r/rpl_bug7947.result''
mysql-test/t/rpl_bug7947.test:
  New BitKeeper file ``mysql-test/t/rpl_bug7947.test''
2005-11-07 15:09:35 -07:00
unknown
d1a8ccc127 Fix for bug #13044: BIT_COUNT with NULL values.
sql/item_func.cc:
  Fix for bug #13044: BIT_COUNT with NULL values.
  Always set null_value.
2005-11-06 12:35:49 +04:00
unknown
b5182e4b92 Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-2


mysql-test/r/func_gconcat.result:
  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_sum.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.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_update.cc:
  Auto merged
2005-11-04 17:54:47 -08:00
unknown
4d65081cc5 Merge bk@192.168.21.1:/usr/home/bk/mysql-5.0
into mysql.com:/home/hf/work/mysql-5.0.13573


sql/item_func.cc:
  Auto merged
2005-11-03 11:05:34 +04:00
unknown
17149bbd14 Merge bk@192.168.21.1:/usr/home/bk/mysql-5.0
into mysql.com:/home/hf/work/mysql-5.0.13573


sql/item_func.cc:
  Auto merged
2005-11-02 18:58:25 +04:00
unknown
7d49eca96b Merge monty@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/my/mysql-5.0


sql/item_func.cc:
  Auto merged
sql/table.cc:
  Auto merged
2005-11-02 16:29:00 +02:00
unknown
a73b682af9 Fixed wrong merge
Optimize new pushed code


sql/item_func.cc:
  Fixed wrong merge
sql/sql_update.cc:
  Optimize new pushed code
  (There is no reason to add extra test for not common error case if code can handle it anyway)
2005-11-02 14:43:25 +02:00
unknown
b601d8f079 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-owner-5.0


sql/item_func.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/table.cc:
  merge
2005-11-02 12:56:19 +02:00
unknown
768b1e5087 Merge bk@192.168.21.1:/usr/home/bk/mysql-5.0
into mysql.com:/home/hf/work/mysql-5.0.13573


sql/item_func.cc:
  Auto merged
2005-11-02 13:01:21 +04:00
unknown
70536ba1b5 Manually merged
client/mysqltest.c:
  Auto merged
myisam/mi_check.c:
  Auto merged
mysql-test/r/update.result:
  Auto merged
mysql-test/t/update.test:
  Auto merged
sql/item_timefunc.h:
  Auto merged
sql/spatial.cc:
  Auto merged
sql/sql_select.h:
  Auto merged
BitKeeper/deleted/.del-acinclude.m4~f4ab416bac5003:
  Auto merged
2005-11-01 19:47:53 +03:00
unknown
cda9b1cbc9 Conflicts resolving
sql/item_func.cc:
  Auto merged
mysql-test/r/type_newdecimal.result:
  resolving
mysql-test/t/type_newdecimal.test:
  resolving
2005-11-01 20:37:27 +04:00
unknown
ee380a0777 Reverting patch for BUG #14009 (use of abs() on null value causes problems with filesort
Fix for bug #14536: SELECT @a,@a:=... fails with prepared statements


mysql-test/r/func_sapdb.result:
  Correct tests after reverting patch for BUG #14009 (use of abs() on null value causes problems with filesort)
mysql-test/r/type_newdecimal.result:
  Correct tests after reverting patch for BUG #14009 (use of abs() on null value causes problems with filesort)
mysql-test/r/user_var.result:
  More test with SELECT @a:=
mysql-test/t/disabled.def:
  Enable user_var.test for
mysql-test/t/user_var.test:
  More test with SELECT @a:=
sql/item.cc:
  Simple optimization during review of new code
sql/item_func.cc:
  Reverting patch for BUG #14009 (use of abs() on null value causes problems with filesort)
sql/item_timefunc.h:
  timediff() can return NULL for not NULL arguments
sql/sql_base.cc:
  Remove usage of current_thd() in mysql_make_view()
sql/sql_lex.h:
  Remove usage of current_thd() in mysql_make_view()
sql/sql_select.cc:
  Fix for bug #14536: SELECT @a,@a:=... fails with prepared statements
sql/sql_view.cc:
  Remove usage of current_thd() in mysql_make_view()
  Simple optimization of new code
sql/sql_view.h:
  Remove usage of current_thd() in mysql_make_view()
sql/table.cc:
  Simple optimization of new code
2005-11-01 15:54:30 +02:00
unknown
fffe741705 Review of new pushed code
Removed wrong fix for bug #14009 (use of abs() on null value causes problems with filesort)
Mark that add_time(), time_diff() and str_to_date() can return null values


myisam/mi_check.c:
  keyoffset is not a position (no %lx here)
mysql-test/r/func_sapdb.result:
  Fixed test after marking that timediff() can return NULL
sql/item_func.cc:
  Removed wrong fix for bug #14009 (use of abs() on null value causes problems with filesort)
sql/item_timefunc.cc:
  Mark that add_time and str_to_date() can return null values
sql/item_timefunc.h:
  Mark that time_diff can return 0
sql/spatial.cc:
  Simple cleanups during review of new code
2005-11-01 13:00:02 +02:00
unknown
d32e0486c6 postreview fixes
sql/item_func.cc:
  some optimisation
sql/sql_acl.cc:
  some optimisation
sql/sql_base.cc:
  some optimisation
sql/sql_parse.cc:
  some optimisation
sql/table.cc:
  some optimisation
2005-10-31 22:14:27 +02:00
unknown
bef391c878 Merge rurik.mysql.com:/home/igor/mysql-5.0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-2


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_delete.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_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2005-10-29 09:41:18 -07:00
unknown
ac8b32f9c0 Merge bk-internal:/home/bk/mysql-5.0
into  mysql.com:/home/jimw/my/mysql-5.0-clean


sql/item_func.cc:
  Auto merged
2005-10-28 10:17:37 -07:00
unknown
cc57d4ef4e Merge rurik.mysql.com:/home/igor/mysql-5.0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-2


sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.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_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2005-10-27 21:37:52 -07:00
unknown
80a8d8c4f8 Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into  mysql.com:/home/jimw/my/mysql-5.0-clean


mysql-test/t/func_math.test:
  Auto merged
mysql-test/r/func_math.result:
  Resolve conflict
sql/item_func.cc:
  Resolve conflict
2005-10-27 18:46:00 -07:00
unknown
c1852b1202 fixe of typos, comments & layout
sql/item_func.cc:
  fixed typo
sql/sql_acl.cc:
  comment fixed
sql/sql_parse.cc:
  comment fixed
sql/sql_view.cc:
  layout fixed
sql/table.cc:
  typo fixed
  layout fixed
sql/table.h:
  typo fixed
2005-10-28 00:56:44 +03:00
unknown
4a816ce152 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-owner7-5.0


mysql-test/r/information_schema.result:
  Auto merged
mysql-test/r/sp.result:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
2005-10-28 00:24:13 +03:00
unknown
24ac4019c5 support of view underlying tables and SP functions security check added (BUG#9505) (WL#2787)
mysql-test/r/information_schema.result:
  error message changed
mysql-test/r/sp.result:
  error message changed
mysql-test/r/sql_mode.result:
  fixed test suite
mysql-test/r/view.result:
  error message changed
mysql-test/r/view_grant.result:
  test of underlying view tables check
mysql-test/t/sql_mode.test:
  fixed test suite
mysql-test/t/view_grant.test:
  test of underlying view tables check
sql/item.cc:
  check of underlying tables privilege added
sql/item.h:
  Name the resolution context points to the security  context of view (if item belong to the view)
sql/item_func.cc:
  a view error hiding for execution of prepared function belonged to a view
  fixed checking privileges if stored functions belonds to some view
sql/mysql_priv.h:
  refult of derived table processing functions changed to bool
  Security_context added as an argument to find_field_in_table()
sql/share/errmsg.txt:
  error message fixed
sql/sql_acl.cc:
  Storing requested privileges of tables added
  View underlying tables privilege check added
sql/sql_base.cc:
  View underlying tables privilege check added
sql/sql_cache.cc:
  Code cleunup: we should not register underlying tables of view second time
sql/sql_delete.cc:
  ancestor -> merge_underlying_list renaming
sql/sql_derived.cc:
  refult of derived table processing functions changed to bool
  do not give SELECT_ACL for TEMPTABLE views
sql/sql_lex.h:
  The comment added
sql/sql_parse.cc:
  registration of requested privileges added
sql/sql_prepare.cc:
  registration of requested privileges added
sql/sql_update.cc:
  manipulation of requested privileges for underlying tables made the same as for table which we are updating
sql/sql_view.cc:
  underlying tables of view security check support added
sql/table.cc:
  renaming and fixing view preparation methods, methods for checking underlyoing tables security context added
sql/table.h:
  storege for reuested privileges added
2005-10-28 00:18:23 +03:00
unknown
fd0ed478d3 Add DROP TABLE before trying to create view (in mysqldump)
Cleaned up xxxx_gis.test's and made gis_generic.inc independent of ndb
(Note that archive_gis.test fails, but this is independent of this patch)


client/mysqldump.c:
  Add DROP TABLE to be able to re-run mysqldump if it fails after 'table-named-as-view' is created
mysql-test/include/gis_generic.inc:
  Remove dependency of ndb
mysql-test/include/have_archive.inc:
  Fix syntax
mysql-test/include/have_geometry.inc:
  Fix syntax
mysql-test/r/mysqldump.result:
  New test results after adding 'drop table'
mysql-test/t/archive_gis.test:
  gis_generic tests for have_geometry.inc
mysql-test/t/bdb_gis.test:
  gis_generic tests for have_geometry.inc
mysql-test/t/innodb_gis.test:
  gis_generic tests for have_geometry.inc
mysql-test/t/ndb_gis.test:
  gis_generic tests for have_geometry.inc
sql/item_func.cc:
  Simplify code (as signal_divide_by_null sets 'null_value')
2005-10-27 22:45:18 +03:00
unknown
5e8515d9f2 Merge mysql.com:/home/jimw/my/mysql-4.1-14009
into  mysql.com:/home/jimw/my/mysql-4.1-clean


sql/item_func.cc:
  Auto merged
2005-10-27 10:20:38 -07:00
unknown
2cf69d0721 Additional fix for bug #13573
sql/item_func.cc:
  don't return NULL when we got E_DEC_OVERFLOW
2005-10-26 11:54:15 +05:00
unknown
e579fe3eee Merge deer.(none):/home/hf/work/mysql-5.0.13820
into deer.(none):/home/hf/work/mysql-5.0.12267


sql/item_func.cc:
  Auto merged
2005-10-25 21:10:58 +05:00
unknown
cd49e32407 Merge rurik.mysql.com:/home/igor/mysql-5.0
into rurik.mysql.com:/home/igor/dev/mysql-5.0-2


sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2005-10-22 19:35:37 -07:00
unknown
3d53c870d3 Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into  mysql.com:/home/jimw/my/mysql-5.0-clean


mysql-test/my_manage.c:
  Auto merged
mysql-test/mysql_test_run_new.c:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
mysql-test/r/variables.result:
  Resolve conflicts
mysql-test/t/variables.test:
  Resolve conflicts
sql/sql_acl.cc:
  Resolve conflicts
strings/ctype-simple.c:
  Resolve conflicts
strings/ctype-ucs2.c:
  Resolve conflicts
2005-10-19 13:47:05 -07:00
unknown
c0eae8f0a1 Some fixes to avoid compiler warnings.
mysql-test/my_manage.c:
  Avoid warning: i not used in case of Windows.
mysql-test/mysql_test_run_new.c:
  Removed unused variable.
sql/item_func.cc:
  Removed unused variables.
strings/ctype-simple.c:
  Added cast.
strings/ctype-ucs2.c:
  Added cast.
2005-10-18 18:03:26 +03:00
unknown
47b044f411 Fix Item_func_abs::fix_length_and_dec() to set maybe_null properly. (Bug #14009)
mysql-test/r/func_math.result:
  Add new results
mysql-test/t/func_math.test:
  Add new regression test
sql/item_func.cc:
  Set maybe_null in Item_func_abs::fix_length_and_dec().
2005-10-17 17:00:42 -07:00
unknown
1f6bc6550f Fix for bug #13820 (No warning on log(NEGATIVE))
mysql-test/r/func_math.result:
  result fixed
mysql-test/t/func_math.test:
  test case added
sql/item_func.cc:
  tests for (value<=0.0) added to LOG* functions
2005-10-17 12:32:22 +05:00
unknown
6a0695fe93 Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.


mysql-test/r/func_gconcat.result:
  Changed a query when fixing bug #12762.
mysql-test/r/subselect.result:
  Added test cases for bug #12762.
  Allowed set functions aggregated in outer subqueries. Allowed nested set functions.
mysql-test/t/func_gconcat.test:
  Changed a query when fixing bug #12762.
mysql-test/t/subselect.test:
  Added test cases for bug #12762.
  Allowed set functions aggregated in outer subqueries. Allowed nested set functions.
sql/item.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
  aggregated in outer subquries.
  Changed Item_field::fix_fields to calculate attributes used when checking context conditions
  for set functions.
  Allowed alliases for set functions defined in outer subqueries.
sql/item.h:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
  aggregated in outer subquries.
sql/item_cmpfunc.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
  aggregated in outer subquries.
sql/item_func.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
  aggregated in outer subquries.
sql/item_row.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
  aggregated in outer subquries.
sql/item_strfunc.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Added a parameter to Item::split_sum_func2 aliowing to defer splitting for set functions
  aggregated in outer subquries.
sql/item_subselect.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced next levels for subqueries and a bitmap of nesting levels showing
  in what subqueries a set function can be aggregated.
sql/item_sum.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Added Item_sum methods to check context conditions imposed on set functions.
sql/item_sum.h:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Added Item_sum methods to check context conditions imposed on set functions.
sql/mysql_priv.h:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced a type of bitmaps to be used for nesting constructs.
sql/sql_base.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced next levels for subqueries and a bitmap of nesting levels showing
  in what subqueries a set function can be aggregated.
sql/sql_class.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced a bitmap of nesting levels showing in what subqueries a set function can be aggregated.
sql/sql_class.h:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced a bitmap of nesting levels showing in what subqueries a set function can be aggregated.
sql/sql_delete.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced a bitmap of nesting levels showing in what subqueries a set function can be aggregated.
sql/sql_lex.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced next levels for subqueries and a bitmap of nesting levels showing
  in what subqueries a set function can be aggregated.
sql/sql_lex.h:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced next levels for subqueries and a bitmap of nesting levels showing
  in what subqueries a set function can be aggregated.
sql/sql_parse.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced next levels for subqueries.
sql/sql_prepare.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced a bitmap of nesting levels showingin what subqueries a set function can be aggregated.
sql/sql_select.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced next levels for subqueries and a bitmap of nesting levels showing
  in what subqueries a set function can be aggregated.
sql/sql_update.cc:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced a bitmap of nesting levels showing in what subqueries a set function can be aggregated.
sql/sql_yacc.yy:
  Fixed bug #12762:
  allowed set functions aggregated in outer subqueries, allowed nested set functions.
  Introduced next levels for subqueries.
2005-10-15 14:32:37 -07:00
unknown
a1db45674b Fix for bug #13573 (wrong data inserted for too big decimals)
mysql-test/r/type_newdecimal.result:
  result fixed
mysql-test/t/type_newdecimal.test:
  test case added
sql/item_func.cc:
  conditions fixed
sql/my_decimal.cc:
  overflow handling added
sql/my_decimal.h:
  overflow handling added - so the result of operation gets maximum possible
  decimal value
2005-10-15 21:57:32 +05:00
unknown
0f1516b98e Fix for bug #9855 (Inconsistend column type in create select)
mysql-test/r/func_gconcat.result:
  result fixed
mysql-test/r/subselect.result:
  result fixed
mysql-test/r/type_float.result:
  result fixed
mysql-test/t/type_float.test:
  testcase added
sql/item_func.cc:
  Now we set decimals to NOT_FIXED_DEC if the max_length is longer than
  maximum possible double length
2005-10-15 19:47:23 +05:00
unknown
df3e57f51f Merge mysql.com:/usr/home/bar/mysql-4.1.b13751
into  mysql.com:/usr/home/bar/mysql-5.0.char1


mysql-test/t/ctype_utf8.test:
  Auto merged
sql/item_func.cc:
  Auto merged
mysql-test/r/ctype_utf8.result:
  after merge fix.
sql/sql_update.cc:
  discarding this change in 5.0.
2005-10-14 12:07:13 +05:00
unknown
0ce12f70ed Reviewing new pushed code
- CHAR() now returns binary string as default
- CHAR(X*65536+Y*256+Z) is now equal to CHAR(X,Y,Z) independent of the character set for CHAR()
- Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
  (Some old systems returns ETIME and it's safer to test for both values
   than to try to write a wrapper for each old system)
- Fixed new introduced bug in NOT BETWEEN X and X
- Ensure we call commit_by_xid or rollback_by_xid for all engines, even if one engine has failed
- Use octet2hex() for all conversion of string to hex
- Simplify and optimize code


client/mysqldump.c:
  Simple optimizations of new code
  Indentation fixes
client/mysqltest.c:
  Removed not needed variable
include/mysql_com.h:
  Made octec2hex() more usable
mysql-test/r/ctype_utf8.result:
  CHAR() now returns binary string as default
mysql-test/r/func_str.result:
  CHAR() now returns binary string as default
mysql-test/r/range.result:
  Added test to verify new introduced bug in NOT BETWEEN X and X
mysql-test/r/user_var-binlog.result:
  CHAR() now returns binary string as default
mysql-test/r/view.result:
  More tests of view rename
mysql-test/t/ctype_utf8.test:
  CHAR() now returns binary string as default
mysql-test/t/func_str.test:
  CHAR() now returns binary string as default
mysql-test/t/range.test:
  Added test to verify new introduced bug in NOT BETWEEN X and X
mysql-test/t/view.test:
  More tests of view rename
mysys/mf_keycache.c:
  Indentation changes
  Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
mysys/my_os2cond.c:
  Fix to MySQL coding style
  Optimized functions
mysys/thr_lock.c:
  Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
mysys/thr_mutex.c:
  Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
server-tools/instance-manager/instance.cc:
  Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
server-tools/instance-manager/thread_registry.cc:
  Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
sql/ha_federated.cc:
  Use octet2hex()
sql/ha_ndbcluster.cc:
  Removed not used variable
sql/handler.cc:
  Simplify code
  Use *NONE* instead of 'none' for not existing storage engine
  Ensure we call commit_by_xid or rollback_by_xid for all engines, even if one engine has failed
sql/item.h:
  Remove not needed test for *ref.  (If ref is set, it should never point at 0)
sql/item_func.cc:
  Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
  Simplify code
  More comments
  Require that last argument to find_and_check_access() is given
  (Made code shorter and faster)
sql/item_strfunc.cc:
  Changed CHAR() to return result in binary collation
  CHAR(X*65536+Y*256+Z) is now equal to CHAR(X,Y,Z) independent of the character set for CHAR()
  
  Bar will shortly add the following syntax:
  CHAR(.... USING character_set)
  and ensure that
  CONVERT(CHAR(....) USING utf8) cuts not legal utf8 strings
  Use ocet2hex()
sql/item_strfunc.h:
  CHAR() now returns a binary string
sql/log_event.cc:
  Use octet2hex()
  Simplify code
sql/parse_file.cc:
  Indentation fixes
  Use for() instead of while()
sql/password.c:
  Make octet2hex() more generally usable by returning pointer to end 0
sql/slave.cc:
  Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
sql/sql_base.cc:
  Indentation fixes
sql/sql_insert.cc:
  Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
sql/sql_manager.cc:
  Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
sql/sql_parse.cc:
  Don't check thd->db when checking for function privileges
sql/sql_prepare.cc:
  Fixed wrong merge
sql/sql_select.cc:
  Fixed new bug for NOT BETWEEN X and X
sql/sql_show.cc:
  Removed not used variable
sql/sql_table.cc:
  Indentation fixed
  Removed DBUG_PRINT that is obvious from context
sql/sql_view.cc:
  Simplify code
sql/unireg.cc:
  Use octet2hex()
2005-10-12 00:58:22 +03:00
unknown
c2621f3dcb Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0


BUILD/SETUP.sh:
  Auto merged
client/mysql.cc:
  Auto merged
client/mysqldump.c:
  Auto merged
client/mysqltest.c:
  Auto merged
include/my_sys.h:
  Auto merged
mysql-test/r/func_str.result:
  Auto merged
mysql-test/r/information_schema.result:
  Auto merged
mysql-test/r/information_schema_inno.result:
  Auto merged
mysql-test/r/multi_statement.result:
  Auto merged
mysql-test/r/mysqldump.result:
  Auto merged
mysql-test/r/temp_table.result:
  Auto merged
mysql-test/t/func_str.test:
  Auto merged
mysql-test/t/information_schema.test:
  Auto merged
mysql-test/t/information_schema_inno.test:
  Auto merged
mysql-test/t/multi_statement.test:
  Auto merged
mysql-test/t/mysql.test:
  Auto merged
mysql-test/t/temp_table.test:
  Auto merged
sql/ha_federated.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/structs.h:
  Auto merged
sql/table.h:
  Auto merged
strings/decimal.c:
  Auto merged
sql/sql_parse.cc:
  manual merge
sql/sql_prepare.cc:
  manual merge
sql/table.cc:
  manual merge
2005-10-08 03:37:23 +03:00
unknown
c657d5a72f ctype_utf8.result, ctype_utf8.test:
Adding test case.
item_func.cc:
  Bug#13751 find_in_set: Illegal mix of collations.
  Character set conversion was forgotten in find_in_set.


sql/item_func.cc:
  Bug#13751 find_in_set: Illegal mix of collations.
  Character set conversion was forgotten in find_in_set.
mysql-test/t/ctype_utf8.test:
  Adding test case.
mysql-test/r/ctype_utf8.result:
  Adding test case.
2005-10-07 09:52:15 +05:00
unknown
c807724f36 Review of code pushed since last 5.0 pull:
Ensure that ccache is also used for C programs
mysql: Ensure that 'delimiter' works the same way in batch mode as in normal mode
mysqldump: Change to use ;; (instead of //) as a stored procedure/trigger delimiter
Fixed test cases by adding missing DROP's and rename views to be of type 'v#'
Removed MY_UNIX_PATH from fn_format()
Removed current_db_used from TABLE_LIST
Removed usage of 'current_thd' in Item_splocal
Removed some compiler warnings
A bit faster longlong2str code



BUILD/FINISH.sh:
  Ensure that ccache is also used for C programs
BUILD/SETUP.sh:
  Ensure that ccache is also used for C programs
client/mysql.cc:
  More debugging
  Ensure that 'delimiter' works the same way in batch mode as in normal mode.
  Compare 'delimiter' command case-insensitive.
  The above fixes the delimiter bugs so that we can now use ;; as a trigger/SP function delimiter in mysqldump.
client/mysqldump.c:
  Indentation fixes
  Use ;; as a delmimiter for stored procedures and triggers instead of //
client/mysqltest.c:
  Indentation fixes
include/my_sys.h:
  Remove not needed MY_UNIX_PATH parameter
mysql-test/r/alter_table.result:
  Better to reuse mysqltest database (test didn't properly delete mysqltest1 at start)
mysql-test/r/func_str.result:
  More testing of CONV() (to ensure that longlong2str() works correctly)
mysql-test/r/information_schema.result:
  Drop all used tables and views
  Rename view tables to 'v#' to ensure that if this test fails, not a lot of other test fails
mysql-test/r/information_schema_inno.result:
  Drop all used tables
mysql-test/r/multi_statement.result:
  Drop used tables
mysql-test/r/mysql.result:
  Add error messages to result
mysql-test/r/mysqldump.result:
  ;; is now used as SP/trigger delimiter
mysql-test/r/mysqlshow.result:
  Drop used tables
mysql-test/r/temp_table.result:
  Drop used views
  Rename views to v#
mysql-test/t/alter_table.test:
  Better to reuse mysqltest database (test didn't properly delete mysqltest1 at start)
mysql-test/t/func_str.test:
  More testing of CONV() (to ensure that longlong2str() works correctly)
mysql-test/t/information_schema.test:
  Drop all used tables and views
  Rename view tables to 'v#' to ensure that if this test fails, not a lot of other test fails
mysql-test/t/information_schema_inno.test:
  Drop all used tables
mysql-test/t/multi_statement.test:
  Drop used tables
mysql-test/t/mysql.test:
  Add error messages to result
mysql-test/t/mysqlshow.test:
  Drop used tables
mysql-test/t/temp_table.test:
  Drop used views
  Rename views to v#
mysys/mf_format.c:
  Remove not needed MY_UNIX_PATH parameter
  (This goes against how fn_format() is supposed to work and also conflicts with other options like MY_RETURN_REAL_PATH)
sql/ha_federated.cc:
  Removed extra empty line
sql/item.cc:
  Use 'str_value' instead of 'str_value_ptr' to hold result for Item_splocal
  Remove some calls to 'thd' in Item_splocal by making 'thd' a class variable
  One doesn't have to set 'null_value' when calling 'is_null()'
sql/item.h:
  Add THD as a class variable to Item_splocal
  Use 'str_value' instead of 'str_value_ptr' to hold temp result
  Fixed bug in Item_hex when used in CAST()
sql/item_func.cc:
  Optimize new code
sql/log_event.cc:
  Move 'to_unix_path()' out of fn_format()
sql/opt_range.cc:
  Simplify code
sql/sp_head.cc:
  Ensure that Item_splocal has thd set before we call '->this_item()'
sql/sql_class.cc:
  Return error if Statement::insert() fails in either hash_insert()
sql/sql_parse.cc:
  Remove 'current_db_used' as we can trivially check if db table qualifier was used without this.
  Simplify code
sql/sql_prepare.cc:
  Use enum instead of const int, to avoid ugly code for VC++
sql/structs.h:
  Remove compiler warnings when using STRING_WITH_LEN() with constant strings.
sql/table.cc:
  Fixed indentation
sql/table.h:
  Remove not needed current_db_used
strings/decimal.c:
  Simplify code
strings/longlong2str-x86.s:
  A bit faster longlong2str.
  (Took some ideas from Peter Gulutzan's code)
strings/my_strtoll10.c:
  Simplify code for MetroWerks compiler
2005-10-06 17:54:43 +03:00
unknown
3f35fce127 sql/item_func.cc
remove extra ";" after function


sql/item_func.cc:
  remove extra ";" after function
2005-09-21 14:36:55 +02:00
unknown
21a62eb1c6 postmerge fixes
libmysqld/lib_sql.cc:
  struct st_security_context nad to class Security_context
sql/item_func.cc:
  fixed method call, name and contence to be compatible with new code
sql/item_func.h:
  fixed method to be compatible wit new code
sql/sql_parse.cc:
  fixed typo
  removed compiler warnings
2005-09-21 08:29:47 +03:00
unknown
aa95f0d447 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-owner5-5.0


sql/ha_innodb.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/item_func.cc:
  merge
2005-09-20 21:27:28 +03:00
unknown
3fe752f527 WL#2787 (Add view definer/owner to the view definition (.frm) to check privileges on used tables and stored routines when using a VIEW.)
Part 2 postreview fixes.


sql/ha_innodb.cc:
  Renamed structure st_security_context to class Security_context
sql/item_func.cc:
  Renamed structure st_security_context to class Security_context
sql/item_strfunc.cc:
  fixed USER() function
sql/log.cc:
  variable used to optimize access to security context
sql/mysql_priv.h:
  Renamed structure st_security_context to class Security_context
sql/mysqld.cc:
  main security context used direcly
sql/sp_head.cc:
  Renamed structure st_security_context to class Security_context
  removed unneed variable
sql/sp_head.h:
  Comment inmroved
  Renamed structure st_security_context to class Security_context
sql/sql_acl.cc:
  Renamed structure st_security_context to class Security_context
  fixed function comment and return value
  variable used to optimize access to security context
  Renamed method of Security_ontext
sql/sql_acl.h:
  fixed return value type
sql/sql_class.cc:
  Renamed structure st_security_context to class Security_context
sql/sql_class.h:
  Renamed structure st_security_context to class Security_context
  Method renamed
sql/sql_db.cc:
  Renamed structure st_security_context to class Security_context
  fixed layout
sql/sql_parse.cc:
  registration of wanted access for underlying tables
sql/sql_show.cc:
  Renamed structure st_security_context to class Security_context
  fixed layout
sql/sql_yacc.yy:
  Renamed structure st_security_context to class Security_context
2005-09-20 21:20:38 +03:00
unknown
58dbcea4b4 item_func.cc:
Fixed mistake in fix for bug#12812


sql/item_func.cc:
  Fixed mistake in fix for bug#12812
2005-09-20 21:35:57 +04:00
unknown
7a47331f7d Manual merge
sql/item_func.cc:
  Auto merged
2005-09-20 03:31:00 +04:00
unknown
43dd29dfaa Fix bug #12812 create view calling a function works without execute right on function
Execution rigths on function was checked just before function execution,
thus it was unknown on prepare stage whether user have right to execute 
particular function.

Added access rights checking function which is called right after fixing
Item_func_sp.
This have additional effect that if user don't have rights for execution
query will fail on earlier stage and will not waste resources on optimizing
with failing on execution stage.


sql/item_func.h:
  Fix bug#12812 create view calling a function works without execute right on function
sql/item_func.cc:
  Fix bug#12812 create view calling a function works without execute right on function
  Added function Item_func_sp::check_access() which checks access rights.
  Added function Item_func_sp::fix_field() which calls check_access() after fixing.
  Item_func_sp::execute() now calls to check_access() to check access rights.
mysql-test/t/sp.test:
  Test case for bug#12812 create view calling a function works without execute right on function
mysql-test/r/sp.result:
  Test case for bug#12812 create view calling a function works without execute right on function
2005-09-20 03:05:35 +04:00
unknown
84f029a448 WL#2787 (part 2, ver 3 (merged)) changed securety context switching
libmysqld/lib_sql.cc:
  changed securety context switching
mysql-test/r/rpl_sp.result:
  now it show real information from changed security context of SP (checked)
sql/ha_innodb.cc:
  changed securety context switching
sql/item.cc:
  changed securety context switching
sql/item_func.cc:
  changed securety context switching
sql/item_strfunc.cc:
  changed securety context switching
sql/log.cc:
  changed securety context switching
sql/mysql_priv.h:
  changed securety context switching
sql/mysqld.cc:
  changed securety context switching
sql/repl_failsafe.cc:
  changed securety context switching
sql/set_var.cc:
  changed securety context switching
sql/slave.cc:
  changed securety context switching
sql/sp.cc:
  changed securety context switching
sql/sp_head.cc:
  changed securety context switching
  in case of inability to switch context  we return error now
sql/sp_head.h:
  changed securety context switching
sql/sql_acl.cc:
  changed securety context switching
sql/sql_acl.h:
  changed securety context switching
sql/sql_base.cc:
  changed securety context switching
sql/sql_class.cc:
  changed securety context switching
sql/sql_class.h:
  changed securety context switching
sql/sql_db.cc:
  changed securety context switching
sql/sql_insert.cc:
  changed securety context switching
sql/sql_parse.cc:
  changed securety context switching
sql/sql_show.cc:
  changed securety context switching
sql/sql_trigger.cc:
  changed securety context switching
sql/sql_view.cc:
  changed securety context switching
sql/sql_yacc.yy:
  changed securety context switching
2005-09-15 22:29:07 +03:00
unknown
685173664a fix for Bug #12979 Stored procedures: crash if inout decimal parameter
mysql-test/r/sp.result:
  fix result
mysql-test/r/type_newdecimal.result:
  fix result
mysql-test/t/sp.test:
  add a test for the bug
mysql-test/t/type_newdecimal.test:
  add a test for the bug
sql/item_func.cc:
  call correct method of the item
2005-09-14 07:25:32 +04:00
unknown
5ed7e97310 Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/psergey/mysql-5.0-bug12943


mysql-test/r/sp.result:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2005-09-09 10:08:46 +04:00
unknown
eb769e54b8 Fix for BUG#12637: Make SPs+user variables replication work:
* Allocate thd->user_var_events elements on appropriate mem_root
* If several SP statements are binlogged as a single statement, collect all user var
  accesses they make (grep for StoredRoutinesBinlogging for details)


mysql-test/r/rpl_sp_effects.result:
  Testcase for BUG#12637
mysql-test/r/sp.result:
  re-enabled test case for BUG#12297
mysql-test/t/rpl_sp_effects.test:
  Testcase for BUG#12637
mysql-test/t/sp.test:
  re-enabled test case for BUG#12297
sql/item_func.cc:
  Fix for BUG#12637: Make SPs+user variables replication work:
  * Allocate thd->user_var_events elements on appropriate mem_root
  * If several SP statements are binlogged as a single statement, collect all user var
    accesses they make.
sql/log.cc:
  Fix for BUG#12637: Make SPs+user variables replication work:
  * Allocate thd->user_var_events elements on appropriate mem_root
  * If several SP statements are binlogged as a single statement, collect all user var
    accesses they make.
sql/sp_head.cc:
  Fix for BUG#12637: Make SPs+user variables replication work:
  * Allocate thd->user_var_events elements on appropriate mem_root
  * If several SP statements are binlogged as a single statement, collect all user var
    accesses they make.
sql/sp_head.h:
  Remove compiler warning.
sql/sql_class.h:
  Fix for BUG#12637: Make SPs+user variables replication work.
sql/sql_parse.cc:
  Fix for BUG#12637: Make SPs+user variables replication work.
2005-09-07 19:39:47 +04:00
unknown
5618d0217e Merge sanja.is.com.ua:/home/bell/mysql/bk/work-4.1
into  sanja.is.com.ua:/home/bell/mysql/bk/work-mrg-5.0


configure.in:
  Auto merged
mysql-test/r/func_math.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/t/func_math.test:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_cache.h:
  Auto merged
2005-09-06 20:51:15 +03:00
unknown
61a5fac1cc Bug #6172 RAND(a) should only accept constant values as arguments(2nd version)
Argument of RAND function can be constant value only
2005-09-06 16:19:59 +05:00
unknown
c910050a76 Implement WL#2661 "Prepared Statements: Dynamic SQL in Stored Procedures".
The idea of the patch is to separate statement processing logic,
such as parsing, validation of the parsed tree, execution and cleanup, 
from global query processing logic, such as logging, resetting
priorities of a thread, resetting stored procedure cache, resetting
thread count of errors and warnings.
This makes PREPARE and EXECUTE behave similarly to the rest of SQL
statements and allows their use in stored procedures.
This patch contains a change in behaviour:
until recently for each SQL prepared statement command, 2 queries
were written to the general log, e.g.
[Query]   prepare stmt from @stmt_text;
[Prepare] select * from t1 <-- contents of @stmt_text
The chagne was necessary to prevent [Prepare] commands from being written
to the general log when executing a stored procedure with Dynamic SQL.
We should consider whether the old behavior is preferrable and probably
restore it.
This patch refixes Bug#7115, Bug#10975 (partially), Bug#10605 (various bugs
in Dynamic SQL reported before it was disabled).


mysql-test/r/not_embedded_server.result:
  Since we don't want to log Dynamic SQL in stored procedures,
  now the general log gets only one log entry per SQL statement.
mysql-test/r/sp-error.result:
  - remove obsolete tests
  - a better error message for the case when a stored procedure that
  returns a result set is called from a function
mysql-test/r/trigger.result:
  - a better error message for the case when a stored procedure that
  returns a result set is called from a trigger
mysql-test/t/sp-error.test:
  - a better error message for the case when a stored procedure that
    returns a result set is called from a function.
  - move the comment to its place (end of file).
mysql-test/t/trigger.test:
  - a better error message for the case when a stored procedure that
  returns a result set is called from a trigger
sql/item_func.cc:
  - we need to pass sql_command explicitly to get_var_with_binlog, because
  when creating a query for SQL prepared statement thd->lex->sql_command
  points at SQLCOM_EXECUTE, which is not listed in the list of update
  queries.
sql/log_event.h:
  - remove an extra copy of the previous sentence
sql/mysql_priv.h:
  - fix declarations of sql_prepare.cc API
sql/share/errmsg.txt:
  - a new error message, when one attempts to execute a prepared statement
  which is currently being executed (this can happen only in Dynamic SQL
  at the moment).
sql/sp_head.cc:
  - extend sp_multi_results_command to return different flags for a
  command (and rename it)
  - add support for SQLCOM_PREPARE,SQLCOM_EXECUTE, SQLCOM_DEALLOCATE
    to sp_get_flags_for_command
  - replace multiple boolean sp_head members with uint m_flags
  - a fix for a crash when user variables are used in a stored procedure
    and binlog is on. A temporary fix for Bug#12637 "SP crashes the server 
   if it has update query with user var & binlog is enabled", which actually
   stands for stored functions: now instead of a crash we break
   replication if a user variable is used in a stored function which 
   is executed in prelocked mode.
sql/sp_head.h:
  - replace multiple boolean flags of sp_head with uint m_flags;
  - add flag CONTAINS_DYNAMIC_SQL
  - use this flag to error if a stored procedure with Dynamic SQL is
    called from a function or trigger.
sql/sql_class.cc:
  - Statement_map::insert should not delete a statement if it exists,
    now it's done externally to be able to handle the case when the
    statement being deleted is in use.
  - remove extra code (free_list is already reset in free_items)
sql/sql_lex.cc:
  - add lex->stmt_prepare_mode; we can't rely on thd->command any more,
    because we don't reset it any more (Dynamic SQL requirement is that
    PS are as little intrusive as possible).
sql/sql_lex.h:
  - declare bool LEX::stmt_prepare_mode
sql/sql_parse.cc:
  - move prepared statement code to sql_prepare.cc
  - change declarations (refactored code)
  - better error message when one attempts to use Dynamic SQL or a 
    stored procedure that returns a result set in a function or trigger.
sql/sql_prepare.cc:
  - major refactoring to ensure PREPARE/EXECUTE commands do not reset global THD
    state and allow their use in stored procedures.
  - add Prepared_statement::flags and use it to ensure no recursive execution
    of a prepared statement is possible
  - better comments
sql/sql_yacc.yy:
  - enable PREPARE/EXECUTE/DEALLOCATE in stored procedures
  - produce an error message on attempt to use PREPARE/EXECUTE/DEALLOCATE
    in a stored function or trigger
mysql-test/r/sp-dynamic.result:
  - sp-dynamic.test results
mysql-test/t/sp-dynamic.test:
  - a new test for PREPARE/EXECUTE/DEALLOCATE in stored procedures.
2005-09-03 03:13:18 +04:00
unknown
dc92221300 Rename:
- current_arena to stmt_arena: the thread may have more than one
'current' arenas: one for runtime data, and one for the parsed 
tree of a statement. Only one of them is active at any moment.
- set_item_arena -> set_query_arena, because Item_arena was renamed to 
Query_arena a while ago
- set_n_backup_item_arena -> set_n_backup_active_arena;
the active arena is the arena thd->mem_root and thd->free_list
are currently pointing at.
- restore_backup_item_arena -> restore_active_arena (with the same
rationale)
- change_arena_if_needed -> activate_stmt_arena_if_needed; this
method sets thd->stmt_arena active if it's not done yet.


sql/item.cc:
  Rename.
sql/item_cmpfunc.cc:
  Rename.
sql/item_func.cc:
  Rename.
sql/item_subselect.cc:
  Rename.
sql/item_subselect.h:
  Remove an unused forward declaration.
sql/item_sum.h:
  Remove an unused forward declaration.
sql/mysql_priv.h:
  Remove an unused forward declaration.
sql/sp.cc:
  Rename.
sql/sp_head.cc:
  Rename.
sql/sql_base.cc:
  Rename.
sql/sql_class.cc:
  Rename.
sql/sql_class.h:
  Rename.
sql/sql_lex.cc:
  Rename.
sql/sql_parse.cc:
  Rename.
sql/sql_prepare.cc:
  Rename.
sql/sql_select.cc:
  Rename.
sql/sql_show.cc:
  Rename.
sql/sql_union.cc:
  Rename.
sql/sql_view.cc:
  Rename.
sql/table.cc:
  Rename.
2005-09-02 17:21:19 +04:00
unknown
c38e297b64 fix for bug #12841
(Server crash on DO IFNULL(NULL,NULL)
(fixes also "SELECT CAST(IFNULL(NULL,NULL) as DECIMAL)" unreported
 crash)
(new revampled fix with suggestions from Igor)


mysql-test/r/select.result:
  result of test for bug 12841
mysql-test/t/select.test:
  test for bug #12841
  (Server crash on DO IFNULL(NULL,NULL)
sql/item_func.cc:
  don't use the return value of ::str_op() without checking it
  whether checking it for NULL. (fixes bug #12841 as well as
  another not reported bug, but existing one - test case added).
  All other places where ::str_op() is used are safe.
2005-08-29 15:45:03 +02:00
unknown
28920f5987 func_str.result, null.result:
Corrected results after the fix for bug #12791.
func_test.result, func_test.test:
  Added test cases for bug #12791.
item_func.h, item_func.cc:
  Fixed bug #12791.
  Made LEAST/GREATES fully Oracle compliant.
  LEAST/GREATEST did not return NULL if only some
  arguments were NULLs. This did not comply with Oracle.


sql/item_func.cc:
  Fixed bug #12791.
  Made LEAST/GREATES fully Oracle compliant.
  LEAST/GREATEST did not return NULL if only some
  arguments were NULLs. This did not comply with Oracle.
sql/item_func.h:
  Fixed bug #12791.
  Made LEAST/GREATES fully Oracle compliant.
  LEAST/GREATEST did not return NULL if only some
  arguments were NULLs. This did not comply with Oracle.
mysql-test/t/func_test.test:
  Added test cases for bug #12791.
mysql-test/r/func_test.result:
  Added test cases for bug #12791.
mysql-test/r/null.result:
  Corrected results after the fix for bug #12791.
mysql-test/r/func_str.result:
  Corrected results after the fix for bug #12791.
2005-08-26 22:25:45 -07:00
unknown
8a5e527453 Fix for BUG#12335 (SP replication) : New binlogging strategy for stored PROCEDUREs/FUNCTIONs.
"Interleaved SPs execution is now binlogged properly, "SELECT spfunc()" is binlogged too.
The known remaining issue is binlogging/replication of "a routine is deleted while it is executed" scenario.


mysql-test/r/rpl_sp.result:
  Fix for BUG#12335: updated test cases/results
mysql-test/t/rpl_sp.test:
  Fix for BUG#12335: updated test cases/results
sql/item.cc:
  Fix for BUG#12335 (SP replication): 
   - Added Item_name_const 'function'
   - Addede 'delete reuse' to call dtor on item reuse
sql/item.h:
  Fix for BUG#12335 (SP replication) : Added Item_name_const 'function' + code cleanup
sql/item_create.cc:
   Fix for BUG#12335 (SP replication) : Added Item_name_const 'function'
sql/item_create.h:
   Fix for BUG#12335 (SP replication) : Added Item_name_const 'function'
sql/item_func.cc:
  Fix for BUG#12335 (SP replication) : binary log is now constrolled from within execute_function.
sql/lex.h:
  Fix for BUG#12335 (SP replication) : Added Item_name_const 'function'
sql/log.cc:
  Fix for BUG#12335 (SP replication) : Added MYSQL_LOG::{start|stop}_union_events to allow
  one to temporary disable binlogging but collect a 'union' information about binlog write
  calls.
sql/mysql_priv.h:
  Fix for BUG#12335 (SP replication)
sql/sp_head.cc:
  Fix for BUG#12335 (SP replication) : Now we use different SP binlogging strategy, grep for 
  StoredRoutinesBinlogging for details
sql/sp_head.h:
  Comments added
sql/sp_pcontext.h:
  Comments added
sql/sp_rcontext.h:
  Comments added
sql/sql_class.cc:
  Fix for BUG#12335 (SP replication) : Now we use different SP binlogging strategy, grep for 
  StoredRoutinesBinlogging for details
sql/sql_class.h:
  Fix for BUG#12335 (SP replication) : Added MYSQL_LOG::{start|stop}_union_events to allow
  one to temporary disable binlogging but collect a 'union' information about binlog write
  calls.
sql/sql_delete.cc:
  Fix for BUG#12335: check THD::query_str_binlog_unsuitable when writing to binlog.
sql/sql_insert.cc:
  Fix for BUG#12335: check THD::query_str_binlog_unsuitable when writing to binlog.
sql/sql_lex.cc:
  Fix for BUG#12335 (SP replication): Add ability to extract previous returned token from
  the tokenizer.
sql/sql_lex.h:
  Fix for BUG#12335 (SP replication): Add ability to extract previous returned token from
  the tokenizer.
sql/sql_parse.cc:
  Fix for BUG#12335 (SP replication) : Now we use different SP binlogging strategy, grep for 
  StoredRoutinesBinlogging for details
sql/sql_update.cc:
  Fix for BUG#12335: check THD::query_str_binlog_unsuitable when writing to binlog.
sql/sql_yacc.yy:
  Fix for BUG#12335 (SP replication) : When creating Item_splocal, remember where it is located
  in the query.
2005-08-25 17:34:34 +04:00
unknown
fc44a77649 Fix minor typo in handling of error conditions and return of SLEEP().
sql/item_func.cc:
  Remove unnecessary initialization, fix parens placement
2005-08-17 19:57:07 -07:00
unknown
cbdd54e415 Fix SLEEP() to be interruptable. (Bug #12582)
include/my_global.h:
  Add set_timespec_nsec() for setting higher-resolution time.
sql/item_func.cc:
  Use pthread_cond_timedwait() for SLEEP() so that it can be killed
  using the normal thread/query-killing code.
2005-08-16 16:31:16 -07:00
unknown
a914b5274f Save and clear run context before executing a stored function or trigger and restore it afterwards.
This allows us to use statement replication with functions and triggers
The following things are fixed with this patch:
- NOW() and automatic timestamps takes the value from the main event for functions and triggers (which allows these to replicate with statement level logging)
- No side effects for triggers or functions with auto-increment values(), last_insert_id(), rand() or found_rows()
- Triggers can't return result sets

Fixes bugs:
#12480: NOW() is not constant in a trigger
#12481: Using NOW() in a stored function breaks statement based replication
#12482: Triggers has side effects with auto_increment values
#11587: trigger causes lost connection error


mysql-test/r/trigger.result:
  Added test fpr big
mysql-test/t/sp-error.test:
  Changed error message numbers
mysql-test/t/trigger.test:
  Added test for trigger returning result (#11587)
sql/item_func.cc:
  Store the first used seed value for RAND() value.
  (This makes rand() replicatable in functions and triggers)
  Save and clear run context before executing a stored function and restore it afterwards.
  This removes side effects of stored functions for RAND(), auto-increment values and NOW() and makes most stored function replicatable
sql/share/errmsg.txt:
  Reuse error message also for triggers
sql/sp_head.cc:
  If in function or trigger, don't change value of NOW()
  (This allows us to use statement replication with functions that directly or indirectly uses timestamps)
sql/sql_class.cc:
  Added framework for storing and retrieving run context while exceuting triggers or stored functions.
sql/sql_class.h:
  Added framework for storing and retrieving run context while exceuting triggers or stored functions.
sql/sql_parse.cc:
  If in function or trigger, don't change value of NOW()
  (This allows us to use statement replication with functions that directly or indirectly uses timestamps)
sql/sql_trigger.cc:
  Moved process_triggers function from sql_trigger.h
  Use reset/restore sub_statement_state while executing triggers to avoid side effects and make them replicatable
sql/sql_trigger.h:
  Moved process_triggers function from sql_trigger.h
  Use reset/restore sub_statement_state while executing triggers to avoid side effects and make them replicatable
sql/sql_yacc.yy:
  Give error message if trigger can return a result set (Bug #11587)
tests/fork_big2.pl:
  Removed return from end of lines
mysql-test/r/rpl_trigger.result:
  New BitKeeper file ``mysql-test/r/rpl_trigger.result''
mysql-test/t/rpl_trigger.test:
  New BitKeeper file ``mysql-test/t/rpl_trigger.test''
2005-08-15 18:15:12 +03:00
unknown
7eebb75132 Add SLEEP(seconds) function, which always returns 0 after the given
number of seconds (which can include microseconds). (Bug #6760)


mysql-test/r/func_misc.result:
  Add new results
mysql-test/t/func_misc.test:
  Add new regression test.
sql/item_create.cc:
  Add create_func_sleep()
sql/item_create.h:
  Add create_func_sleep()
sql/item_func.cc:
  Add sleep() implementation
sql/item_func.h:
  Add class for sleep() function
sql/lex.h:
  Handle SLEEP() function
2005-08-11 18:58:22 -07:00
unknown
e442059c0d Manual merge
mysql-test/r/sp.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/item_func.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_lex.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_trigger.h:
  Auto merged
2005-08-03 03:47:07 +00:00
unknown
d083e4ac1b Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into  mysql.com:/home/jimw/my/mysql-5.0-clean


mysql-test/r/key_cache.result:
  Auto merged
mysql-test/r/ps_1general.result:
  Auto merged
mysql-test/r/variables.result:
  Auto merged
mysql-test/r/func_math.result:
  Resolve conflicts
mysql-test/r/user_var.result:
  Resolve conflicts
mysql-test/t/func_math.test:
  Resolve conflicts
mysql-test/t/user_var.test:
  Resolve conflicts
sql/item_func.cc:
  Resolve conflicts
sql/sql_parse.cc:
  Resolve conflicts
2005-08-01 17:54:57 -07:00
unknown
dc6810ec5b Merge mysql.com:/home/jimw/my/mysql-4.1-11402
into  mysql.com:/home/jimw/my/mysql-4.1-clean


sql/item_func.cc:
  Auto merged
mysql-test/t/func_math.test:
  Resolve conflict
2005-08-01 17:11:49 -07:00
unknown
a69ca6dc99 Merge mysql.com:/home/jimw/my/mysql-4.1-10724
into  mysql.com:/home/jimw/my/mysql-4.1-clean


sql/item_func.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
mysql-test/t/user_var.test:
  Resolve conflict
2005-08-01 17:10:35 -07:00
unknown
11abe15eab Added Non-prelocked SP execution: Now a PROCEDURE doesn't enter/leave prelocked mode for
its body, but lets each statement to get/release its own locks. This allows a broader set
of statements to be executed inside PROCEDUREs (but breaks replication)
This patch should fix BUG#8072, BUG#8766, BUG#9563, BUG#11126


mysql-test/r/sp-security.result:
  Drop tables this test attempts to create
mysql-test/r/sp-threads.result:
  Update test results
mysql-test/r/sp.result:
  Disabled a test that triggers BUG#11986, cleanup used tables when tests start.
mysql-test/r/view.result:
  Enabled a test case that now works with prelocking-free SPs
mysql-test/t/sp-security.test:
  Drop tables this test attempts to create
mysql-test/t/sp.test:
  Disabled a test that triggers BUG#11986, cleanup used tables when tests start.
mysql-test/t/view.test:
  Enabled a test case that now works with prelocking-free SPs
sql/handler.cc:
  Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
sql/item_func.cc:
  Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
sql/sp.cc:
  Non-prelocked SP execution: Added support for skipping prelocking of procedure body for
  "CALL proc(...)" statements.
sql/sp.h:
  Non-prelocked SP execution: Added support for skipping prelocking of procedure body for
  "CALL proc(...)" statements.
sql/sp_cache.h:
  Added comments
sql/sp_head.cc:
  Non-prelocked SP execution:
  * Try to unlock tables after PROCEDURE arguments have been evaluated.
  * Make sp_lex_keeper be able to execute in 2 modes: A) when already in prelocked mode
    B) when its statement enters/leaves prelocked mode itself.
sql/sp_head.h:
  Non-prelocked SP execution:  Make sp_lex_keeper to additionally keep list of tables it 
  needs to prelock when its statement enters/leaves prelocked mode on its own.
sql/sql_base.cc:
  Non-prelocked SP execution: Make open_tables() to
   * detect 'CALL proc(...)' and not to do prelocking for procedure body statements.
   * Make lex->query_tables_last to point precisely to a boundary in lex->query_tables 
     list where 'own' tables and views' tables end and added-for-prelocking tables begin.
     (it was not true before - view's tables could end up after query_tables_own_last)
sql/sql_class.cc:
  Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
sql/sql_class.h:
  Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
sql/sql_lex.cc:
  Non-prelocked SP execution: More rigourous cleanup in st_lex::cleanup_after_one_table_open()
sql/sql_parse.cc:
  Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt, remove outdated comments
sql/sql_trigger.h:
  Rename: thd->transaction.in_sub_stmt -> thd->in_sub_stmt
2005-07-30 08:19:57 +00:00
unknown
5fa6e3c557 Merge mysql.com:/usr/home/bar/mysql-4.1.b10201
into  mysql.com:/usr/home/bar/mysql-5.0


mysql-test/r/func_gconcat.result:
  Auto merged
mysql-test/t/func_gconcat.test:
  Auto merged
ndb/src/mgmapi/mgmapi.cpp:
  Auto merged
ndb/src/mgmsrv/ConfigInfo.cpp:
  Auto merged
ndb/src/mgmsrv/ConfigInfo.hpp:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.h:
  Auto merged
sql/item_sum.cc:
  Auto merged
include/config-netware.h:
  auto merge fix
libmysql/libmysql.def:
  after merge fix
sql/item_func.cc:
  SCCS merged
2005-07-26 13:25:18 +05:00
unknown
8624bcfdbe func_gconcat.result, func_gconcat.test:
Adding test
item_sum.cc:
  Adding a call for collation/charset aggregation,
      to collect attributes from the arguments. The actual bug fix.
item_func.h, item_func.cc, item.h, item.cc:
  - Removing collation aggrgation functions from Item_func class
      in item.cc, and adding it as non-class functions in item.cc
      to be able to reuse this code for group_concat.
      - Adding replacement for these functions into Item_func class
      as wrappers for moved functions, to minizize patch size,


sql/item.cc:
  - Removing collation aggrgation functions from Item_func class
      in item.cc, and adding it as non-class functions in item.cc
      to be able to reuse this code for group_concat.
      - Adding replacement for these functions into Item_func class
      as wrappers for moved functions, to minizize patch size,
sql/item.h:
  - Removing collation aggrgation functions from Item_func class
      in item.cc, and adding it as non-class functions in item.cc
      to be able to reuse this code for group_concat.
      - Adding replacement for these functions into Item_func class
      as wrappers for moved functions, to minizize patch size,
sql/item_func.cc:
  - Removing collation aggrgation functions from Item_func class
      in item.cc, and adding it as non-class functions in item.cc
      to be able to reuse this code for group_concat.
      - Adding replacement for these functions into Item_func class
      as wrappers for moved functions, to minizize patch size,
sql/item_func.h:
  - Removing collation aggrgation functions from Item_func class
      in item.cc, and adding it as non-class functions in item.cc
      to be able to reuse this code for group_concat.
      - Adding replacement for these functions into Item_func class
      as wrappers for moved functions, to minizize patch size,
sql/item_sum.cc:
  Adding a call for collation/charset aggregation,
      to collect attributes from the arguments. The actual bug fix.
mysql-test/t/func_gconcat.test:
  Adding test
mysql-test/r/func_gconcat.result:
  Adding test
2005-07-26 12:52:02 +05:00
unknown
f8a6e9d369 Don't force column header to @@session.var_name if @@local.var_name
was used. (Bug #10724)


mysql-test/r/key_cache.result:
  Updated results
mysql-test/r/ps_1general.result:
  Updated results
mysql-test/r/user_var.result:
  Add new results
mysql-test/r/variables.result:
  Update results
mysql-test/t/user_var.test:
  Add new regression test
sql/item_func.cc:
  Don't set name explicitly in get_system_var(), let it get set by the
  select_item: rule in sql_parse.yy or other callers of get_system_var().
sql/sql_parse.cc:
  Set the name on the Item returned by get_system_var().
2005-07-25 11:25:28 -07:00
unknown
e9c64ae296 Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into  mysql.com:/home/jimw/my/mysql-5.0-clean


extra/perror.c:
  Auto merged
include/my_global.h:
  Auto merged
mysql-test/r/ps_1general.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_6bdb.result:
  Auto merged
mysql-test/r/ps_7ndb.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
ndb/src/mgmsrv/ConfigInfo.cpp:
  Auto merged
ndb/src/mgmsrv/main.cpp:
  Auto merged
sql/des_key_file.cc:
  Auto merged
sql/field_conv.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_strfunc.cc:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
tests/mysql_client_test.c:
  Auto merged
mysql-test/t/select.test:
  Resolve conflicts
scripts/mysqld_safe.sh:
  Resolve conflict
sql/item.cc:
  Resolve conflict, don't return FIELD_TYPE_BLOB since VARCHAR
  can be longer in 5.0 than 4.1.
sql/log_event.cc:
  Resolve conflict
sql/mysql_priv.h:
  Resolve conflict
sql/mysqld.cc:
  Remove incorrect fix (merge from 4.1)
sql/sql_show.cc:
  Resolve conflict
2005-07-19 11:05:49 -07:00
unknown
3a31f7b91f Simple fixes during review of new code
include/my_global.h:
  Added floatget() to read unaligned flaot
mysql-test/r/select.result:
  Added test for found_rows()
mysql-test/t/select.test:
  Added test for found_rows()
sql/des_key_file.cc:
  Moved initalization of LOCK_des_key_file to mysqld to make simpler code and avoid theoretical race condition
sql/field_conv.cc:
  Added optimizzed varsion of do_cut_string (for simple character sets)
sql/item_func.cc:
  Simplify code (and ensure DBUG_ENTER is excuted before main code)
sql/item_strfunc.cc:
  Safe calculation of max_length
  This was needed as max_length can now be 1<<32-1 (after konstantins recent patch to fix BLOB_LENGTH)
  Remove init_des_key_file() as this is not initialized in mysqld.cc
sql/item_timefunc.cc:
  Safe calculation of max_length
  This was needed as max_length can now be 1<<32-1 (after konstantins recent patch to fix BLOB_LENGTH)
sql/log_event.cc:
  Simplify code
sql/mysql_priv.h:
  Moved initalization of LOCK_des_key_file to mysqld to make simpler code and avoid theoretical race condition
sql/mysqld.cc:
  Moved initalization of LOCK_des_key_file to mysqld to make simpler code and avoid theoretical race condition
  Revert wrong patch of calling close_connection() in first close_connections() loop. (Bug #7403)
  Instead we now print a warning for closed connections only if mysqld is sarted with --warnings
  Added comments to make the close_connections() logic clearer
sql/sql_prepare.cc:
  Use floatget() and doubleget() to protect against unaligned data
sql/sql_select.cc:
  Fixed some cases unlikely cases where found_rows() would return wrong for queries that would return 0 or 1 rows
2005-07-19 19:25:05 +03:00
unknown
7bdc4dd0a1 After-merge fixes (4.1 -> 5.0).
mysql-test/r/sp.result:
  Test results fixed: rewritten test for Bug#6129
mysql-test/r/view.result:
  Push a change to the result file from Sanja's patch.
mysql-test/t/sp.test:
  Rewrite the test for Bug#6129 (now that stored procedures don't
  evaluate system variables at parse, the test produced different results).
  The old test failed with 1 in the second invocation (the old
  result was wrong).
sql/item_func.cc:
  After-merge fix.
sql/item_func.h:
  After-merge fix.
sql/mysql_priv.h:
  After-merge fix.
sql/mysqld.cc:
  Rollback the patch for Bug#7403 (it breaks the test suite).
2005-07-16 16:10:42 +04:00
unknown
40efb3622d Merge mysql.com:/opt/local/work/mysql-4.1-root
into  mysql.com:/media/sda1/mysql/mysql-5.0-merge


mysql-test/r/select.result:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
mysql-test/r/ps.result:
  Manual merge (again).
mysql-test/t/ps.test:
  Manual merge (again).
mysql-test/t/select.test:
  Manual merge (again).
sql/item_func.cc:
  Manual merge (again).
sql/item_func.h:
  Manual merge (again).
sql/set_var.h:
  Manual merge (again).
2005-07-16 13:45:32 +04:00
unknown
e83e105331 A fix and a test case for Bug#9359 "Prepared statements take snapshot
of system vars at PREPARE time": implement a special Item
to handle system variables. This item substitutes itself with 
a basic constant containing variable value at fix_fields.


mysql-test/r/ps.result:
  - test results fixed (Bug#9359).
mysql-test/t/ps.test:
  - add a test case for Bug#9359 "Prepared statements take snapshot
   of system vars at PREPARE time"
sql/item_func.cc:
  - implement Item_func_get_system_var: we should not evaluate system
  variables in the parser, but instead should create an item which 
  is evaluated to a constant at execute.
  - remove an unused function
sql/item_func.h:
  Add a new item, Item_func_get_system_var
sql/mysql_priv.h:
  Move necessary declarations to make set_var.h objects visible in 
  item_func.h
sql/set_var.cc:
  - we should not print to network from get_system_var: if it's called
  from prepared statement prepare, we get packets out of order when using
  the binary protocol. Instead report the error to be sent to the user later.
  This is a backport from 5.0.
sql/set_var.h:
  - declaration of enum_var_type moved to mysql_priv.h
2005-07-16 03:29:13 +04:00
unknown
53bb8fa6c3 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/media/sda1/mysql/mysql-5.0-10760-new


sql/item_func.cc:
  Auto merged
2005-07-14 20:02:36 +04:00
unknown
5858a8cd42 Merge mysql.com:/opt/local/work/mysql-4.1-root
into  mysql.com:/opt/local/work/mysql-5.0-root


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_6bdb.result:
  Auto merged
mysql-test/r/ps_7ndb.result:
  Auto merged
sql/field.cc:
  manual merge
tests/mysql_client_test.c:
  manual merge
mysql-test/r/select.result:
  manual merge
mysql-test/t/select.test:
  manual merge
sql/sql_select.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
2005-07-14 20:02:32 +04:00
unknown
96dcb8c20d Merge mysql.com:/home/psergey/mysql-4.1-build-tree
into mysql.com:/home/psergey/mysql-4.1-merge-from-build


sql/item_func.cc:
  Auto merged
2005-07-14 16:02:30 +00:00
unknown
e4f2bd469f Get rid of checking for ETIME return value of pthread_cond_timedwait.
ETIME was returned by cond_timedwait (sic, the pre-POSIX1001b function) on 
Solaris 2.6 and 2.7. pthread_cond_timedwait on Solaris returns ETIMEDOUT.
The standard requirement is that the only additional return value
of pthred_cond_timedwait compared to pthread_cond_wait is ETIMEDOUT.
Let us not bloat the application code with redundant checks,
and if we're ever to work on a platform that returns a non-standard 
value, we should write a wrapper for that platform (like we do, e.g., for
Windows).


mysys/my_os2cond.c:
  - fix our implementation of pthread_cond_timedwait on OS2 to return
    ETIMEDOUT instead of ETIME.
sql/item_func.cc:
  - don't check for ETIME
sql/slave.cc:
  - don't check for ETIME
sql/sql_insert.cc:
  - don't check for ETIME
2005-07-14 19:42:56 +04:00
unknown
c0bcf503f5 Fix for BUG#11869: In Item_func_match::fix_index() handle the case when there is no
source table present (this happens for ORDER BY after UNION)


mysql-test/r/fulltext_order_by.result:
  Testcase for BUG#11869
mysql-test/t/fulltext_order_by.test:
  Testcase for BUG#11869
2005-07-14 15:19:26 +00:00
unknown
061406ba21 Merge mysql.com:/opt/local/work/mysql-4.1-9379
into  mysql.com:/opt/local/work/mysql-5.0-root


sql/item.cc:
  Auto merged
mysql-test/r/ps.result:
  Manual merge.
mysql-test/t/ps.test:
  Manual merge.
sql/item_func.cc:
  Manual merge.
2005-07-13 23:49:45 +04:00
unknown
98248f046f A fix and a test case for Bug#9379 (collation of a parameter marker is
binary).


mysql-test/r/ps.result:
  Test results fixed (Bug#9379)
mysql-test/t/ps.test:
  A test case for Bug#9379 (collation of a parameter marker is binary)
sql/item.cc:
  - set Item_param::collation to str_value collation, if Item_param
  is assigned a string. Reset it to default in Item_param::reset() (on 
  the next execution it can be assigned a number).
sql/item_func.cc:
  - now that item collation can change between executions
  (if this item is Item_param), we need to register the change
  of the execution tree in the rollback list.
2005-07-13 23:43:46 +04:00
unknown
eef5f17bde Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-bg8406


mysql-test/r/sp.result:
  Auto merged
mysql-test/r/trigger.result:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
mysql-test/t/trigger.test:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_trigger.cc:
  Auto merged
mysql-test/r/sp-error.result:
  Manual merge.
mysql-test/t/sp-error.test:
  Manual merge.
sql/sp_head.cc:
  Manual merge.
sql/sql_yacc.yy:
  Manual merge.
2005-07-09 22:04:18 +04:00
unknown
14b1f91ba4 Enable support of access to tables from triggers. Thus fix bug #8406 "Triggers
crash if referencing a table" and several other related bugs.
Fix for bug #11834 "Re-execution of prepared statement with dropped function
crashes server." which was spotted during work on previous bugs.

Also couple of nice cleanups:
- Replaced two separate hashes for stored routines used by statement with one.
- Now instead of doing one pass through all routines used in statement for
  caching them and then doing another pass for adding their tables to table
  list, we do only one pass during which do both things.


mysql-test/r/sp-error.result:
  Added test for bug #11834 "Re-execution of prepared statement with dropped
  function crashes server" also covering handling of prepared statements
  which use stored functions but does not require prelocking.
mysql-test/r/sp.result:
  Updated test for LOCK TABLES with views in table list.
  (Old version of statement used in this test will work ok now, since prelocking
   algorithm was tuned and will lock only one multi-set of tables for each routine
   even if this routine is used in several different views).
mysql-test/r/trigger.result:
  Added several tests for triggers using tables.
mysql-test/t/sp-error.test:
  Added test for bug #11834 "Re-execution of prepared statement with dropped
  function crashes server" also covering handling of prepared statements
  which use stored functions but does not require prelocking.
mysql-test/t/sp.test:
  Updated comment about recursive views to reflect current situation.
  Updated test for LOCK TABLES with views in table list.
  (Old version of statement used in this test will work ok now, since prelocking
   algorithm was tuned and will lock only one multi-set of tables for each routine
   even if this routine is used in several different views).
mysql-test/t/trigger.test:
  Added several tests for triggers using tables.
sql/item_func.cc:
  Item_func_sp::cleanup():
    By next statement execution stored function can be dropped or altered so
    we can't assume that sp_head object for it will be still valid.
sql/sp.cc:
  - Added Sroutine_hash_entry structure that represents element in the set of
    stored routines used by statement or routine. We can't as before use
    LEX_STRING for this purprose because we want link all elements of this set
    in list.
  - Replaced sp_add_to_hash() with sp_add_used_routine() which takes into account
    that now we use one hash for stored routines used by statement instead of two
    and which mantains list linking all elelemnts in this hash.
  - Renamed sp_merge_hash() to sp_update_sp_used_routines().
  - Introduced sp_update_stmt_used_routines() for adding elements to the set of
    routines used by statement from another similar set for statement or routine.
    This function will also mantain list linking elements of destination set.
  - Now instead of one sp_cache_routines() function we have family of 
    sp_cache_routines_and_add_tables() functions which are also responsible for
    adding tables used by routines being cached to statement table list. Nice
    optimization - thanks to list linking all elements in the hash of routines
    used by statement we don't need to perform several iterations over this hash
    (as it was before in cases when we have added new elements to it).
sql/sp.h:
  Added declarations of functions used for manipulations with set (hash) of stored
  routines used by statement.
sql/sp_head.cc:
  sp_name::init_qname():
    Now sp_name also holds key identifying routine in the set (hash) of
    stored routines used by statement. 
  sp_head:
    Instead of two separate hashes sp_funs/m_spprocs representing sets of stored
    routines used by this routine we use one hash - m_sroutines. 
  sp_instr_set_trigger_field:
    Added support for subqueries in assignments to row accessors in triggers.
  Removed definition of sp_add_sp_tables_to_table_list() and auxilary functions 
  since now we don't have separate stage on which we add tables used by routines
  used by statement to table list for prelocking. We do it on the same stage as
  we load those routines in SP cache. So all this functionality moved to
  sp_cache_routines_and_add_tables() family of functions.
sql/sp_head.h:
  sp_name:
    Now this class also holds key identifying routine in the set (hash) of stored
    routines used by statement. 
  sp_head:
    Instead of two separate hashes sp_funs/m_spprocs representing sets of stored
    routines used by this routine we use one hash - m_sroutines. 
  sp_instr_set_trigger_field:
    Added support for subqueries in assignments to row accessors in triggers.
  Removed declaration of sp_add_sp_tables_to_table_list() since now we don't have
  separate stage on which we add tables used by routines used by statement to
  table list for prelocking. We do it on the same stage as we load those routines
  in SP cache.
sql/sql_base.cc:
  open_tables():
  - LEX::spfuns/spprocs hashes were replaced with one LEX::sroutines hash.
  - Now instead of doing one pass through all routines used in statement for
    caching them and then doing another pass for adding their tables to table
    list, we do only one pass during which do both things. It is easy to do
    since all routines in the set of routines used by statement are linked in
    the list. This also allows us to calculate table list for prelocking more
    precisely.
  - Now triggers properly inform prelocking algorithm about tables they use.
sql/sql_lex.cc:
  lex_start():
    Replaced LEX::spfuns/spprocs with with one LEX::sroutines hash.
    Added LEX::sroutines_list list linking all elements in this hash.
  st_lex::st_lex():
    Moved definition of LEX constructor to sql_lex.cc file to be able
    use sp_sroutine_key declaration from sp.h in it.
sql/sql_lex.h:
  LEX:
    Replaced two separate hashes for stored routines used by statement with one.
    Added list linking all elements in this hash to be able to iterate through all
    elements and add new elements to this hash at the same time.
    Moved constructor definition to sql_lex.cc.
sql/sql_parse.cc:
  mysql_execute_command():
    Replaced LEX::spfuns/spprocs with one LEX::sroutines hash.
sql/sql_trigger.cc:
  Added missing GNU GPL notice.
  Table_triggers_list::check_n_load()
    Added initialization of sroutines_key which stores key representing
    triggers of this table in the set (hash) of routines used by this statement.
sql/sql_trigger.h:
  Added missing GNU GPL notice.
  Table_triggers_list:
    Added sroutines_key member to store key representing triggers of this
    table in the set (hash) of routines used by this statement.
    Declared sp_cache_routines_and_add_tables_for_triggers() as friend since
    it needs access to sroutines_key and trigger bodies.
sql/sql_yacc.yy:
  - Now we use sp_add_used_routine() instead of sp_add_to_hash() for adding
    elements to the set of stored routines used in statement.
  - Enabled support of subqueries as right sides in assignments to triggers' row
    accessors.
2005-07-09 21:51:59 +04:00
unknown
d98461719e Fix for bug #11708 (real function returns wrongly rounded decimal)
mysql-test/r/type_newdecimal.result:
  test result fixed
mysql-test/t/type_newdecimal.test:
  test case added
sql/item_func.cc:
  Item_real_func::val_decimal implemented
sql/item_func.h:
  Item_real_func::val_decimal declared
2005-07-07 20:28:47 +05:00
unknown
3c82f72091 manual merge
sql/field.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/mysqld.cc:
  Auto merged
sql/opt_range.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
strings/ctype-utf8.c:
  Auto merged
2005-07-04 03:50:04 +03:00
unknown
306ebf7b1c Fixes during review of new code
- Mostly indentation fixes
- Added missing test
- Ensure that Item_func_case() checks for stack overruns
- Use real_item() instead of (Item_ref*) item
- Fixed wrong error handling


myisam/mi_unique.c:
  Improved comments
myisam/myisampack.c:
  Updated version number
mysql-test/r/group_by.result:
  Added test that was lost during earlier merge
mysql-test/r/information_schema.result:
  Safety fix: Drop procedures before used
mysql-test/t/group_by.test:
  Added test that was lost during earlier merge
mysql-test/t/information_schema.test:
  Safety fix: Drop procedures before used
mysys/hash.c:
  Updated comment
sql/field.cc:
  false -> FALSE
sql/ha_ndbcluster.cc:
  Fix some style issues
  - No () around argument to 'case'
  - Space before ( in switch and if
  - Removed 'goto'
  - Added {}
  - Added () to make expressions easier to read
  - my_snprintf -> strmov
sql/handler.cc:
  if( -> if (
sql/item.cc:
  Indentation changes
sql/item.h:
  false -> FALSE
sql/item_cmpfunc.cc:
  Ensure that Item_func_case() check for stack overrun properly
sql/item_cmpfunc.h:
  Ensure that Item_func_case() check for stack overrun properly
sql/item_func.cc:
  Indentation fixes
  Fixed wrong goto label
sql/mysqld.cc:
  Remove test for opt_disable_networking as this flag can never be set here
sql/opt_range.cc:
  Simplify code
sql/sql_class.h:
  Move define out from middle of class definition
sql/sql_parse.cc:
  Remove extra empty lines
sql/sql_select.cc:
  use real_item() instead of (Item_ref*) item
  Modifed function comment to be align with others
  Simple optimization
sql/sql_union.cc:
  Portability fix:
  Don't use 'bool_variable|=...'
sql/sql_view.cc:
  Move List_iterator_fast out from loops (rewind is faster than creating a new itearator)
strings/ctype-utf8.c:
  if( -> if (
strings/ctype.c:
  Remove disabled code
strings/decimal.c:
  Indentation fixes
strings/xml.c:
  Indentation fixes
2005-07-04 03:42:33 +03:00
unknown
b4f595b95f Name resolution context added (BUG#6443)
include/my_bitmap.h:
  new bitmap operation
mysql-test/r/view.result:
  added warnings
  Correct inserting data check (absence of default value) for view underlying tables (BUG#6443)
mysql-test/t/view.test:
  Correct inserting data check (absence of default value) for view underlying tables (BUG#6443)
mysys/my_bitmap.c:
  new bitmap operation
sql/field.h:
  index of field in table added
sql/item.cc:
  Name resolution context added
  table list removed from fix_fields() arguments
sql/item.h:
  Name resolution context added
  table list removed from fix_fields() arguments
sql/item_cmpfunc.cc:
  table list removed from fix_fields() arguments
sql/item_cmpfunc.h:
  table list removed from fix_fields() arguments
sql/item_func.cc:
  table list removed from fix_fields() arguments
sql/item_func.h:
  table list removed from fix_fields() arguments
sql/item_row.cc:
  table list removed from fix_fields() arguments
sql/item_row.h:
  table list removed from fix_fields() arguments
sql/item_strfunc.cc:
  fixed server crash on NULL argument
sql/item_strfunc.h:
  table list removed from fix_fields() arguments
sql/item_subselect.cc:
  table list removed from fix_fields() arguments
sql/item_subselect.h:
  table list removed from fix_fields() arguments
sql/item_sum.cc:
  table list removed from fix_fields() arguments
sql/item_sum.h:
  table list removed from fix_fields() arguments
sql/item_timefunc.cc:
  table list removed from fix_fields() arguments
sql/item_timefunc.h:
  table list removed from fix_fields() arguments
sql/item_uniq.h:
  table list removed from fix_fields() arguments
sql/log_event.cc:
  Name resolution context added
sql/log_event.h:
  Name resolution context added
sql/mysql_priv.h:
  Name resolution context added
sql/set_var.cc:
  table list removed from fix_fields() arguments
sql/share/errmsg.txt:
  new error message
sql/sp.cc:
  Name resolution context added
sql/sp_head.cc:
  table list removed from fix_fields() arguments
sql/sp_head.h:
  Name resolution context added
sql/sql_base.cc:
  table list removed from fix_fields() arguments
  Name resolution context added
sql/sql_class.cc:
  renamed variable
sql/sql_delete.cc:
  Name resolution context added
sql/sql_derived.cc:
  Name resolution context added
sql/sql_do.cc:
  table list removed from fix_fields() arguments
sql/sql_handler.cc:
  Name resolution context added
sql/sql_help.cc:
  Name resolution context added
sql/sql_insert.cc:
  Name resolution context added
  table list removed from fix_fields() arguments
sql/sql_lex.cc:
  Name resolution context added
sql/sql_lex.h:
  removed resolve mode (information stored into name resolution context)
sql/sql_load.cc:
  table list removed from fix_fields() arguments
sql/sql_olap.cc:
  Name resolution context added
sql/sql_parse.cc:
  Name resolution context added
sql/sql_prepare.cc:
  table list removed from fix_fields() arguments
sql/sql_select.cc:
  table list removed from fix_fields() arguments
sql/sql_show.cc:
  Name resolution context added
sql/sql_trigger.cc:
  table list removed from fix_fields() arguments
sql/sql_udf.h:
  table list removed from fix_fields() arguments
sql/sql_union.cc:
  Name resolution context added
sql/sql_update.cc:
  Name resolution context added
sql/sql_view.cc:
  Name resolution context added
sql/sql_view.h:
  table list removed from fix_fields() arguments
sql/sql_yacc.yy:
  Name resolution context added
sql/table.cc:
  Name resolution context added
  merged view processing moved
sql/table.h:
  merged view processing moved
2005-07-01 07:05:42 +03:00
unknown
2460a01b68 removed unneed line 2005-06-23 19:33:19 +03:00
unknown
a5e742fedd fixed environment restoring in case of error during SP function execution (BUG#9503)
#define macro improvement


mysql-test/r/sp-security.result:
  BUG#9503: reseting correct parameters of thread after error in SP function
mysql-test/t/sp-security.test:
  BUG#9503: reseting correct parameters of thread after error in SP function
sql/item_func.cc:
  fixed environment restoring in case of error during SP function execution
sql/protocol.cc:
  added debug print
sql/sql_class.h:
  fixed #defines to force them to be alvaise in piar, and variable name made more complex for accident repeating in other code
2005-06-23 18:29:10 +03:00
unknown
5841d70af8 Fix multiplication of abs() by a negative value. (Bug #11402)
mysql-test/r/func_math.result:
  Add new results
mysql-test/t/func_math.test:
  Add new regression test
sql/item_func.cc:
  Don't set result of abs() to unsigned. Result should still be
  a signed value, even if always positive.
2005-06-22 20:00:21 -07:00
unknown
612de7c643 fixed view fields names check and generation (changed after Trudy review: underlying field names treat as user set ones) (BUG#7448)
mysql-test/r/view.result:
  test of view field names generation
mysql-test/t/view.test:
  test of view field names generation
sql/item.cc:
  add a flag that indicates that the name of the item was an auto-generated one and so can be changed in a view
sql/item.h:
  add a flag that indicates that the name of the item was an auto-generated one and so can be changed in a view
  layout fixed
sql/item_func.cc:
  line made less then 80 columns
sql/sql_view.cc:
  fixed checking of duplicates of view fields:
  1) case-insensitive system charset/collation is used now to compare view filds
  2) in case if the duplicate field name was of an auto-generated one, we create another unique name for it
sql/sql_yacc.yy:
  add a flag that indicates that the name of the item was an auto-generated one and so can be changed in a view
2005-06-21 20:30:48 +03:00
unknown
46fa81f990 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into sanja.is.com.ua:/home/bell/mysql/bk/work-bug4-5.0


sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
2005-06-17 20:30:11 +03:00