Commit graph

936 commits

Author SHA1 Message Date
unknown
593afb6a73 Bug#28553 mysqld crash in "purge master log before(select time from information_schema)"
forbid the use of subselect in PURGE LOGS BEFORE command


mysql-test/r/subselect.result:
  test result
mysql-test/t/subselect.test:
  test case
sql/sql_yacc.yy:
  forbid the use of subselect in PURGE LOGS BEFORE command
2007-06-06 18:29:15 +05:00
unknown
a5c60b3f29 Bug#25482 GRANT statements are not replicated if you use "replicate-ignore-table"
- GRANT and REVOKE statments didn't have the "updating" flag set and
   thus statements with a table specified would not replicate if
   slave filtering rules where turned on.
   For example "GRANT ... ON test.t1 TO ..." would not replicate.


mysql-test/r/rpl_ignore_table.result:
  Add test results
mysql-test/t/rpl_ignore_table.test:
  Add tests
sql/sql_yacc.yy:
  Pass option TL_OPTION_UPDATING to 'add_table_to_list' when parsing a
  GRANT or REVOKE and a table specifier is found. This will set the
  property "updating" on the table and thus the slave filtering rules will 
  be applied.
  
  Without setting updating the statement will be not
  replicated - since "it's not updating anything" - an optimization
  to quickly skip SELECT's and similar.
2007-03-29 14:12:32 +02:00
unknown
d4ee8cebf3 Bug#24562 (ALTER TABLE ... ORDER BY ... with complex expression asserts)
WL#3681 (ALTER TABLE ORDER BY)

Before this fix, the ALTER TABLE statement implemented an ORDER BY option
with the following characteristics :

1) The order by clause accepts a list of criteria, with optional ASC or
DESC keywords

2) Each criteria can be a general expression, involving operators,
native functions, stored functions, user defined functions, subselects ...

With this fix :

1) has been left unchanged, since it's a de-facto existing feature,
that was already present in the code base and partially covered in the test
suite. Code coverage for ASC and DESC was missing and has been improved.

2) has been changed to limit the kind of criteria that are permissible:
now only a column name is valid.


mysql-test/r/alter_table.result:
  Prevent ALTER TABLE ORDER BY clauses to use general expressions.
mysql-test/t/alter_table.test:
  Prevent ALTER TABLE ORDER BY clauses to use general expressions.
sql/sql_yacc.yy:
  Prevent ALTER TABLE ORDER BY clauses to use general expressions.
2007-01-18 16:53:49 -07:00
unknown
e47ded8114 A fix and test cases for
Bug#4968 "Stored procedure crash if cursor opened on altered table"
Bug#19733 "Repeated alter, or repeated create/drop, fails"
Bug#19182 "CREATE TABLE bar (m INT) SELECT n FROM foo; doesn't work from 
stored procedure."
Bug#6895 "Prepared Statements: ALTER TABLE DROP COLUMN does nothing"
Bug#22060 "ALTER TABLE x AUTO_INCREMENT=y in SP crashes server"

Test cases for bugs 4968, 19733, 6895 will be added in 5.0.

Re-execution of CREATE DATABASE, CREATE TABLE and ALTER TABLE 
statements in stored routines or as prepared statements caused
incorrect results (and crashes in versions prior to 5.0.25).
In 5.1 the problem occured only for CREATE DATABASE, CREATE TABLE
SELECT and CREATE TABLE with INDEX/DATA DIRECTOY options).

The problem of bugs 4968, 19733, 19282 and 6895 was that functions
mysql_prepare_table, mysql_create_table and mysql_alter_table were not
re-execution friendly: during their operation they used to modify contents
of LEX (members create_info, alter_info, key_list, create_list),
thus making the LEX unusable for the next execution.
In particular, these functions removed processed columns and keys from
create_list, key_list and drop_list. Search the code in sql_table.cc 
for drop_it.remove() and similar patterns to find evidence.

The fix is to supply to these functions a usable copy of each of the
above structures at every re-execution of an SQL statement. 

To simplify memory management, LEX::key_list and LEX::create_list
were added to LEX::alter_info, a fresh copy of which is created for
every execution.

The problem of crashing bug 22060 stemmed from the fact that the above 
metnioned functions were not only modifying HA_CREATE_INFO structure in 
LEX, but also were changing it to point to areas in volatile memory of 
the execution memory root.
 
The patch solves this problem by creating and using an on-stack
copy of HA_CREATE_INFO (note that code in 5.1 already creates and
uses a copy of this structure in mysql_create_table()/alter_table(),
but this approach didn't work well for CREATE TABLE SELECT statement).


mysql-test/r/ps.result:
  Update test results (Bug#19182, Bug#22060)
mysql-test/t/ps.test:
  Add a test case for Bug#19182, Bug#22060 (4.1-only parts)
sql/mysql_priv.h:
  LEX::key_list and LEX::create_list were moved to LEX::alter_info.
  Update declarations to use LEX::alter_info instead of these two
  members.
sql/sql_class.h:
  Replace pair<columns, keys> with an instance of Alter_info in
  select_create constructor. We create a new copy of Alter_info
  each time we re-execute SELECT .. CREATE prepared statement.
sql/sql_insert.cc:
  Adjust to a new signature of create_table_from_items.
sql/sql_lex.cc:
  Implement Alter_info::Alter_info that would make a "deep" copy
  of all definition lists (keys, columns).
sql/sql_lex.h:
  Move key_list and create_list to class Alter_info. Implement
  Alter_info::Alter_info that can be used with PS and SP.
sql/sql_list.h:
  Implement a copy constructor of class List that makes a deep copy
  of all list nodes.
sql/sql_parse.cc:
  Adjust to new signatures of mysql_create_table, mysql_alter_table,
  select_create. Functions mysql_create_index and mysql_drop_index has
  become identical after initialization of alter_info was moved to the 
  parser, and were merged. Flag enable_slow_log was not updated for 
  SQLCOM_DROP_INDEX, which is a bug. Just like CREATE INDEX, DROP INDEX
  is currently done via complete table rebuild and is rightfully a slow
  administrative statement.
sql/sql_show.cc:
  Adjust mysqld_show_create_db to a new signature.
sql/sql_table.cc:
  Adjust mysql_alter_table, mysql_recreate_table, mysql_create_table,
  mysql_prepare_table to new signatures.
sql/sql_yacc.yy:
  LEX::key_list and LEX::create_list moved to class Alter_info
2006-12-08 02:20:09 +03:00
unknown
941e502079 Merge mysql.com:/users/lthalmann/bkroot/mysql-4.1-rpl
into  mysql.com:/users/lthalmann/bk/MERGE/mysql-4.1-merge


sql/sql_yacc.yy:
  Auto merged
2006-09-20 16:17:30 +02:00
unknown
ff1d115e3a Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B21392-4.1-opt


sql/sql_parse.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2006-09-05 13:12:30 +03:00
unknown
1431966d02 Bug #21392: multi-table delete with alias table name fails with
1003: Incorrect table name
in multi-table DELETE the set of tables to delete from actually 
references then tables in the other list, e.g:
DELETE alias_of_t1 FROM t1 alias_of_t1 WHERE ....
is a valid statement.
So we must turn off table name syntactical validity check for alias_of_t1 
because it's not a table name (even if it looks like one).
In order to do that we add a special flag (TL_OPTION_ALIAS) to 
disable the name checking for the aliases in multi-table DELETE.


mysql-test/r/delete.result:
  Bug #21392: multi-table delete with alias table name fails with
              1003: Incorrect table name
   - test case
mysql-test/t/delete.test:
  Bug #21392: multi-table delete with alias table name fails with
              1003: Incorrect table name
   - test case
sql/mysql_priv.h:
  Bug #21392: multi-table delete with alias table name fails with
              1003: Incorrect table name
   - add a special flag to disable the name checking for the aliases
     in multi-table DELETE
sql/sql_parse.cc:
  Bug #21392: multi-table delete with alias table name fails with
              1003: Incorrect table name
   - add a special flag to disable the name checking for the aliases
     in multi-table DELETE
sql/sql_yacc.yy:
  Bug #21392: multi-table delete with alias table name fails with
              1003: Incorrect table name
   - add a special flag to disable the name checking for the aliases
     in multi-table DELETE
2006-09-04 18:40:30 +03:00
unknown
9c09d53312 BUG#18822 LOAD DATA FROM MASTER corrupts data
there is a bunch of dups. It has been decided to declare this feature as
deprecated.
  


sql/sql_yacc.yy:
  deprecation macro
2006-08-31 02:00:40 +03:00
unknown
fe3dee0621 Fix for bug #20695: Charset introducer overrides charset definition for column.
- if there are two character set definitions in the column declaration,
    we replace the first one with the second one as we store both in the LEX->charset
    slot. Add a separate slot to the LEX structure to store underscore charset.
  - convert default values to the column charset of STRING, VARSTRING fields 
    if necessary as well.


mysql-test/r/ctype_recoding.result:
  Fix for bug #20695: Charset introducer overrides charset definition for column.
    - test result.
mysql-test/t/ctype_recoding.test:
  Fix for bug #20695: Charset introducer overrides charset definition for column.
    - test case.
sql/sql_lex.cc:
  Fix for bug #20695: Charset introducer overrides charset definition for column.
    - LEX->underscore_charset introduced to store UNDERSCORE_CHARSET
sql/sql_lex.h:
  Fix for bug #20695: Charset introducer overrides charset definition for column.
    - LEX->underscore_charset introduced to store UNDERSCORE_CHARSET
sql/sql_table.cc:
  Fix for bug #20695: Charset introducer overrides charset definition for column.
    - convert default values to the column charset of VARSTRING, STRING, ENUM, 
      SET fields if necessary.
sql/sql_yacc.yy:
  Fix for bug #20695: Charset introducer overrides charset definition for column.
    - LEX->underscore_charset introduced to store UNDERSCORE_CHARSET
2006-08-15 15:24:07 +05:00
unknown
9225a51c58 Fixed bug #18767.
The bug caused wrong result sets for union constructs of the form
(SELECT ... ORDER BY order_list1 [LIMIT n]) ORDER BY order_list2.
For such queries order lists were concatenated and limit clause was
completely neglected. 


mysql-test/r/order_by.result:
  Added a test case for bug #18767.
mysql-test/t/order_by.test:
  Added a test case for bug #18767.
sql/sql_lex.h:
  Fixed bug #18767.
  Placed the code the created a fake SELECT_LEX into a separate function.
sql/sql_parse.cc:
  Fixed bug #18767.
  Placed the code the created a fake SELECT_LEX into a separate function.
sql/sql_select.cc:
  Fixed bug #18767.
  Changed the condition on which a SELECT is treated as part of a UNION.
  The SELECT in 
  (SELECT ... ORDER BY order_list1 [LIMIT n]) ORDER BY order_list2 
  now is handled in the same way as the first SELECT in a UNION
  sequence.
sql/sql_union.cc:
  Fixed bug #18767.
  Changed the condition at which a SELECT is treated as part of a UNION.
  The SELECT in 
  (SELECT ... ORDER BY order_list1 [LIMIT n]) ORDER BY order_list2 
  now is handled in the same way as the first SELECT in a UNION
  sequence.
sql/sql_yacc.yy:
  Fixed bug #18767.
  Changed the condition at which a SELECT is treated as part of a UNION.
  The SELECT in 
  (SELECT ... ORDER BY order_list1 [LIMIT n]) ORDER BY order_list2 
  now is handled in the same way as the first SELECT in a UNION
  sequence. In the same way is handled the SELECT in
  (SELECT ... LIMIT n) ORDER BY order list.
  Yet if there is neither ORDER BY nor LIMIT in the single-select
  union construct
  (SELECT ...) ORDER BY order_list
  then it is still handled as simple select with an order clause.
2006-04-20 22:15:38 -07:00
unknown
a127344a6c kill (subquery) - three years old bugfix that never worked 2006-03-06 18:26:39 +01:00
unknown
c9978d8bcb Bug#13233
select distinct char(column) fails with utf8
ctype_utf8.result, ctype_utf8.test:
  Adding test case
sql_yacc.yy:
  Adding new syntax.
item_strfunc.h:
  Fixing wrong max_length calculation.
  Also, adding CHAR(x USING charset),
  for easier migrating from 4.1 to 5.0,
  according to Monty's suggestion.


sql/item_strfunc.h:
  Bug#13233
  select distinct char(column) fails with utf8
  Also, adding CHAR(x USING charset),
  for easier migrating from 4.1 to 5.0.
sql/sql_yacc.yy:
  Adding new syntax.
mysql-test/t/ctype_utf8.test:
  Adding test case
mysql-test/r/ctype_utf8.result:
  Adding test case
2005-10-21 14:41:56 +05:00
unknown
be559ad6ce sql_yacc.yy:
Bug #10308: Parse 'purge master logs' with subselect correctly.
subselect.test:
  Bug #10308: Test for 'purge master logs' with subselect.
subselect.result:
  Bug #10308: Test result for 'purge master logs' with subselect.


mysql-test/r/subselect.result:
  Bug #10308: Test result for 'purge master logs' with subselect.
mysql-test/t/subselect.test:
  Bug #10308: Test for 'purge master logs' with subselect.
sql/sql_yacc.yy:
  Bug #10308: Parse 'purge master logs' with subselect correctly.
2005-10-12 09:47:59 +02:00
unknown
855c1646e1 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b11553


sql/sql_yacc.yy:
  Auto merged
2005-09-22 11:46:54 +05:00
unknown
6367a2c631 a fix (#11553: gives error if aggregate user-defined function in HAVING clause).
sql/sql_yacc.yy:
  a fix (#11553: gives error if aggregate user-defined function in HAVING clause).
  udf_sum_expr_list rule introduced and used for aggregate udf functions:            
    - call inc_in_sum_expr() before udf_expr_list parsing                            
      (as in_sum_expr rule does).
2005-09-22 11:45:16 +05:00
unknown
7aad3ae6a9 Merge joreland@bk-internal.mysql.com:/home/bk/mysql-4.1
into  perch.ndb.mysql.com:/home/jonas/src/mysql-4.1-push


sql/sql_parse.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2005-09-20 09:50:10 +02:00
unknown
b390a1a400 ndb - imlp. show engine ndb status;
that dump free list allocation per connection


sql/ha_ndbcluster.cc:
  imlp. show engine ndb status;
    that dump free list allocation per connection
sql/ha_ndbcluster.h:
  imlp. show engine ndb status;
    that dump free list allocation per connection
sql/mysqld.cc:
  imlp. show engine ndb status;
    that dump free list allocation per connection
sql/sql_lex.h:
  imlp. show engine ndb status;
    that dump free list allocation per connection
sql/sql_parse.cc:
  imlp. show engine ndb status;
    that dump free list allocation per connection
sql/sql_yacc.yy:
  imlp. show engine ndb status;
    that dump free list allocation per connection
2005-09-19 15:35:07 +02:00
unknown
f89424f8b6 fix for BUG#11139 (multi-delete with alias breaking replication if table rules are
present): the problem originally was that the tables in auxilliary_tables did not have 
the correct real_name, which caused problems in the second call to tables_ok(). 
The fix corrects the real_name problem, and also sets the updating flag properly, 
which makes the second call to tables_ok() unnecessary.


mysql-test/r/rpl_multi_delete2.result:
  updates for for BUG#11139
mysql-test/t/rpl_multi_delete2-slave.opt:
  updates for for BUG#11139
mysql-test/t/rpl_multi_delete2.test:
  updates for for BUG#11139
sql/mysql_priv.h:
  fix for BUG#11139 (multi-delete with alias breaking replication if table rules are
   present)
sql/slave.cc:
  fix for BUG#11139 (multi-delete with alias breaking replication if table rules are
   present)
sql/sql_parse.cc:
  fix for BUG#11139 (multi-delete with alias breaking replication if table rules are
   present)
sql/sql_yacc.yy:
  fix for BUG#11139 (multi-delete with alias breaking replication if table rules are
   present)
2005-09-14 06:31:38 -06:00
unknown
f1cc504981 item_cmpfunc.h:
Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
   for some expressions.
   The classes Item_func_between, Item_func_if, Item_func_in are modified.
   Item_func_between/in objects can represent now [NOT]BETWEEN/IN expressions.
   The class Item_func_opt_neg is added to factor out the functionality
   common for the modified classes Item_func_between and Item_func_in.
item_cmpfunc.cc:
  Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
   for some expressions.
   Added Item_func_between::fix_fields(), Item_func_if::fix_fields(),
   Item_func_in::fix_fields(). They correct generic calculation of
   the not_null_tables attribute when it is needed.
   Modified Item_func_between::val_int(), Item_func_in::val_int().
opt_range.cc:
  Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
   for some expressions.
   The function get_mm_tree() is modified. There cannot be NOT before
   BETWEEN/IN anymore. Rather Item_func_between/in objects can represent
   now [NOT]BETWEEN/IN expressions.
sql_yacc.yy:
  Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
   for some expressions.
   Item_func_between/in objects can represent now [NOT]BETWEEN/IN expresions.
join_outer.result:
  Fixed some testcases results (bugs #12101, #12102)
join_outer.test:
  Added testcases for bugs #12101, #12102


mysql-test/t/join_outer.test:
  Added testcases for bugs #12101, #12102
mysql-test/r/join_outer.result:
  Fixed some testcases results (bugs #12101, #12102)
sql/sql_yacc.yy:
  Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
   for some expressions.
   Item_func_between/in objects can represent now [NOT]BETWEEN/IN expresions.
sql/opt_range.cc:
  Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
   for some expressions.
   The function get_mm_tree() is modified. There cannot be NOT before
   BETWEEN/IN anymore. Rather Item_func_between/in objects can represent
   now [NOT]BETWEEN/IN expressions.
sql/item_cmpfunc.cc:
  Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
   for some expressions.
   Added Item_func_between::fix_fields(), Item_func_if::fix_fields(),
   Item_func_in::fix_fields(). They correct generic calculation of
   the not_null_tables attribute when it is needed.
   Modified Item_func_between::val_int(), Item_func_in::val_int().
sql/item_cmpfunc.h:
  Fixed bugs #12101, #12102: wrong calculation of not_null_tables()
   for some expressions.
   The classes Item_func_between, Item_func_if, Item_func_in are modified.
   Item_func_between/in objects can represent now [NOT]BETWEEN/IN expressions.
   The class Item_func_opt_neg is added to factor out the functionality
   common for the modified classes Item_func_between and Item_func_in.
2005-09-06 18:03:08 +04:00
unknown
6a88fa48ae select.result, select.test:
Added a test case for bug #11745.
sql_select.cc:
  Fixed bug # 11745.
  Added support of where clause for queries with FROM DUAL.
sql_yacc.yy:
  Fixed bug # 11745.
  Added optional where clause for queries with FROM DUAL.


sql/sql_yacc.yy:
  Fixed bug # 11745.
  Added optional where clause for queries with FROM DUAL.
sql/sql_select.cc:
  Fixed bug # 11745.
  Added support of where clause for queries with FROM DUAL.
mysql-test/t/select.test:
  Added a test case for bug #11745.
mysql-test/r/select.result:
  Added a test case for bug #11745.
2005-07-17 09:46:14 -07:00
unknown
cb7a5b53cc A fix and a test case for Bug#11299 "prepared statement makes wrong SQL
syntax in binlog which stops replication":
disallow the use of parameter markers which can lead to generation
of malformed binlog queries. 


mysql-test/r/ps.result:
  Test results fixed: a test case for Bug#11299
mysql-test/t/ps.test:
  A test case for Bug#11299
sql/sql_lex.cc:
  Introduce a new parser token for a parameter marker. Make sure
  that a parameter marker can not be used in a query which, when
  transformed to a binlog query, becomes grammatically incorrect.
sql/sql_yacc.yy:
  The check for COM_PREPARE has been moved into the lexer.
mysql-test/var:
  New BitKeeper file ``mysql-test/var''
2005-07-15 00:01:49 +04:00
unknown
d10877ce8c Better bug fix for:
#9728  'Decreased functionality in "on duplicate key update
#8147  'a column proclaimed ambigous in INSERT ... SELECT .. ON DUPLICATE'

This ensures fields are uniquely qualified and also that one can't update other tables in the ON DUPLICATE KEY UPDATE part


mysql-test/r/insert_select.result:
  More tests for bug #9728 and #8147
mysql-test/r/insert_update.result:
  Updated tests after changing how INSERT ... SELECT .. ON DUPLICATE KEY works
mysql-test/t/insert_select.test:
  More tests for bug #9728 and #8147
mysql-test/t/insert_update.test:
  Updated tests after changing how INSERT ... SELECT .. ON DUPLICATE KEY works
mysys/my_access.c:
  Cleanup (shorter loop variable names)
sql/ha_ndbcluster.cc:
  Indentation fixes
sql/item.cc:
  Remove item_flags
sql/item.h:
  Remove item_flags
sql/mysql_priv.h:
  New arguments to mysql_prepare_insert
sql/sql_base.cc:
  Remove old fix for bug #8147
sql/sql_insert.cc:
  Extend mysql_prepare_insert() with new field list for tables that can be used in the values port of ON DUPLICATE KEY UPDATE
sql/sql_parse.cc:
  Revert fix for #9728
  Allow one to use other tables in ON DUPLICATE_KEY for INSERT ... SELECT if there is no GROUP BY clause
sql/sql_prepare.cc:
  New arguments to mysql_prepare_insert
sql/sql_yacc.yy:
  Revert bug fix for #9728
2005-06-27 16:46:41 +03:00
unknown
a6c7fb455a Fix bug #9728 decreased functionality in "on duplicate key update"
Remove changes made by bug fix #8147. They strips list of insert_table_list to
only insert table, which results in error reported in bug #9728.
Added flag to Item to resolve ambigous fields reported in bug #8147.


sql/item.h:
  Fix bug#9728  decreased functionality in "on duplicate key update".
sql/item.cc:
  Fix bug#9728  decreased functionality in "on duplicate key update"
sql/sql_parse.cc:
  Fix bug#9728  decreased functionality in "on duplicate key update"
sql/sql_base.cc:
  Fix bug#9728  decreased functionality in "on duplicate key update".
sql/sql_yacc.yy:
  Fix bug#9728  decreased functionality in "on duplicate key update"
mysql-test/t/insert_select.test:
  Test case for bug#9728 Decreased functionality in "on duplicate key update".
mysql-test/r/insert_select.result:
  Test case for bug#9728 Decreased functionality in "on duplicate key update".
2005-06-22 07:18:42 +04:00
unknown
72dd44b9de Move USE_PRAGMA_IMPLEMENTATION to proper place
Ensure that 'null_value' is not accessed before val() is called in FIELD() functions
Fixed initialization of key maps. This fixes some problems with keys when you have more than 64 keys
Fixed that ROLLUP don't always create a temporary table. This fix ensures that func_gconcat.test results are now predictable


mysql-test/r/func_gconcat.result:
  Move innodb specific test to innodb.test
  Changed table name r2 -> t2
  More test to see how ROLLUP was optimized
mysql-test/r/innodb.result:
  Moved test here form func_gconcat
mysql-test/r/olap.result:
  New test results after optimization
mysql-test/t/func_gconcat.test:
  Move innodb specific test to innodb.test
  Changed table name r2 -> t2
  More test to see how ROLLUP was optimized
mysql-test/t/innodb.test:
  Moved test here form func_gconcat
sql/field.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_berkeley.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_blackhole.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_heap.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_innodb.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_isam.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_isammrg.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_myisam.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_myisammrg.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/ha_ndbcluster.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/handler.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/hash_filo.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_cmpfunc.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_func.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
  Ensure that 'null_value' is not accessed before val() is called
sql/item_geofunc.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_strfunc.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_subselect.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_sum.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_timefunc.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/item_uniq.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/log_event.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/mysql_priv.h:
  Change key_map_full to not be const as we are giving it a proper value on startup
sql/mysqld.cc:
  Move key_map variables here and initialize key_map_full properly
sql/opt_range.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/opt_range.h:
  Fix that test_quick_select() works with any ammount of keys
sql/procedure.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/protocol.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/protocol_cursor.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/set_var.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_analyse.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_class.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_crypt.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_insert.cc:
  Fixed that max_rows is ulong
sql/sql_list.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_map.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_olap.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_select.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
  Fixed that ROLLUP don't have to always create a temporary table
  Added new argument to remove_const() to make above possible
  Fixed some errors that creapt up when we don't always do a temporary table for ROLLUP
sql/sql_string.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_table.cc:
  Simple optimizations
  Fixed wrong checking of build_table_path() in undef-ed code
sql/sql_udf.cc:
  Move USE_PRAGMA_IMPLEMENTATION to proper place
sql/sql_yacc.yy:
  removed extra {}
2005-06-03 23:46:03 +03:00
unknown
2b548fe935 Bug#10413 - Invalid column name is not rejected
Stop ignoring name parts and check for validity


mysql-test/r/create.result:
  Test for bug#10413
mysql-test/t/create.test:
  Test for bug#10413
sql/sql_yacc.yy:
  Bug#10413
    Stop ignoring parts of fully qualified names.
2005-05-31 18:06:54 +01:00
unknown
2f9c6377f0 Merge sinisa@bk-internal.mysql.com:/home/bk/mysql-4.1
into sinisa.nasamreza.org:/mnt/work/mysql-4.1


sql/sql_yacc.yy:
  Auto merged
2005-05-18 15:28:13 +03:00
unknown
fce1521033 sql_yacc.yy:
Added missing ';'.


sql/sql_yacc.yy:
  Added missing ';'.
2005-05-18 04:17:13 -07:00
unknown
2a695127a6 Fixes during review
mysql-test/r/select.result:
  Better error message
mysql-test/t/select.test:
  Better error message
sql/hostname.cc:
  Join identical code
sql/sql_yacc.yy:
  Combine code (and get a better error message)
strings/ctype-ucs2.c:
  Cast pointer differencess
2005-05-13 14:04:32 +03:00
unknown
3a842fdfc0 Merge acurtis@bk-internal.mysql.com:/home/bk/mysql-4.1
into ltantony.mysql.com:/usr/home/antony/work2/p3-bug8733


sql/sql_yacc.yy:
  Auto merged
2005-05-09 14:50:56 +01:00
unknown
19b8643830 Bug#8733 - server accepts malformed query (multiply mentioned distinct)
Detect conflicting options in SELECT


mysql-test/r/select.result:
  Test for bug#8733
mysql-test/t/select.test:
  Test for bug#8733
sql/mysql_priv.h:
  New bit for ALL
sql/sql_yacc.yy:
  We want to complain if DISTINCT or ALL is used in SELECT when a
  conflicting option is already selected.
2005-05-09 14:31:46 +01:00
unknown
76f63c975d Bug#9666 - Can't use 'DEFAULT FALSE' for column of type bool
Fix bug by moving TRUE/FALSE in with other literals.


mysql-test/r/create.result:
  Test for Bug#9666
mysql-test/t/create.test:
  Test for Bug#9666
sql/sql_yacc.yy:
  Move TRUE/FALSE in with other literals.
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
2005-05-07 13:51:29 +01:00
unknown
783705fc65 union.result:
Results for the above test case
union.test:
  A test case for bug #10032 involving UNION's and ORDER BY clause
sql_yacc.yy:
  Fix for a bug #10032 involving a parser bug with UNION's and ORDER BY


sql/sql_yacc.yy:
  Fix for a bug #10032 involving a parser bug with UNION's and ORDER BY
mysql-test/t/union.test:
  A test case for bug #10032 involving UNION's and ORDER BY clause
mysql-test/r/union.result:
  Results for the above test case
2005-04-26 21:27:06 +03:00
unknown
f75a518853 merged
sql/sql_lex.cc:
  ul
2005-04-16 00:10:35 +02:00
unknown
e2d9929d2c BUG#9922 - INSERT SELECT with UNIONs allows concurrent INSERTs
don't set lex->lock_option=TL_READ in the parser for SELECT
2005-04-15 19:20:15 +02:00
unknown
ddd9fd8964 Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/gluh/MySQL/Bugs/mysql-4.1.9286


sql/sql_yacc.yy:
  Auto merged
2005-04-06 14:14:13 +05:00
unknown
31d15c3f76 Fix for bug #9286: SESSION/GLOBAL should be disallowed for user variables
BitKeeper/etc/logging_ok:
  Logging to logging@openlogging.org accepted
2005-04-06 14:13:06 +05:00
unknown
5687fe36bf Adding a new parameter for well_formed_length to
return error. We'll use it for better warnign reporting.
2005-04-06 11:53:15 +05:00
unknown
ac57068a7b Merge from 4.0
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Merged from 4.0
2005-02-18 14:19:08 +01:00
unknown
41a329f9a1 Merge mysql.com:/home/bkroot/mysql-4.0
into mysql.com:/home/bk/b7879-mysql-4.0


sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2005-02-18 13:50:19 +01:00
unknown
95dec435c2 Bug#7879: Using TL_READ_NO_INSERT locks instead of TL_READ locks when
reading tables in "complex" SQL statements. If inserts happen in a
table being read, the statements have no serialization order and the
change can therefore not be reproduced on the slave.


sql/sql_update.cc:
  Switching to using T_READ_NO_INSERT when the binlog is used.
sql/sql_yacc.yy:
  Switching to using T_READ_NO_INSERT when the binlog is used.
2005-02-15 11:02:01 +01:00
unknown
a8d2152f97 Bug#2435
Alter handling for UNION syntax
  Tests for UNION and parentheses


mysql-test/r/union.result:
  Bug#2435
    Tests for UNION and parentheses
mysql-test/t/union.test:
  Bug#2435
    Tests for UNION and parentheses
sql/sql_yacc.yy:
  Bug#2435
    Amend handling of UNION with parentheses.
2005-02-13 22:35:52 +00:00
unknown
d81a0bede2 Fix for BUG#8023.
Allow LIMIT clause after DUAL.


mysql-test/r/limit.result:
  Added test result for BUG#8023.
mysql-test/t/limit.test:
  Added test for BUG#8023.
sql/sql_yacc.yy:
  Allow the specification of a LIMIT clause after DUAL. This is needed for queries as:
  select a from t1 union all select 1 from dual limit 1;
  In this query LIMIT is applied to the whole UNION, so it makes sense, however, the
  current parser did not allow any clause after DUAL.
2005-02-02 08:38:24 +02:00
unknown
8deafa8037 order_by.result, order_by.test:
Added a test case for bug #7672.
sql_yacc.yy:
  Fixed bug #7672.
  Made queries of the form (SELECT ...) ORDER BY ... to
  be equivalent to SELECT ... ORDER BY ...


sql/sql_yacc.yy:
  Fixed bug #7672.
  Made queries of the form (SELECT ...) ORDER BY ... to
  be equivalent to SELECT ... ORDER BY ...
mysql-test/t/order_by.test:
  Added a test case for bug #7672.
mysql-test/r/order_by.result:
  Added a test case for bug #7672.
2005-01-25 14:30:38 -08:00
unknown
f9bcb9ab5c backported from 5.0 patch initialization of main select for commands where subqueries are possible 2005-01-17 19:52:07 +02:00
unknown
3de3be6710 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/dlenev/src/mysql-4.1-dtbug


sql/sql_yacc.yy:
  Auto merged
2005-01-14 10:09:01 +03:00
unknown
39ee25b374 Fix for bug #7418 "TIMESTAMP not always converted to DATETIME in MAXDB
mode".

Changed grammar rule for "type" token. Now we have one branch with 
optional length specification for TIMESTAMP type instead of two separate
branches.


mysql-test/r/type_timestamp.result:
  Added test case for bug #7418 "TIMESTAMP not always converted to DATETIME
  in MAXDB mode".
mysql-test/t/type_timestamp.test:
  Added test case for bug #7418 "TIMESTAMP not always converted to DATETIME
  in MAXDB mode".
sql/sql_yacc.yy:
  Changed rule for "type" token. Now we have one branch with optional
  length specification for TIMESTAMP type instead of two separate branches.
  This also gives us consistent behavior for TIMETSAMP in MAXDB mode.
2005-01-11 14:26:40 +03:00
unknown
2419fa2684 Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
This allows use to use INSERT IGNORE ... ON DUPLICATE ...


mysql-test/r/drop.result:
  safety fix
mysql-test/t/drop.test:
  safety fix
mysql-test/t/multi_update.test:
  ensure we cover all possible errors
sql/log_event.cc:
  Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
sql/log_event.h:
  Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
sql/mysql_priv.h:
  Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
sql/sql_class.h:
  Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
sql/sql_delete.cc:
  Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
sql/sql_insert.cc:
  Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
sql/sql_lex.cc:
  Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
sql/sql_lex.h:
  Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
sql/sql_load.cc:
  Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
sql/sql_parse.cc:
  Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
sql/sql_repl.cc:
  Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
sql/sql_repl.h:
  Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
sql/sql_select.cc:
  Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
sql/sql_table.cc:
  Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
sql/sql_union.cc:
  Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
sql/sql_update.cc:
  Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
sql/sql_yacc.yy:
  Remove DUP_IGNORE from enum_duplicates and instead use a separate ignore flag
2004-12-31 12:04:35 +02:00
unknown
46364ddb19 WL#2274 - INSERT..SELECT..UPDATE
UPDATE clause conflicts with SELECT for use of item_list field.
  Alter UPDATE clause to use new lex field update_list
  Tests included


mysql-test/r/insert_update.result:
  WL#2274
    New tests for INSERT..SELECT..UPDATE
mysql-test/t/insert_update.test:
  WL#2274
    New tests for INSERT..SELECT..UPDATE
sql/mysql_priv.h:
  Remove function - insert_select_precheck()
sql/sql_class.h:
  WL#2274
    New constructor for class select_insert
sql/sql_insert.cc:
  WL#2274
    Move code into mysql_prepare_insert
    Add checks as param values may be NULL
sql/sql_lex.cc:
  WL#2274
    initialize lex->update_list
sql/sql_lex.h:
  WL#2274
    New field in LEX: update_list
sql/sql_parse.cc:
  WL#2274
    INSERT..UPDATE clause now populates lex->update_list
    Remove redundant function: insert_select_precheck()
sql/sql_prepare.cc:
  WL#2274
    invoke insert_precheck() instead of insert_select_precheck()
sql/sql_yacc.yy:
  WL#2274
    Enable INSERT..SELECT..UPDATE syntax
    New rule - insert_update_list, to populate lex->update_list
2004-12-13 12:26:28 +00:00
unknown
af07ef79d4 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/dlenev/src/mysql-4.1-bg6765


sql/item_strfunc.cc:
  Auto merged
sql/log.cc:
  Auto merged
sql/mysql_priv.h:
  Auto merged
sql/mysqld.cc:
  Auto merged
sql/set_var.cc:
  Auto merged
sql/sql_acl.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/sql_class.cc:
  Auto merged
sql/sql_db.cc:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_update.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2004-12-09 13:33:12 +03:00
unknown
9ad51c631c Fix for bug #6765 "Implicit access to time zone description
tables requires privileges for them if some table or column level grants
present" (with after-review fixes).

We should set SELECT_ACL for implicitly opened tables in 
my_tz_check_n_skip_implicit_tables() to be able to bypass privilege
checking in check_grant(). Also we should exclude those tables from
privilege checking in multi-update.


mysql-test/r/timezone2.result:
  Extended test for bug #6116 "SET time_zone := ... requires access to
  mysql.time_zone tables"
  Added test for bug #6765 "Implicit access to time zone description 
  tables requires privileges for them if some table or column level grants
  present"
mysql-test/t/timezone2.test:
  Extended test for bug #6116 "SET time_zone := ... requires access to
  mysql.time_zone tables"
  Added test for bug #6765 "Implicit access to time zone description 
  tables requires privileges for them if some table or column level grants
  present"
sql/item_geofunc.cc:
  sql_acl.h is now included via mysql_priv.h
sql/item_strfunc.cc:
  sql_acl.h is now included via mysql_priv.h
sql/log.cc:
  sql_acl.h is now included via mysql_priv.h
sql/mysql_priv.h:
  Now we have to include sql_acl.h before tztime.h, since 
  my_tz_check_n_skip_implicit_tables() defined there requires
  SELECT_ACL constant defined in sql_acl.h.
sql/mysqld.cc:
  sql_acl.h is now included via mysql_priv.h
sql/repl_failsafe.cc:
  sql_acl.h is now included via mysql_priv.h
sql/set_var.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_acl.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_base.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_cache.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_class.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_db.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_derived.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_do.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_insert.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_parse.cc:
  check_one_table_access(): Tweaked comments.
  multi_update_precheck(): Added skipping of implicitly opened tables
    during privilege checking.
sql/sql_prepare.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_repl.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_show.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_update.cc:
  sql_acl.h is now included via mysql_priv.h
sql/sql_yacc.yy:
  sql_acl.h is now included via mysql_priv.h
sql/tztime.h:
  my_tz_check_n_skip_implicit_tables():
    We should set SELECT_ACL for implictly opened tables to be able to
    bypass privilege checking in check_grant().
2004-12-09 13:31:46 +03:00