Commit graph

626 commits

Author SHA1 Message Date
unknown
f0abfddf07 Merge bk@192.168.21.1:mysql-5.1
into  mysql.com:/d2/hf/mrg/mysql-5.1-opt


mysql-test/include/mix1.inc:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/r/ps.result:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
2007-05-18 20:04:01 +05:00
unknown
d2250317bb valgrind error fix(addon) 2007-05-17 13:27:39 +05:00
unknown
fc7ef4be71 Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  vajra.(none):/opt/local/work/mysql-5.1-runtime


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


mysql-test/r/ps.result:
  Auto merged
mysql-test/r/ps_1general.result:
  Auto merged
mysql-test/t/ps.test:
  Auto merged
mysql-test/t/ps_1general.test:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/sql_prepare.cc:
  Manual merge.
2007-05-11 17:41:07 +04:00
unknown
a0567199b1 Cleanup: now that we have Lex_input_stream, finish the transition
by moving yet another relevant flag to it from struct LEX.


mysql-test/r/ps.result:
  Update result.
mysql-test/r/ps_1general.result:
  Update result.
mysql-test/t/ps.test:
  New error code.
mysql-test/t/ps_1general.test:
  New error code.
sql/sql_lex.cc:
  Move stmt_prepare_mode to Lex_input_stream.
sql/sql_lex.h:
  Move stmt_prepare_mode to class Lex_input_stream
sql/sql_prepare.cc:
  Move stmt_prepare_mode to Lex_input_stream
sql/sql_yacc.yy:
  Remove dead code.
2007-05-11 17:26:12 +04:00
unknown
1513cd0933 Merge weblab.(none):/home/marcsql/TREE/mysql-5.1-base
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-rt-merge


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


mysql-test/t/sp.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2007-05-02 09:59:39 -06:00
unknown
d2e8f9010f fix merge issues
mysql-test/r/sp.result:
  manual merge
sql/sql_lex.cc:
  merge typo
2007-04-30 15:36:29 -06:00
unknown
2a46eda7d2 Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-runtime
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-21513


mysql-test/t/sp.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/sql_lex.cc:
  manual merge
2007-04-30 11:41:51 -06:00
unknown
87128514a4 compilation failure
sql/sql_lex.cc:
  remove bad fix
2007-04-29 09:00:08 -07:00
unknown
dfdd667a8d fix windows build failure
VC++ does not like compile_time_assert() macro
2007-04-29 08:46:34 -07:00
unknown
1700feaa02 Bug#21513 (SP having body starting with quoted label rendered unusable)
Before this fix, the parser would sometime change where a token starts by
altering Lex_input_string::tok_start, which later confused the code in
sql_yacc.yy that needs to capture the source code of a SQL statement,
like to represent the body of a stored procedure.

This line of code in sql_lex.cc :

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

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

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

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

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

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

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

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


mysql-test/r/sp.result:
  Lex_input_stream::tok_start must point at the real start of a token.
mysql-test/t/sp.test:
  Lex_input_stream::tok_start must point at the real start of a token.
sql/item.cc:
  Lex_input_stream::tok_start must point at the real start of a token.
sql/sql_lex.cc:
  Lex_input_stream::tok_start must point at the real start of a token.
sql/sql_yacc.yy:
  Lex_input_stream::tok_start must point at the real start of a token.
2007-04-27 17:14:25 -06:00
unknown
034c11f3cd manual merge 5.0-runtime -> 5.1->runtime, with 25411 part I 2007-04-25 21:38:12 -06:00
unknown
c49e378ac4 code review fix 2007-04-25 11:38:11 -06:00
unknown
6f5cacfae8 Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  weblab.(none):/home/marcsql/TREE/mysql-5.0-25411_d


sql/item_func.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/slave.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sp_head.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_view.cc:
  Auto merged
2007-04-24 09:25:54 -06:00
unknown
3eff7d4dd5 Bug#25411 (trigger code truncated), PART I
The issue found with bug 25411 is due to the function skip_rear_comments()
which damages the source code while implementing a work around.
The root cause of the problem is in the lexical analyser, which does not
process special comments properly.
For special comments like :
[1] aaa /*!50000 bbb */ ccc
since 5.0 is a version older that the current code, the parser is in lining
the content of the special comment, so that the query to process is
[2] aaa bbb ccc
However, the text of the query captured when processing a stored procedure,
stored function or trigger (or event in 5.1), can be after rebuilding it:
[3] aaa bbb */ ccc
which is wrong.

To fix bug 25411 properly, the lexical analyser needs to return [2] when
in lining special comments.
In order to implement this, some preliminary cleanup is required in the code,
which is implemented by this patch.

Before this change, the structure named LEX (or st_lex) contains attributes
that belong to lexical analysis, as well as attributes that represents the
abstract syntax tree (AST) of a statement.
Creating a new LEX structure for each statements (which makes sense for the
AST part) also re-initialized the lexical analysis phase each time, which
is conceptually wrong.

With this patch, the previous st_lex structure has been split in two:
- st_lex represents the Abstract Syntax Tree for a statement. The name "lex"
has not been changed to avoid a bigger impact in the code base.
- class lex_input_stream represents the internal state of the lexical
  analyser, which by definition should *not* be reinitialized when parsing
  multiple statements from the same input stream.

This change is a pre-requisite for bug 25411, since the implementation of
lex_input_stream will later improve to deal properly with special comments,
and this processing can not be done with the current implementation of
sp_head::reset_lex and sp_head::restore_lex, which interfere with the lexer.

This change set alone does not fix bug 25411.


sql/item_func.cc:
  Refactoring, separate lex_input_stream from st_lex.
sql/log_event.cc:
  Refactoring, separate lex_input_stream from st_lex.
sql/mysql_priv.h:
  Refactoring, separate lex_input_stream from st_lex.
sql/slave.cc:
  Refactoring, separate lex_input_stream from st_lex.
sql/sp.cc:
  Refactoring, separate lex_input_stream from st_lex.
sql/sp_head.cc:
  Refactoring, separate lex_input_stream from st_lex.
sql/sp_head.h:
  Refactoring, separate lex_input_stream from st_lex.
sql/sql_class.cc:
  Refactoring, separate lex_input_stream from st_lex.
sql/sql_class.h:
  Refactoring, separate lex_input_stream from st_lex.
sql/sql_lex.cc:
  Refactoring, separate lex_input_stream from st_lex.
sql/sql_lex.h:
  Refactoring, separate lex_input_stream from st_lex.
sql/sql_parse.cc:
  Refactoring, separate lex_input_stream from st_lex.
sql/sql_prepare.cc:
  Refactoring, separate lex_input_stream from st_lex.
sql/sql_trigger.cc:
  Refactoring, separate lex_input_stream from st_lex.
sql/sql_view.cc:
  Refactoring, separate lex_input_stream from st_lex.
sql/sql_yacc.yy:
  Refactoring, separate lex_input_stream from st_lex.
2007-04-24 09:24:21 -06:00
unknown
4c7e7e4806 Merge janus.mylan:/usr/home/serg/Abk/mysql-5.0
into  janus.mylan:/usr/home/serg/Abk/mysql-5.1-build


sql/sql_delete.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
2007-04-17 15:44:30 +02:00
unknown
5234f5adb7 reverted the fix for Bug#5507 2007-04-17 12:32:01 +02:00
unknown
7cb8a33b1a Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  sergbook.mysql.com:/usr/home/serg/Abk/mysql-5.1-wl2936


client/mysql.cc:
  Auto merged
include/my_global.h:
  Auto merged
include/my_sys.h:
  Auto merged
include/mysql.h:
  Auto merged
mysql-test/r/im_utils.result:
  Auto merged
mysql-test/r/variables.result:
  Auto merged
mysql-test/t/ndb_dd_basic.test:
  Auto merged
mysql-test/t/partition_innodb.test:
  Auto merged
mysql-test/t/variables.test:
  Auto merged
mysys/array.c:
  Auto merged
mysys/typelib.c:
  Auto merged
sql/event_queue.cc:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/ha_partition.h:
  Auto merged
sql/handler.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_sum.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/set_var.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_cache.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_partition.cc:
  Auto merged
sql/sql_plugin.cc:
  Auto merged
sql/sql_repl.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
storage/example/ha_example.cc:
  Auto merged
storage/federated/ha_federated.cc:
  Auto merged
storage/heap/ha_heap.cc:
  Auto merged
storage/innobase/include/trx0trx.h:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisammrg/ha_myisammrg.cc:
  Auto merged
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
  Auto merged
include/typelib.h:
  merged
mysql-test/mysql-test-run.pl:
  merged
mysql-test/r/flush2.result:
  merged
mysql-test/r/ndb_dd_basic.result:
  merged
mysql-test/r/partition_innodb.result:
  merged
mysql-test/r/ps_1general.result:
  merged
mysql-test/t/ps_1general.test:
  merged
sql/ha_ndbcluster.cc:
  merged
sql/item_create.cc:
  merged
sql/mysqld.cc:
  merged
sql/rpl_utility.h:
  merged
sql/set_var.cc:
  merged
sql/sql_class.cc:
  merged
sql/sql_yacc.yy:
  merged
storage/innobase/handler/ha_innodb.cc:
  merged
storage/innobase/handler/ha_innodb.h:
  merged
2007-04-16 10:37:50 +02:00
unknown
5eb40d9176 Merge bk-internal.mysql.com:/data0/bk/mysql-5.0-opt
into  bk-internal.mysql.com:/data0/bk/mysql-5.1-opt


mysql-test/r/view.result:
  Auto merged
mysql-test/t/view.test:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
2007-04-13 23:32:23 +02:00
unknown
0b54001b21 Bug#5507: TRUNCATE does not work with views.
Support of views wasn't implemented for the TRUNCATE statement.
Now TRUNCATE on views has the same semantics as DELETE FROM view:
mysql_truncate() checks whether the table is a view and falls back
to delete if so.
In order to initialize properly the LEX::updatable for a view
st_lex::can_use_merged() now allows usage of merged views for the
TRUNCATE statement.


mysql-test/r/truncate.result:
  Added a test case for the Bug#5507: TRUNCATE does not work with views.
mysql-test/t/truncate.test:
  Added a test case for the Bug#5507: TRUNCATE does not work with views.
sql/sql_lex.cc:
  Bug#5507: TRUNCATE does not work with views.
  can_use_merged() was denying of usage of merged views for a
  TRUNCATE statement. This results in improper initialization
  of view LEX::updatable. Fixed.
sql/sql_delete.cc:
  Bug#5507: TRUNCATE does not work with views.
  1.mysql_truncate() was lacking of check whether the table is view. Added.
  2.mysql_truncate() calls mysql_delete(), but mysql_delete() always reports
  errors as "DELETE" errors. Fixed.
mysql-test/t/view.test:
  Updated test case for Bug#14540: OPTIMIZE, ANALYZE, REPAIR applied 
  to not a view.
mysql-test/r/view.result:
  Updated test case for Bug#14540: OPTIMIZE, ANALYZE, REPAIR applied 
  to not a view.
2007-04-12 23:21:37 +05:00
unknown
f5940fe904 Remove unnecessary casts to uchar. The casts are stemming from
the lexer API which internally uses  unsigned char variables to
address its state map. The implementation of the lexer should be
internal to the lexer, and not influence the rest of the code.


sql/event_data_objects.cc:
  Clean up unnecessary type casts.
sql/event_data_objects.h:
  Clean up unnecessary type casts.
sql/ha_ndbcluster.cc:
  Clean up unnecessary type casts.
sql/mysql_priv.h:
  Clean up unnecessary type casts.
sql/partition_info.h:
  Clean up unnecessary type casts.
sql/sp.cc:
  Clean up unnecessary type casts.
sql/sp_head.cc:
  Clean up unnecessary type casts.
sql/sp_head.h:
  Clean up unnecessary type casts.
sql/sql_lex.cc:
  Clean up unnecessary type casts.
sql/sql_lex.h:
  Clean up unnecessary type casts.
sql/sql_parse.cc:
  Clean up unnecessary type casts.
sql/sql_partition.cc:
  Clean up unnecessary type casts.
sql/sql_partition.h:
  Clean up unnecessary type casts.
sql/sql_prepare.cc:
  Clean up unnecessary type casts.
sql/sql_trigger.cc:
  Clean up unnecessary type casts.
sql/sql_view.cc:
  Clean up unnecessary type casts.
sql/sql_yacc.yy:
  Clean up unnecessary type casts.
sql/table.cc:
  Clean up unnecessary type casts.
sql/table.h:
  Clean up unnecessary type casts.
2007-03-27 21:09:56 +04:00
unknown
eac12b6587 WL#2936
"Server variables for plugins"
  Post review fixes.


client/mysql.cc:
  wl2936 "Plugin server variables" post review fixes
  compile fix. app_type is now a void* and it isn't actually used here.
include/my_getopt.h:
  wl2936 "Plugin server variables" post review fixes
  make app_type into a void*. This also required changes to 
  client/mysql.cc and storage/ndb/src/mgmsrv/InitConfigFileParser.cpp
  in order to compile.
include/my_global.h:
  wl2936 "Plugin server variables" post-review fixes
  declare compile_time_assert() macro.
  (provided by serg)
include/mysql/plugin.h:
  wl2936 "Plugin server variables" post review fixes
  Add comments
mysys/array.c:
  wl2936 "Plugin server variables" post review fixes
mysys/typelib.c:
  wl2936 "Plugin server variables" post review fixes
  find_typeset() should not alter string
sql/set_var.cc:
  wl2936 "Plugin server variables" post review fixes
  remove unnecessary code.
sql/sql_class.cc:
  wl2936 "Plugin server variables" post review fixes
  explicitly declare export style for functions.
sql/sql_lex.cc:
  wl2936 "Plugin server variables" post review fixes
  enforce that lex::plugins_static_buffer is declared immediately after
  lex::plugins.
sql/sql_plugin.cc:
  wl2936 "Plugin Server variables" post review fixes
    sys_var_pluginvar does not need st_plugin_int at construction.
    remove debug code which was accidentially committed.
    add comments.
    fix mutex lock order.
sql/sql_plugin.h:
  wl2936 "Plugin server variables" post review fixes
  add comment and macro to compare plugin_refs
sql/table.cc:
  wl2936 "plugin server variables" post review fixes
  remove unneccessary unlock and variable.
  add checks for legacy type validity
storage/ndb/src/mgmsrv/InitConfigFileParser.cpp:
  wl2936 "plugin server variables" post review fixes
  fix compile failure now that my_option::app_type is a void*
2007-03-23 10:14:46 -07:00
unknown
e9bb08ac0c Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  bodhi.local:/opt/local/work/mysql-5.1-runtime


include/my_global.h:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/events_scheduling.result:
  Auto merged
BitKeeper/deleted/.del-init_db.sql~a77d572c39d5a1f8:
  Auto merged
BitKeeper/deleted/.del-mysql_create_system_tables.sh:
  Auto merged
mysql-test/r/query_cache.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/events_scheduling.test:
  Auto merged
mysql-test/t/grant_cache.test:
  Auto merged
mysql-test/t/query_cache.test:
  Auto merged
mysql-test/t/view.test:
  Auto merged
scripts/mysql_system_tables_fix.sql:
  Auto merged
sql/event_db_repository.cc:
  Auto merged
sql/event_queue.cc:
  Auto merged
sql/field.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/handler.h:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sp_head.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_help.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_table.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
sql/share/errmsg.txt:
  Auto merged
sql/tztime.cc:
  Auto merged
storage/innobase/handler/ha_innodb.cc:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
storage/myisam/ha_myisam.h:
  Auto merged
mysql-test/r/skip_grants.result:
  Manualmerge.
mysql-test/r/sp.result:
  Manualmerge.
mysql-test/t/skip_grants.test:
  Manualmerge.
mysql-test/t/sp.test:
  Manualmerge.
sql/event_data_objects.cc:
  Manualmerge.
2007-03-20 00:42:11 +03:00
unknown
8555b8d7ab Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/WL3527-5.1-opt


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


mysql-test/r/sp-error.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
sql/item_timefunc.cc:
  Auto merged
sql/lock.cc:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sp.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_help.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql/tztime.cc:
  Auto merged
storage/myisam/ha_myisam.cc:
  Auto merged
sql/sql_yacc.yy:
  SCCS merged
2007-03-09 13:17:46 +03:00
unknown
0ea47f3ed4 BUG#9953: CONVERT_TZ requires mysql.time_zone_name to be locked
The problem was that some facilities (like CONVERT_TZ() function or
server HELP statement) may require implicit access to some tables in
'mysql' database.  This access was done by ordinary means of adding
such tables to the list of tables the query is going to open.
However, if we issued LOCK TABLES before that, we would get "table
was not locked" error trying to open such implicit tables.

The solution is to treat certain tables as MySQL system tables, like
we already do for mysql.proc.  Such tables may be opened for reading
at any moment regardless of any locks in effect.  The cost of this is
that system table may be locked for writing only together with other
system tables, it is disallowed to lock system tables for writing and
have any other lock on any other table.

After this patch the following tables are treated as MySQL system
tables:
  mysql.help_category
  mysql.help_keyword
  mysql.help_relation
  mysql.help_topic
  mysql.proc (it already was)
  mysql.time_zone
  mysql.time_zone_leap_second
  mysql.time_zone_name
  mysql.time_zone_transition
  mysql.time_zone_transition_type

These tables are now opened with open_system_tables_for_read() and
closed with close_system_tables(), or one table may be opened with
open_system_table_for_update() and closed with close_thread_tables()
(the latter is used for mysql.proc table, which is updated as part of
normal MySQL server operation).  These functions may be used when
some tables were opened and locked already.

NOTE: online update of time zone tables is not possible during
replication, because there's no time zone cache flush neither on LOCK
TABLES, nor on FLUSH TABLES, so the master may serve stale time zone
data from cache, while on slave updated data will be loaded from the
time zone tables.


mysql-test/r/help.result:
  Update result.
mysql-test/r/lock.result:
  Update result.
mysql-test/r/sp-error.result:
  Update result.
mysql-test/r/timezone2.result:
  Add result for bug#9953: CONVERT_TZ requires mysql.time_zone_name
  to be locked.
mysql-test/r/view.result:
  Update result: use table t3 rather than utilize MySQL system table.
mysql-test/t/help.test:
  Test that we can use HELP even under LOCK TABLES.
mysql-test/t/lock.test:
  Test LOCK TABLE on system tables.
mysql-test/t/timezone2.test:
  Add test case for bug#9953: CONVERT_TZ requires mysql.time_zone_name
  to be locked.
mysql-test/t/view.test:
  Update test: use table t3 rather that utilize MySQL system table.
sql/handler.h:
  Fix comment for 'count' parameter of check_if_locking_is_allowed().
  Add 'current' and 'system_count' parameters.
sql/item_create.cc:
  We no longer have LEX::add_time_zone_tables_to_query_tables().
sql/item_timefunc.cc:
  We no longer have LEX::time_zone_tables_used, so
  Item_func_convert_tz::fix_fields() became the same as base
  Item_date_func::fix_fields().
  
  my_tz_find() no longer takes table list, but takes THD pointer now.
sql/item_timefunc.h:
  Remove dead field and method.
sql/lock.cc:
  Pass values for 'current' and 'system_count' to
  check_if_locking_is_allowed().
sql/log_event.cc:
  We no longer have my_tz_find_with_opening_tz_tables(), its functions is
  performed by my_tz_find().
sql/mysql_priv.h:
  Add functions to work with MySQL system tables.
sql/set_var.cc:
  my_tz_find() no longer takes table list, but takes THD pointer now.
sql/sp.cc:
  Remove close_proc_table().  Use close_system_tables() instead.
  
  Use open_system_tables_for_read() and open_system_table_for_update().
sql/sp.h:
  Remove close_proc_table() declaration.
sql/sql_base.cc:
  Add implementation of open_system_tables_for_read(),
  close_system_tables(), open_system_table_for_update().
sql/sql_help.cc:
  Operate on MySQL system tables mysql.help_* with
  open_system_tables_for_read() and close_system_tables() to allow the
  usage of HELP statement under LOCK TABLES.
sql/sql_lex.cc:
  Remove LEX::time_zone_tables_used and
  LEX::add_time_zone_tables_to_query_tables() which are no longer used.
sql/sql_lex.h:
  Remove LEX::time_zone_tables_used and
  LEX::add_time_zone_tables_to_query_tables() which are no longer used.
sql/sql_parse.cc:
  Remove references to LEX::time_zone_tables_used and
  my_tz_check_n_skip_implicit_tables() which are no longer used.
sql/sql_show.cc:
  Use close_system_tables() instead of removed close_proc_table().
sql/sql_view.cc:
  LEX::time_zone_tables_used is no longer there.
sql/sql_yacc.yy:
  LEX::add_time_zone_tables_to_query_tables() is no longer there.
sql/table.cc:
  Add more tables that should be treated as MySQL system tables.
sql/share/errmsg.txt:
  Change the error message, as now we allow write-locking of several
  system tables if not mixed with ordinary tables.
sql/tztime.cc:
  Do not add time zone tables to the list of query tables in
  tz_init_table_list().
  
  Remove fake_time_zone_tables_list and my_tz_get_tables_list().
  
  In my_tz_init(), open mysql.time_zone_leap_second with
  simple_open_n_lock_tables(), but pass time zone name to my_tz_find(),
  which will open and close time zone tables as necessary.
  
  In tz_load_from_open_tables() do not call table->use_all_columns(), as
  this was already done in open_system_tables_for_read().
  
  my_tz_find() takes THD pointer instead of table list, and calls
  open_system_tables_for_read() and close_system_tables() as necessary.
  
  Remove my_tz_find_with_opening_tz_tables().
sql/tztime.h:
  Remove declarations of my_tz_get_table_list(),
  my_tz_find_with_opening_tz_tables(), fake_time_zone_tables_list,
  definition of my_tz_check_n_skip_implicit_tables().
  Update prototype for my_tz_find().
storage/csv/ha_tina.cc:
  Add new parameters to check_if_locking_is_allowed().
storage/csv/ha_tina.h:
  Add new parameters to check_if_locking_is_allowed().
storage/myisam/ha_myisam.cc:
  Add new parameters to check_if_locking_is_allowed().  In this
  function we count system tables.  If there are system tables, but
  there are also non-system tables, we report an error.
storage/myisam/ha_myisam.h:
  Add new parameters to check_if_locking_is_allowed().
2007-03-09 13:12:31 +03:00
unknown
3d52be1584 Merge bk@192.168.21.1:mysql-5.1
into  mysql.com:/home/hf/work/mrg/mysql-5.1-opt


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


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


BUILD/check-cpu:
  Auto merged
mysql-test/r/explain.result:
  Auto merged
mysql-test/r/func_str.result:
  Auto merged
mysql-test/r/func_test.result:
  Auto merged
mysql-test/r/subselect.result:
  Auto merged
mysql-test/r/update.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/explain.test:
  Auto merged
mysql-test/t/func_str.test:
  Auto merged
mysql-test/t/sp.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/item_strfunc.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_load.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_select.h:
  Auto merged
sql/sql_update.cc:
  Auto merged
mysql-test/r/func_in.result:
  SCCS merged
mysql-test/r/order_by.result:
  SCCS merged
mysql-test/r/sp.result:
  merging
mysql-test/t/func_in.test:
  SCCS merged
mysql-test/t/order_by.test:
  SCCS merged
mysql-test/t/view.test:
  merging
sql/item_cmpfunc.h:
  merging
sql/mysql_priv.h:
  merging
sql/sql_select.cc:
  SCCS merged
2007-03-08 19:08:28 +04:00
unknown
6f18c39265 Merge moonbone.local:/mnt/gentoo64/work/22331-bug-5.0-opt-mysql
into  moonbone.local:/mnt/gentoo64/work/25373-bug-5.0-opt-mysql


mysql-test/r/subselect.result:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_lex.cc:
  SCCS merged
2007-03-07 22:22:19 +03:00
unknown
6de277910b Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
away.

During optimization stage the WHERE conditions can be changed or even
be removed at all if they know for sure to be true of false. Thus they aren't
showed in the EXPLAIN EXTENDED which prints conditions after optimization.

Now if all elements of an Item_cond were removed this Item_cond is substituted
for an Item_int with the int value of the Item_cond.
If there were conditions that were totally optimized away then values of the
saved cond_value and having_value will be printed instead.


mysql-test/t/explain.test:
  Added a test case for the bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away.
mysql-test/r/subselect.result:
  Corrected test case result after fix for bug#22331.
mysql-test/r/func_test.result:
  Corrected test case result after fix for bug#22331.
mysql-test/r/explain.result:
  Added a test case for the bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized away.
sql/sql_select.cc:
  Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
  away.
  Now if all elements of an Item_cond were removed this Item_cond is substituted
  for an Item_int with the int value of the Item_cond.
  If there were conditions that were totally optimized away then values of the
  saved cond_value and having_value will be printed instead.
sql/sql_lex.h:
  Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
  away.
  The cond_value and the having_value variables are
  added to the SELECT_LEX class.
sql/sql_lex.cc:
  Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
  away.
  The initialization of the cond_value and the having_value variables.
sql/sql_select.h:
  Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
  away.
  Now having_value is also stored in the JOIN class.
2007-03-07 21:44:58 +03:00
unknown
db3e45e6a5 Merge bodhi.local:/opt/local/work/mysql-5.0-runtime
into  bodhi.local:/opt/local/work/mysql-5.1-runtime


sql/sql_lex.cc:
  Auto merged
2007-03-07 14:10:01 +03:00
unknown
4d6e16f284 A fix for the windows build (harmless warning).
sql/sql_lex.cc:
  A fix for the windows build.
2007-03-07 14:03:44 +03:00
unknown
676b59cffa Merge bodhi.local:/opt/local/work/mysql-5.0-26750
into  bodhi.local:/opt/local/work/mysql-5.1-runtime


mysql-test/r/trigger.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/trigger.test:
  Auto merged
sql/log_event.cc:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/sp_head.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_trigger.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
sql/sql_class.cc:
  Manual merge.
sql/sql_class.h:
  Manual merge.
sql/sql_parse.cc:
  Manual merge.
sql/sql_prepare.cc:
  Manual merge.
sql/sql_yacc.yy:
  Manual merge.
2007-03-07 13:02:14 +03:00
unknown
053c6c01d6 A fix for Bug#26750 "valgrind leak in sp_head" (and post-review
fixes).

The legend: on a replication slave, in case a trigger creation
was filtered out because of application of replicate-do-table/
replicate-ignore-table rule, the parsed definition of a trigger was not 
cleaned up properly. LEX::sphead member was left around and leaked 
memory. Until the actual implementation of support of 
replicate-ignore-table rules for triggers by the patch for Bug 24478 it 
was never the case that "case SQLCOM_CREATE_TRIGGER"
was not executed once a trigger was parsed,
so the deletion of lex->sphead there worked and the memory did not leak.

The fix: 

The real cause of the bug is that there is no 1 or 2 places where
we can clean up the main LEX after parse. And the reason we 
can not have just one or two places where we clean up the LEX is
asymmetric behaviour of MYSQLparse in case of success or error. 

One of the root causes of this behaviour is the code in Item::Item()
constructor. There, a newly created item adds itself to THD::free_list
- a single-linked list of Items used in a statement. Yuck. This code
is unaware that we may have more than one statement active at a time,
and always assumes that the free_list of the current statement is
located in THD::free_list. One day we need to be able to explicitly
allocate an item in a given Query_arena.
Thus, when parsing a definition of a stored procedure, like
CREATE PROCEDURE p1() BEGIN SELECT a FROM t1; SELECT b FROM t1; END;
we actually need to reset THD::mem_root, THD::free_list and THD::lex
to parse the nested procedure statement (SELECT *).
The actual reset and restore is implemented in semantic actions
attached to sp_proc_stmt grammar rule.
The problem is that in case of a parsing error inside a nested statement
Bison generated parser would abort immediately, without executing the
restore part of the semantic action. This would leave THD in an 
in-the-middle-of-parsing state.
This is why we couldn't have had a single place where we clean up the LEX
after MYSQLparse - in case of an error we needed to do a clean up
immediately, in case of success a clean up could have been delayed.
This left the door open for a memory leak.

One of the following possibilities were considered when working on a fix:
- patch the replication logic to do the clean up. Rejected
as breaks module borders, replication code should not need to know the
gory details of clean up procedure after CREATE TRIGGER.
- wrap MYSQLparse with a function that would do a clean up.
Rejected as ideally we should fix the problem when it happens, not
adjust for it outside of the problematic code.
- make sure MYSQLparse cleans up after itself by invoking the clean up
functionality in the appropriate places before return. Implemented in 
this patch.
- use %destructor rule for sp_proc_stmt to restore THD - cleaner
than the prevoius approach, but rejected
because needs a careful analysis of the side effects, and this patch is 
for 5.0, and long term we need to use the next alternative anyway
- make sure that sp_proc_stmt doesn't juggle with THD - this is a 
large work that will affect many modules.

Cleanup: move main_lex and main_mem_root from Statement to its
only two descendants Prepared_statement and THD. This ensures that
when a Statement instance was created for purposes of statement backup,
we do not involve LEX constructor/destructor, which is fairly expensive.
In order to track that the transformation produces equivalent 
functionality please check the respective constructors and destructors
of Statement, Prepared_statement and THD - these members were
used only there.
This cleanup is unrelated to the patch.


sql/log_event.cc:
  THD::main_lex is private and should not be used.
sql/mysqld.cc:
  Move MYSQLerror to sql_yacc.yy as it depends on LEX headers now.
sql/sql_class.cc:
  Cleanup: move main_lex and main_mem_root to THD and Prepared_statement
sql/sql_class.h:
  Cleanup: move main_lex and main_mem_root to THD and Prepared_statement
sql/sql_lex.cc:
  Implement st_lex::restore_lex()
sql/sql_lex.h:
  Declare st_lex::restore_lex().
sql/sql_parse.cc:
  Consolidate the calls to unit.cleanup() and deletion of lex->sphead
  in mysql_parse (COM_QUERY handler)
sql/sql_prepare.cc:
  No need to delete lex->sphead to restore memory roots now in case of a 
  parse error - this is done automatically inside MYSQLparse
sql/sql_trigger.cc:
  This code could lead to double deletion apparently, as in case
  of an error lex.sphead was never reset.
sql/sql_yacc.yy:
  Trap all returns from the parser to ensure that MySQL-specific cleanup
  is invoked: we need to restore the global state of THD and LEX in 
  case of a parsing error. In case of a parsing success this happens as 
  part of normal grammar reduction process.
2007-03-07 12:24:46 +03:00
unknown
79542930ea WL#3527: Extend IGNORE INDEX so places where index is ignored
can be specified
Currently MySQL allows one to specify what indexes to ignore during
join optimization. The scope of the current USE/FORCE/IGNORE INDEX 
statement is only the FROM clause, while all other clauses are not 
affected.

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

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

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

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

See the WL#3527 for further details.


BitKeeper/deleted/.del-mysqld.cc.rej:
  Rename: sql/mysqld.cc.rej -> BitKeeper/deleted/.del-mysqld.cc.rej
BitKeeper/deleted/.del-sql_parse.cc.rej:
  Rename: sql/sql_parse.cc.rej -> BitKeeper/deleted/.del-sql_parse.cc.rej
BitKeeper/deleted/.del-table.cc.rej:
  Rename: sql/table.cc.rej -> BitKeeper/deleted/.del-table.cc.rej
mysql-test/r/endspace.result:
  WL3527 : fixed undeterministic test
mysql-test/r/group_by.result:
  WL#3527: test cases
mysql-test/t/endspace.test:
  WL3527 : fixed undeterministic test
mysql-test/t/group_by.test:
  WL#3527: test cases
sql/item.cc:
  WL#3527: renames
sql/mysql_priv.h:
  WL#3527: corrected initialization
sql/mysqld.cc:
  WL#3527: added old_mode command line option
sql/opt_range.cc:
  WL#3527: renames
sql/sql_base.cc:
  WL#3527: 
   - renames
   - correct initialization
   - extended the processing of USE/FORCE/IGNORE index
sql/sql_class.h:
  WL#3527: added old_mode command line option
sql/sql_delete.cc:
  WL#3527: renames
sql/sql_help.cc:
  WL#3527: renames
sql/sql_lex.cc:
  WL#3527: extended parsing of USE/FORCE/IGNORE index
sql/sql_lex.h:
  WL#3527: extended parsing of USE/FORCE/IGNORE index
sql/sql_parse.cc:
  WL#3527: extended parsing of USE/FORCE/IGNORE index
sql/sql_select.cc:
  WL#3527:
   - renames
   - passing additional info to support the extended 
     USE/FORCE/IGNORE INDEX syntax
   - If there is a covering index, and we have 
     IGNORE INDEX FOR GROUP/ORDER, and this index is 
     used for the JOIN part, then we have to ignore the
     IGNORE INDEX FOR GROUP/ORDER.
sql/sql_show.cc:
  WL#3527: passing additional info to support the extended 
     USE/FORCE/IGNORE INDEX syntax
sql/sql_update.cc:
  WL#3527: renames
sql/sql_yacc.yy:
  WL#3527: extended parsing of USE/FORCE/IGNORE index
sql/table.cc:
  WL#3527: extended the processing of USE/FORCE/IGNORE index
sql/table.h:
  WL#3527: extended the processing of USE/FORCE/IGNORE index
storage/myisam/ha_myisam.cc:
  WL#3527: extended the processing of USE/FORCE/IGNORE index
2007-03-05 19:08:41 +02:00
unknown
1fc7f2117b WL#2936
"Server Variables for Plugins"
  Implement support for plugins to declare server variables.
  Demonstrate functionality by removing InnoDB specific code from sql/*
  New feature for HASH - HASH_UNIQUE flag
  New feature for DYNAMIC_ARRAY - initializer accepts preallocated ptr.
  Completed support for plugin reference counting.


include/hash.h:
  New flag for HASH
    HASH_UNIQUE
include/my_getopt.h:
  New data types for options: ENUM and SET.
  Use typelib to enumerate possible values.
  New flag variable:
    my_getopt_skip_unknown
include/my_sys.h:
  change to DYNAMIC_ARRAY init functions to support pre-allocated buffers
include/mysql.h:
  relocate inclusion of typelib due to longlong requirement
include/mysql/plugin.h:
  wl2936
    New declarations for plugin server variable support.
    New functions for use by plugins
include/mysys_err.h:
  new my_getopt return value: EXIT_ARGUMENT_INVALID
include/typelib.h:
  new typelib function: find_typeset(), returns an int which is a SET of
  the elements in the typelib
mysql-test/r/im_utils.result:
  change to more specific command line settings
  --skip-innodb => --skip-plugin-innodb
  etc.
mysql-test/r/log_tables.result:
  set default storage engine to MEMORY so that test will succeed even
  when some of the other named storage engines are not present
mysql-test/r/ndb_dd_basic.result:
  change in error message
mysql-test/r/partition_innodb.result:
  change in results
mysql-test/r/ps_1general.result:
  bdb doesn't exist, use myisam for a non-transactional engine
mysql-test/r/variables.result:
  information schema doesn't sort row results for server variables.
mysql-test/t/log_tables.test:
  set default storage engine to MEMORY so that test will succeed even
  when some of the other named storage engines are not present
mysql-test/t/ndb_dd_basic.test:
  ALTER LOGFILE GROUP no longer silently fail here
mysql-test/t/partition_innodb.test:
  ALTER TABLE no longer silently fails for unknown storage engine
mysql-test/t/ps_1general.test:
  remove unneccessary parts
  use myisam as it is an always present non-transactional engine
mysql-test/t/variables.test:
  information schema doesn't sort row results for server variables.
mysql-test/t/warnings_engine_disabled-master.opt:
  use the new style command line option
mysys/array.c:
  change to DYNAMIC_ARRAY init functions to support pre-allocated buffers
mysys/hash.c:
  New flag for HASH
    HASH_UNIQUE
  Implement HASH_UNIQUE functionality by performing a hash_search
mysys/my_getopt.c:
  New data types for options: ENUM and SET.
  Use typelib to enumerate possible values.
  New flag variable:
    my_getopt_skip_unknown
mysys/typelib.c:
  new typelib function: find_typeset(), returns an int which is a SET of
  the elements in the typelib
sql/ha_ndbcluster.cc:
  use ha_statistic_increment() method instead of
  statistic_increment() function
  ha_ndbcluster variable has gone away.
sql/ha_partition.cc:
  fix for reference counting
sql/ha_partition.h:
  fix for reference counting
sql/handler.cc:
  fixes for reference counting
sql/handler.h:
  fixes for reference counting
  some new methods to aid storage engine writers
sql/item_func.cc:
  find_sys_var() function now requires thd
sql/item_sum.cc:
  fixes for ref counting
sql/mysql_priv.h:
  remove unneccessary globals.
  new lock: LOCK_system_variables_hash
sql/mysqld.cc:
  Remove InnoBase specific code.
  Support plugin command line processing.
sql/set_var.cc:
  Remove InnoBase specific declarations
  Remove redundant declarations
  changes to permit new variables at run time
  changes for ref counting
sql/set_var.h:
  changes to permit new variables at run time
  changes for ref counting
sql/sql_base.cc:
  changes for ref counting
sql/sql_cache.cc:
  mark code as needing work in the future
sql/sql_class.cc:
  new functions to aid plugin authors
  initialize variables for dynamic plugin variables
sql/sql_class.h:
  remove InnoBase specific declarations
  New declarations for plugin variables.
sql/sql_connect.cc:
  initialization and cleanup of plugin variables
sql/sql_delete.cc:
  change for ref counting
sql/sql_insert.cc:
  change for ref counting
sql/sql_lex.cc:
  changes for ref counting and plugin variables
sql/sql_lex.h:
  add properties for plugin ref counting,
  add to distructor to clean up
sql/sql_partition.cc:
  changes for ref counting
sql/sql_plugin.cc:
  WL2936
    Plugin Variables
    New methods and code to support server variables for plugins.
    New code to complete plugin reference counting
    Debug code adds further indirection so that malloc debugging can be
    used to aid finding plugin ref count leaks
sql/sql_plugin.h:
  WL2936
    Plugin Variables
    New methods and code to support server variables for plugins.
    New code to complete plugin reference counting
    Debug code adds further indirection so that malloc debugging can be
    used to aid finding plugin ref count leaks
sql/sql_repl.cc:
  replication system variables moved here from set_var.cc
sql/sql_repl.h:
  new function to initialise replication server variables
sql/sql_select.cc:
  changes for ref counting
sql/sql_show.cc:
  changes for ref counting
sql/sql_table.cc:
  changes for ref counting
sql/sql_tablespace.cc:
  use supplied functions instead of digging into data structures manually
sql/sql_yacc.yy:
  changes for ref counting
  find_sys_var() now requires thd parameter
  changes on reporting errors to keep user-visible behaviour the same.
sql/structs.h:
  changes for ref counting
sql/table.cc:
  changes for ref counting
sql/table.h:
  changes for ref counting
storage/federated/ha_federated.cc:
  use ha_statistic_increment() method instead of statistic_increment()
  function
storage/heap/ha_heap.cc:
  use ha_statistic_increment() method instead of statistic_increment()
  function
storage/innobase/handler/ha_innodb.cc:
  use ha_statistic_increment() method instead of statistic_increment()
  function
  WL2936
    Move InnoBase specific code out of mysqld.cc and into here
    Declare all required server variables for InnoBase
storage/innobase/include/trx0trx.h:
  store a bit more state so that InnoBase does not have to dig into
  mysqld internal data structures.
storage/myisam/ha_myisam.cc:
  use ha_statistic_increment() method instead of statistic_increment()
  function
storage/myisammrg/ha_myisammrg.cc:
  use ha_statistic_increment() method instead of statistic_increment()
  function
2007-03-02 08:43:45 -08:00
unknown
57b6c86411 Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-base
into  weblab.(none):/home/marcsql/TREE/mysql-5.0-rt-merge


mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
server-tools/instance-manager/instance_options.cc:
  Auto merged
server-tools/instance-manager/mysqlmanager.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_subselect.h:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2007-03-01 14:06:57 -07:00
unknown
ee950898e3 Merge weblab.(none):/home/marcsql/TREE/mysql-5.1-base
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-rt-merge


include/my_pthread.h:
  Auto merged
mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/r/partition_innodb.result:
  Auto merged
mysql-test/t/disabled.def:
  Auto merged
server-tools/instance-manager/IMService.cpp:
  Auto merged
sql/ha_ndbcluster.cc:
  Auto merged
sql/ha_ndbcluster_binlog.cc:
  Auto merged
sql/ha_partition.cc:
  Auto merged
sql/handler.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_subselect.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
sql/table.cc:
  Auto merged
2007-02-28 18:14:56 -07:00
unknown
de5d4e32fb Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt


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


mysql-test/r/innodb.result:
  Auto merged
mysql-test/r/insert_update.result:
  Auto merged
mysql-test/r/myisam.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/r/subselect3.result:
  Auto merged
mysql-test/r/type_blob.result:
  Auto merged
mysql-test/t/insert_update.test:
  Auto merged
mysql-test/t/select.test:
  Auto merged
BitKeeper/deleted/.del-bdb.result:
  Auto merged
mysql-test/extra/binlog_tests/blackhole.test:
  Auto merged
sql/item.cc:
  Auto merged
sql/item.h:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_delete.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_union.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
storage/blackhole/ha_blackhole.cc:
  Auto merged
mysql-test/r/binlog_stm_blackhole.result:
  manual merge
mysql-test/r/insert_select.result:
  manual merge
mysql-test/r/subselect.result:
  manual merge
mysql-test/r/update.result:
  manual merge
mysql-test/t/insert_select.test:
  manual merge
mysql-test/t/subselect.test:
  manual merge
sql/sql_help.cc:
  manual merge
sql/sql_insert.cc:
  manual merge
sql/sql_update.cc:
  manual merge
2007-02-26 15:54:43 +04:00
unknown
b1e1f77f1f item.cc:
Post fix for bug#23800.
  The Item_field constructor now increases the select_n_where_fields counter.
sql_yacc.yy:
  Post fix for bug#23800.
  Take into account fields that might be added by subselects.
sql_lex.h:
  Post fix for bug#23800.
  Added the select_n_where_fields variable to the st_select_lex class.
sql_lex.cc:
  Post fix for bug#23800.
  Initialization of the select_n_where_fields variable.


sql/sql_lex.cc:
  Post fix for bug#23800.
  Initialization of the select_n_where_fields variable.
sql/sql_lex.h:
  Post fix for bug#23800.
  Added the select_n_where_fields variable to the st_select_lex class.
sql/item.cc:
  Post fix for bug#23800.
  The Item_field constructor now increases the select_n_where_fields counter.
sql/sql_yacc.yy:
  Post fix for bug#23800.
  Take into account fields that might be added by subselects.
2007-02-24 23:04:15 +03:00
unknown
f8855142d7 Bug#23800: Outer fields in correlated subqueries is used in a temporary table
created for sorting.

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

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

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

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


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


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


sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_subselect.h:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2007-02-16 09:02:02 -07:00
unknown
25bf1eae6a Merge weblab.(none):/home/marcsql/TREE/mysql-5.1-base
into  weblab.(none):/home/marcsql/TREE/mysql-5.1-rt-merge


mysql-test/r/subselect.result:
  Auto merged
mysql-test/t/ps_1general.test:
  Auto merged
mysql-test/t/subselect.test:
  Auto merged
sql/event_data_objects.cc:
  Auto merged
sql/event_queue.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_subselect.cc:
  Auto merged
sql/item_subselect.h:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sp_head.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2007-02-15 14:04:03 -07:00
unknown
21df932dbd Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/mysql-5.1-opt


BitKeeper/etc/gone:
  auto-union
mysql-test/r/insert_select.result:
  Auto merged
mysql-test/r/join_outer.result:
  Auto merged
mysql-test/r/select.result:
  Auto merged
mysql-test/r/view.result:
  Auto merged
mysql-test/t/insert_select.test:
  Auto merged
mysql-test/t/join_outer.test:
  Auto merged
mysql-test/t/select.test:
  Auto merged
mysys/my_getopt.c:
  Auto merged
sql/field.h:
  Auto merged
sql/field_conv.cc:
  Auto merged
sql/item.cc:
  Auto merged
sql/item_cmpfunc.cc:
  Auto merged
sql/item_cmpfunc.h:
  Auto merged
sql/item_func.cc:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/table.cc:
  Auto merged
sql/table.h:
  Auto merged
mysql-test/include/mix1.inc:
  Manual merge
mysql-test/r/information_schema.result:
  Manual merge
mysql-test/r/innodb_mysql.result:
  Manual merge
mysql-test/t/information_schema.test:
  Manual merge
mysql-test/t/view.test:
  Manual merge
mysys/my_pthread.c:
  Manual merge
sql/mysql_priv.h:
  Manual merge
sql/opt_range.cc:
  Manual merge
sql/sql_insert.cc:
  Manual merge
sql/sql_update.cc:
  Manual merge
2007-02-13 01:34:36 -08:00
unknown
308da65162 Bug#12122: The MERGE algorithm isn't applicable if the ORDER BY clause is
present.

A view created with CREATE VIEW ... ORDER BY ... cannot be resolved with
the MERGE algorithm, even when no other part of the CREATE VIEW statement
would require the view to be resolved using the TEMPTABLE algorithm.

The check for presence of the ORDER BY clause in the underlying select is 
removed from the st_lex::can_be_merged() function.
The ORDER BY list of the underlying select is appended to the ORDER BY list 


mysql-test/t/view.test:
  Added a test case for bug#12122: Views with ORDER BY can't be resolved using MERGE algorithm.
mysql-test/r/view.result:
  Added a test case for bug#12122: Views with ORDER BY can't be resolved using MERGE algorithm.
sql/sql_lex.cc:
  Bug#12122: Views with ORDER BY can't be resolved using MERGE algorithm.
  The st_lex::can_be_merged() function now allows views with the ORDER BY
  clause to be resolved using MERGE algorithm. The ORDER BY list of the view 
  is appended to the ORDER BY list of the embedding select.
2007-02-10 00:00:07 +03:00
unknown
54aed8711a Merge moonlight.home:/home/tomash/src/mysql_ab/mysql-5.0-bug25897
into  moonlight.home:/home/tomash/src/mysql_ab/mysql-5.1


mysql-test/r/view.result:
  Auto merged
sql/sql_lex.cc:
  Auto merged
sql/sql_lex.h:
  Auto merged
mysql-test/t/view.test:
  Manual merge.
2007-02-05 18:29:36 +03:00