Commit graph

11178 commits

Author SHA1 Message Date
unknown
40d596c200 Bug#29856: Insufficient buffer space led to a server crash.
The subst_spvars function is used to create query string with SP variables 
substituted with their values. This string is used later for the binary log
and for the query cache. The problem is that the
query_cache_send_result_to_client function requires some additional space
after the query to store database name and query cache flags. This 
space wasn't reserved by the subst_spvars function which led to a memory
corruption and crash.

Now the subst_spvars function reserves additional space for the query cache.


mysql-test/t/query_cache.test:
  Added a test case for the bug#29856: Insufficient buffer space led to a server crash.
mysql-test/r/query_cache.result:
  Added a test case for the bug#29856: Insufficient buffer space led to a server crash.
sql/sp_head.cc:
  Bug#29856: Insufficient buffer space led to a server crash.
  Now the subst_spvars function reserves additional space for the query cache.
2007-07-28 15:01:29 +04:00
unknown
0ce785538f Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/29878/my50-29878
2007-07-28 01:33:03 +05:00
unknown
421fa784be Merge adventure.(none):/home/thek/Development/cpp/bug29929/my50-bug29929
into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime
2007-07-27 17:32:45 +02:00
unknown
07955aea2d Bug #29929 LOCK TABLES does not pre-lock tables used in triggers of the locked tables
When a table was explicitly locked with LOCK TABLES no associated
tables from any related trigger on the subject table were locked.
As a result of this the user could experience unexpected locking
behavior and statement failures similar to "failed: 1100: Table'xx'
was not locked with LOCK TABLES".

This patch fixes this problem by making sure triggers are
pre-loaded on any statement if the subject table was explicitly
locked with LOCK TABLES.


mysql-test/r/sp-prelocking.result:
  Added test case
mysql-test/t/sp-prelocking.test:
  Added test case
sql/sql_lex.cc:
  - Moved some conditional logic out of the table iteration.
  - Added event map values for LOCK TABLE command.
sql/table.cc:
  - Refactored set_trg_event_tpye into the two simpler functions set_trg_event_map
    and set_trg_event_map as methods for manipulating the table event map.
    The original function was only called from st_lex::set_trg_event_type_for_tables
    so it was possible to move the event map creation logic to this function as
    a loop optimization.
sql/table.h:
  - Refactored set_trg_event_tpye into the two simpler functions set_trg_event_map
    and set_trg_event_map as methods for manipulating the table event map.
    The original function was only called from st_lex::set_trg_event_type_for_tables
    so it was possible to move the event map creation logic to this function as
    a loop optimization.
2007-07-27 16:56:29 +02:00
unknown
d27bf14ed7 Bug #29878 Garbage data generation when executing SESSION_USER() on a slave.
Item_func_user doesn't calculate anything in it's val_str() method,
just returns saved str_value.
Though Item::save_in_field method can destroy str_value, relying on
val_str() return. As a result we get the garbage stored in field.

We cannot use Item::save_in_field implementation for Item_func_user,
reimplement it in simpler way.


mysql-test/r/rpl_session_var.result:
  Bug #29878 Garbage data generation when executing SESSION_USER() on a slave.
  
  test result
mysql-test/t/rpl_session_var.test:
  Bug #29878 Garbage data generation when executing SESSION_USER() on a slave.
  
  test case
sql/item.cc:
  Bug #29878 Garbage data generation when executing SESSION_USER() on a slave.
  
  duplicating code moved to Item::save_str_in_field
sql/item.h:
  Bug #29878 Garbage data generation when executing SESSION_USER() on a slave.
  
  duplicating code moved to Item::save_str_in_field
sql/item_strfunc.h:
  Bug #29878 Garbage data generation when executing SESSION_USER() on a slave.
  
  Item_func_user::save_in_field implemented as simple storing str_value
2007-07-27 18:42:25 +05:00
unknown
0936976e8d A fix and a test case for Bug#24918 drop table and lock / inconsistent
between perm and temp tables. Review fixes.

The original bug report complains that if we locked a temporary table
with LOCK TABLES statement, we would not leave LOCK TABLES mode
when this temporary table is dropped.

Additionally, the bug was escalated when it was discovered than
when a temporary transactional table that was previously
locked with LOCK TABLES statement was dropped, futher actions with
this table, such as UNLOCK TABLES, would lead to a crash.

The problem originates from incomplete support of transactional temporary
tables. When we added calls to handler::store_lock()/handler::external_lock()
to operations that work with such tables, we only covered the normal
server code flow and did not cover LOCK TABLES mode. 
In LOCK TABLES mode, ::external_lock(LOCK) would sometimes be called without
matching ::external_lock(UNLOCK), e.g. when a transactional temporary table
was dropped. Additionally, this table would be left in the list of LOCKed 
TABLES.

The patch aims to address this inadequacy. Now, whenever an instance
of 'handler' is destroyed, we assert that it was priorly
external_lock(UNLOCK)-ed. All the places that violate this assert
were fixed.

This patch introduces no changes in behavior -- the discrepancy in
behavior will be fixed when we start calling ::store_lock()/::external_lock()
for all tables, regardless whether they are transactional or not, 
temporary or not.


mysql-test/r/innodb_mysql.result:
  Update test results (Bug#24918)
mysql-test/t/innodb_mysql.test:
  Add a test case for Bug#24918
sql/handler.h:
  Make handler::external_lock() a protected method. Backport from 5.1 its
  public wrapper handler::ha_external_lock().
  Assert that the handler is not closed if it is still locked.
sql/lock.cc:
  In mysql_lock_tables only call lock_external() for the list of tables that
  we called store_lock() for. 
  E.g. get_lock_data() does not add non-transactional temporary tables to the
  lock list, so lock_external() should not be called for them.
  
  Use handler::ha_external_lock() instead of handler::external_lock().
  
  Add comments for mysql_lock_remove(), parameterize one strange
  side effect that it has. At least in one place where mysql_lock_remove
  is used, this side effect is not desired (DROP TABLE). The parameter
  will be dropped in 5.1, along with the side effect.
sql/mysql_priv.h:
  Update declaration of mysql_lock_remove().
sql/opt_range.cc:
  Deploy handler::ha_external_lock() instead of handler::external_lock()
sql/sql_base.cc:
  When closing a temporary table, remove the table from the list of LOCKed 
  TABLES of this thread, in case it's there. 
  It's there if it is a transactional temporary table.
  Use a new declaration of mysql_lock_remove().
sql/sql_class.h:
  Extend the comment for THD::temporary_tables.
sql/sql_table.cc:
  Deploy handler::ha_external_lock() instead of handler::external_lock()
2007-07-27 16:37:29 +04:00
unknown
766725c502 Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.0-engines
into  mysql.com:/home/svoj/devel/mysql/BUG29957/mysql-5.0-engines
2007-07-27 14:36:43 +05:00
unknown
e92ce5d56c BUG#29957 - alter_table.test fails
INSERT/DELETE/UPDATE followed by ALTER TABLE within LOCK TABLES
may cause table corruption on Windows.

That happens because ALTER TABLE writes outdated shared state
info into index file.

Fixed by removing obsolete workaround.

Affects MyISAM tables on Windows only.


myisam/mi_extra.c:
  On windows when mi_extra(HA_EXTRA_PREPARE_FOR_DELETE) is called,
  we release external lock and close index file. If we're in LOCK
  TABLES, MyISAM state info doesn't get updated until UNLOCK TABLES.
  
  That means when we release external lock and we're in LOCK TABLES,
  we may write outdated state info.
  
  As SQL layer closes all table instances, we do not need this
  workaround anymore.
mysql-test/r/alter_table.result:
  A test case for BUG#29957.
mysql-test/t/alter_table.test:
  A test case for BUG#29957.
2007-07-27 14:30:25 +05:00
unknown
180068ddce save the data from mysql.db that we delete (side effect that made read_only fail) 2007-07-27 17:12:53 +10:00
unknown
b7eca8bc16 Merge xiphis.org:/anubis/antony/work/mysql-5.0-engines
into  xiphis.org:/anubis/antony/work/mysql-5.0-engines.merge
2007-07-26 07:56:37 -07:00
unknown
f2a91e55c8 Addendum to bug 29571: wait for INSERT DELAYED to finish on master 2007-07-26 16:59:21 +03:00
unknown
b50015f280 [PATCH] BUG#26793 test: mysqld crashes in NDB on I_S query
Reduce case and formalise into something we should be
able to use in mysql-test-run.

Index: ndb-work/mysql-test/t/ndb_bug26793.test
===================================================================


mysql-test/r/ndb_bug26793.result:
  BUG#26793 test: mysqld crashes in NDB on I_S query
mysql-test/t/ndb_bug26793.test:
  BUG#26793 test: mysqld crashes in NDB on I_S query
2007-07-26 20:24:54 +10:00
unknown
935ce76278 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B29571-5.0-opt


sql/sql_insert.cc:
  Auto merged
2007-07-26 11:32:27 +03:00
unknown
5babac539d Bug #29571: INSERT DELAYED IGNORE written to binary log on
the master but on the slave

MySQL can decide to "downgrade" a INSERT DELAYED statement
to normal insert in certain situations.
One such situation is when the slave is replaying a 
replication feed.
However INSERT DELAYED is logged even if there're no updates
whereas the NORMAL INSERT is not logged in such cases.

Fixed by always logging a "downgraded" INSERT DELAYED: even 
if there were no updates.


mysql-test/r/rpl_insert_delayed.result:
  Bug #29571: test case
mysql-test/t/rpl_insert_delayed.test:
  Bug #29571: test case
sql/sql_insert.cc:
  Bug #29571: log INSERT DELAYED even if it was 
  "downgraded" to INSERT (and there were no updates)
2007-07-26 11:31:10 +03:00
unknown
2df3b7b0ea Merge gleb.loc:/home/uchum/work/bk/5.0
into  gleb.loc:/home/uchum/work/bk/5.0-opt


mysql-test/t/create.test:
  Auto merged
sql/field.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
sql/table.cc:
  Auto merged
mysql-test/r/create.result:
  Merge with 5.0 (main).
2007-07-26 03:33:43 +05:00
unknown
b42247bca8 Bug#25679
"Federated Denial of Service"
  Federated storage engine used to attempt to open connections within
  the ::create() and ::open() methods which are invoked while LOCK_open
  mutex is being held by mysqld. As a result, no other client sessions
  can open tables while Federated is attempting to open a connection.
  Long DNS lookup times would stall mysqld's operation and a rogue
  connection string which connects to a remote server which simply
  stalls during handshake can stall mysqld for a much longer period of
  time.
  This patch moves the opening of the connection much later, when the
  federated actually issues queries, by which time the LOCK_open mutex is
  no longer being held.


mysql-test/r/federated.result:
  change of test/results due to patch for bug25679
mysql-test/t/federated.test:
  change of test/results due to patch for bug25679
sql/ha_federated.cc:
  bug25679
    remove function check_foreign_fata_source()
    ha_federated::open() no longer opens the federated connection.
    ha_federated::create() no longer opens and tests connection.
    ha_federated::real_connect() opens connection and tests presence of table.
    ha_federated::real_query() sends query, calling real_connect() if neccessary.
sql/ha_federated.h:
  bug25679
    new methods real_query() and real_connect()
2007-07-25 12:23:24 -07:00
unknown
2612fc43b5 Patch inspired by BUG#10491: Server returns data as charset
binary SHOW CREATE TABLE or SELECT FROM I_S.

The problem is that mysqldump generates incorrect dump for a table
with non-ASCII column name if the mysqldump's character set is
ASCII.

The fix is to:
  1. Switch character_set_client for the mysqldump's connection
  to binary before issuing SHOW CREATE TABLE statement in order
  to avoid conversion.
  
  2. Dump switch character_set_client statements to UTF8 and back
  for CREATE TABLE statement.


client/mysqldump.c:
  1. Switch character_set_client for the mysqldump's connection
  to binary before issuing SHOW CREATE TABLE statement in order
  to avoid conversion.
  
  2. Dump switch character_set_client statements to UTF8 and back
  for CREATE TABLE statement.
mysql-test/r/mysqldump-max.result:
  Update result file.
mysql-test/r/mysqldump.result:
  Update result file.
mysql-test/r/openssl_1.result:
  Update result file.
mysql-test/r/show_check.result:
  Update result file.
mysql-test/t/show_check.test:
  Test case:
    - create a table with non-ASCII column name;
    - dump the database by mysqldump using ASCII character set;
    - drop the database;
    - load the dump;
    - check that the table has been re-created properly.
2007-07-25 19:46:50 +04:00
unknown
1370b325c6 Merge ramayana.hindu.god:/home/tsmith/m/bk/50
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/jul24/50


sql/sql_table.cc:
  Auto merged
2007-07-24 16:12:23 -06:00
unknown
c4d53e31b0 Bug#15130: CREATE .. SELECT was denied to use advantages of the SQL_BIG_RESULT.
When the SQL_BIG_RESULT flag is specified SELECT should store items from the
select list in the filesort data and use them when sending to a client.
The get_addon_fields function is responsible for creating necessary structures
for that. But this function was allowed to do so only for SELECT and
INSERT .. SELECT queries. This makes the SQL_BIG_RESULT useless for
the CREATE .. SELECT queries.

Now the get_addon_fields allows storing select list items in the filesort
data for the CREATE .. SELECT queries.


mysql-test/t/create.test:
  Added a test case for the bug#15130: CREATE .. SELECT was denied to use
  advantages of the SQL_BIG_RESULT.
mysql-test/r/create.result:
  Added a test case for the bug#15130: CREATE .. SELECT was denied to use
  advantages of the SQL_BIG_RESULT.
sql/filesort.cc:
  Bug#15130: CREATE .. SELECT was denied to use advantages of the SQL_BIG_RESULT.
  Now the get_addon_fields allows storing select list items in the filesort
  data for the CREATE .. SELECT queries.
2007-07-24 18:15:44 +04:00
unknown
594d71a449 Merge xiphis.org:/anubis/antony/work/p2-bug25714.1
into  xiphis.org:/anubis/antony/work/p2-bug25714.1.merge-5.0
2007-07-23 23:57:50 -07:00
unknown
0f85ae9f2c Bug#25714
"getGeneratedKeys() does not work with FEDERATED table"
  mysql_insert() expected the storage engine to update the row data
  during the write_row() operation with the value of the new auto-
  increment field. The field must be updated when only one row has
  been inserted as mysql_insert() would ignore the thd->last_insert.
  This patch implements HA_STATUS_AUTO support in ha_federated::info()
  and ensures that ha_federated::write_row() does update the row's
  auto-increment value.
  The test case was written in C as the protocol's 'id' value is
  accessible through libmysqlclient and not via SQL statements.
  mysql-test-run.pl was extended to enable running the test binary.


mysql-test/mysql-test-run.pl:
  bug25714
    implement support to run C test for bug25714
sql/ha_federated.cc:
  bug25714
    The storage engine instance property auto_increment_value was not
    being set.
    mysql_insert() requires that the storage engine updates the row with
    the auto-increment value, especially when only inserting one row.
    Implement support for ha_federated::info(HA_STATUS_AUTO)
tests/Makefile.am:
  bug25714
    build C test for bug
mysql-test/include/have_bug25714.inc:
  New BitKeeper file ``mysql-test/include/have_bug25714.inc''
mysql-test/r/federated_bug_25714.result:
  New BitKeeper file ``mysql-test/r/federated_bug_25714.result''
mysql-test/r/have_bug25714.require:
  New BitKeeper file ``mysql-test/r/have_bug25714.require''
mysql-test/t/federated_bug_25714.test:
  New BitKeeper file ``mysql-test/t/federated_bug_25714.test''
tests/bug25714.c:
  New BitKeeper file ``tests/bug25714.c''
2007-07-23 23:35:43 -07:00
unknown
c29002a5b6 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B29644-5.0-opt


sql/ha_innodb.cc:
  Auto merged
sql/sql_base.cc:
  Auto merged
mysql-test/r/innodb_mysql.result:
  5.0-opt merge
mysql-test/t/innodb_mysql.test:
  5.0-opt merge
2007-07-23 17:07:29 +03:00
unknown
d50caace5f Fixed bug #29611.
If a primary key is defined over column c of enum type then 
the EXPLAIN command for a look-up query of the form
  SELECT * FROM t WHERE c=0
said that the query was with an impossible where condition though the
query correctly returned non-empty result set when the table indeed 
contained rows with error empty strings for column c. 

This kind of misbehavior was due to a bug in the function 
Field_enum::store(longlong,bool) that erroneously returned 1 if
the the value to be stored was equal to 0. 
Note that the method 
Field_enum::store(const char *from,uint length,CHARSET_INFO *cs)
correctly returned 0 if a value of the error empty string 
was stored. 


mysql-test/r/type_enum.result:
  Added a test case for bug #29661.
mysql-test/t/type_enum.test:
  Added a test case for bug #29661.
sql/field.cc:
  Fixed bug #29611.
  If a primary key was defined over column c of enum type then 
  the EXPLAIN command for a look-up query of the form
    SELECT * FROM t WHERE c=0
  said that the query was with an impossible where condition though the
  query correctly returned non-empty result set when the table indeed 
  contained rows with error empty strings for column c. 
  
  This kind of misbehavior was due to a bug in the function 
  Field_enum::store(longlong,bool) that erroneously returned 1 if
  the the value to be stored was equal to 0. 
  Note that the method 
  Field_enum::store(const char *from,uint length,CHARSET_INFO *cs)
  correctly returned 0 if a value of the error empty string 
  was stored.
2007-07-22 18:26:16 -07:00
unknown
0a6543687c Merge chilla.local:/home/mydev/mysql-5.0-amain
into  chilla.local:/home/mydev/mysql-5.0-axmrg


sql/sql_table.cc:
  Auto merged
2007-07-22 19:08:25 +02:00
unknown
240bb90ef1 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B28951-5.0-opt


mysql-test/t/innodb_mysql.test:
  Auto merged
sql/sql_select.cc:
  Auto merged
sql/table.cc:
  Auto merged
mysql-test/r/innodb_mysql.result:
  merge of 5.0-opt
2007-07-22 19:23:29 +03:00
unknown
5f0036eb9f Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  olga.mysql.com:/home/igor/mysql-5.0-opt
2007-07-21 15:46:02 -07:00
unknown
9260c30d36 Merge gleb.loc:/home/uchum/work/bk/5.0-opt-29338
into  gleb.loc:/home/uchum/work/bk/5.0-opt


mysql-test/r/sp.result:
  Auto merged
mysql-test/t/sp.test:
  Merge with local tree.
2007-07-22 01:52:13 +05:00
unknown
9cad4f08db sp.test, sp.result:
Additional test case fix for bug #29338.


mysql-test/t/sp.test:
  Additional test case fix for bug #29338.
mysql-test/r/sp.result:
  Additional test case fix for bug #29338.
2007-07-22 01:49:41 +05:00
unknown
7507cbaaf0 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug29911
2007-07-21 13:36:33 -07:00
unknown
aed9a5fee3 Merge gleb.loc:/home/uchum/work/bk/5.0-opt-29338
into  gleb.loc:/home/uchum/work/bk/5.0-opt


mysql-test/r/sp.result:
  Merge with local tree
mysql-test/t/sp.test:
  Merge with local tree
2007-07-22 00:40:14 +05:00
unknown
3520da5b25 Merge olga.mysql.com:/home/igor/dev-opt/mysql-4.1-opt-bug29911
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug29911


mysql-test/t/having.test:
  Auto merged
sql/sql_select.cc:
  Auto merged
mysql-test/r/having.result:
  SCCS merged
2007-07-21 12:34:18 -07:00
unknown
be7b4043b9 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.(none):/opt/local/work/mysql-5.0-runtime


mysql-test/r/create.result:
  Auto merged
mysql-test/t/create.test:
  Auto merged
sql/sql_class.h:
  Auto merged
2007-07-21 17:52:16 +04:00
unknown
72c6c789cf Fixed bug #29911.
This bug manifested itself for join queries with GROUP BY and HAVING clauses
whose SELECT lists contained DISTINCT. It occurred when the optimizer could
deduce that the result set would have not more than one row.
The bug could lead to wrong result sets for queries of this type because
HAVING conditions were erroneously ignored in some cases in the function
remove_duplicates.   


mysql-test/r/having.result:
  Added a test case for bug #29911.
mysql-test/t/having.test:
  Added a test case for bug #29911.
2007-07-20 22:56:19 -07:00
unknown
4049faa492 Merge gleb.loc:/home/uchum/work/bk/5.0-opt-29788
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-07-21 05:15:16 +05:00
unknown
cff531ffc1 Fixed bug #29788.
After dumping triggers mysqldump copied 
the value of the OLD_SQL_MODE variable to the SQL_MODE
variable. If the --compact option of the mysqldump was
not set the OLD_SQL_MODE variable had the value
of the uninitialized SQL_MODE variable. So
usually the NO_AUTO_VALUE_ON_ZERO option of the
SQL_MODE variable was discarded.

This fix is for non-"--compact" mode of the mysqldump,
because mysqldump --compact never set SQL_MODE to the
value of NO_AUTO_VALUE_ON_ZERO.

The dump_triggers_for_table function has been modified
to restore previous value of the SQL_MODE variable after
dumping triggers using the SAVE_SQL_MODE temporary
variable.


client/mysqldump.c:
  Fixed bug #29788.
  The dump_triggers_for_table function has been modified
  to restore previous value of the SQL_MODE variable after
  dumping triggers using the SAVE_SQL_MODE temporary
  variable.
mysql-test/r/mysqldump.result:
  Updated test case for bug #29788.
mysql-test/t/mysqldump.test:
  Updated test case for bug #29788.
2007-07-21 04:50:11 +05:00
unknown
524a40a982 Merge chilla.local:/home/mydev/mysql-5.0-amain
into  chilla.local:/home/mydev/mysql-5.0-axmrg
2007-07-21 01:34:55 +02:00
unknown
4ae56e219d Merge chilla.local:/home/mydev/mysql-5.0-ateam
into  chilla.local:/home/mydev/mysql-5.0-axmrg
2007-07-21 01:33:25 +02:00
unknown
95a8c6c327 Bug #28591: MySQL need not sort the records in case of
ORDER BY primary_key on InnoDB table

Queries that use an InnoDB secondary index to retrieve
data don't need to sort in case of ORDER BY primary key
if the secondary index is compared to constant(s).
They can also skip sorting if ORDER BY contains both the
the secondary key parts and the primary key parts (in
that order).
This is because InnoDB returns the rows in order of the
primary key for rows with the same values of the secondary
key columns.
Fixed by preventing temp table sort for the qualifying 
queries.


mysql-test/r/innodb_mysql.result:
  Bug #28591: test case
mysql-test/t/innodb_mysql.test:
  Bug #28591: test case
sql/sql_select.cc:
  Bug #28591: Use the primary key as suffix when testing
  if the key can be used for ORDER BY on supporting engines.
sql/table.cc:
  Bug #28591: can use the primary key
  as a suffix for the secondary keys
2007-07-20 21:05:29 +03:00
unknown
d758b1e629 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/29898-bug-5.0-opt-mysql
2007-07-20 22:05:20 +04:00
unknown
eea5c2a3c5 Bug #29644: alter table hangs if records locked in share mode
by long running transaction

On Windows opened files can't be deleted. There was a special
upgraded lock mode (TL_WRITE instead of TL_WRITE_ALLOW_READ) 
in ALTER TABLE to make sure nobody has the table opened
when deleting the old table in ALTER TABLE. This special mode
was causing ALTER TABLE to hang waiting on a lock inside InnoDB.
This special lock is no longer necessary as the server is 
closing the tables it needs to delete in ALTER TABLE.
Fixed by removing the special lock.
Note that this also reverses the fix for bug 17264 that deals with
another consequence of this special lock mode being used.


mysql-test/r/innodb_mysql.result:
  Bug #29644: test case
mysql-test/t/innodb_mysql.test:
  Bug #29644: test case
sql/ha_innodb.cc:
  Bug #29644: reverse the (now excessive) fix
  for bug 17264 (but leave the test case).
sql/sql_base.cc:
  Bug #29644: don't need a special lock mode for Win32 anymore: 
  the table is closed before the drop.
2007-07-20 14:17:15 +03:00
unknown
91e5864d70 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/home/ram/work/b28125/b28125.5.0


mysql-test/t/innodb_mysql.test:
  Auto merged
mysql-test/r/innodb_mysql.result:
  manual merge.
2007-07-20 15:23:35 +05:00
unknown
db31d3c96d Merge gleb.loc:/home/uchum/work/bk/5.0
into  gleb.loc:/home/uchum/work/bk/5.0-opt


sql/set_var.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
2007-07-20 04:15:50 +05:00
unknown
a131428f04 Bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag.
The Item_date_typecast::val_int function doesn't reset null_value flag.
This makes all values that follows the first null value to be treated as nulls
and led to a wrong result.

Now the Item_date_typecast::val_int function correctly sets the null_value flag
for both null and non-null values.


mysql-test/t/cast.test:
  Added a test case for the bug#29898:  Item_date_typecast::val_int doesn't reset
  the null_value flag.
mysql-test/r/cast.result:
  Added a test case for the bug#29898:  Item_date_typecast::val_int doesn't reset
  the null_value flag.
sql/item_timefunc.cc:
  Bug#29898: Item_date_typecast::val_int doesn't reset the null_value flag.
  Now the Item_date_typecast::val_int function correctly sets the null_value flag
  for both null and non-null values.
2007-07-20 00:06:35 +04:00
unknown
6a5fff64a3 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint


mysql-test/t/federated.test:
  Auto merged
sql/ha_federated.h:
  Auto merged
mysql-test/r/federated.result:
  Manual merge.
2007-07-19 15:33:27 -04:00
unknown
99af63e53d Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug26909/my50-bug26909
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
2007-07-19 15:30:49 -04:00
unknown
d0020607b3 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/29850-bug-5.0-opt-mysql
2007-07-19 21:40:12 +04:00
unknown
04aba6ec5d Merge damien-katzs-computer.local:/Users/dkatz/mysql50
into  damien-katzs-computer.local:/Users/dkatz/50
2007-07-19 13:27:31 -04:00
unknown
7f6a816484 Bug#29850: Wrong charset of GROUP_CONCAT result when the select employs
a temporary table.

The result string of the Item_func_group_concat wasn't initialized in the 
copying constructor of the Item_func_group_concat class. This led to a
wrong charset of GROUP_CONCAT result when the select employs a temporary
table.

The copying constructor of the Item_func_group_concat class now correctly
initializes the charset of the result string.


mysql-test/t/func_gconcat.test:
  Added a test case for the bug#29850: Wrong charset of the GROUP_CONCAT result
  when the select employs a temporary table.
mysql-test/r/func_gconcat.result:
  Added a test case for the bug#29850: Wrong charset of the GROUP_CONCAT result
  when the select employs a temporary table.
sql/item_sum.cc:
  Bug#29850: Wrong charset of GROUP_CONCAT result when the select employs
  a temporary table.
  The copying constructor of the Item_func_group_concat class now correctly
  initializes the charset of the result string.
2007-07-19 20:21:23 +04:00
unknown
c865b22514 Merge gleb.loc:/home/uchum/work/bk/5.0
into  gleb.loc:/home/uchum/work/bk/5.0-opt


sql/ha_myisam.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2007-07-19 19:57:53 +05:00
unknown
36f1e4848c Fixed bug #29338.
Optimization of queries with DETERMINISTIC functions in the
WHERE clause was not effective: sequential scan was always
used.
Now a SF with the DETERMINISTIC flags is treated as constant
when it's arguments are constants (or a SF doesn't has arguments).


sql/item_func.h:
  Fixed bug #29338.
  The Item_func_sp::used_tables has been removed
  (virtual Item_func::used_tables function is enough).
  The virtual Item_func_sp::update_used_tables function
  has been added.
sql/item_func.cc:
  Fixed bug #29338.
  The Item_func_sp::update_used_tables and the
  Item_func_sp::fix_field functions have been modified
  to take into account the DETERMINISTIC flag of SF definition.
mysql-test/r/sp.result:
  Updated test case for bug #29338.
mysql-test/t/sp.test:
  Updated test case for bug #29338.
2007-07-19 18:39:01 +05:00
unknown
2486c23ca6 BUG#26325 - TEMPORARY TABLE "corrupt" after first read, according
to CHECK TABLE

CHECK/REPAIR TABLE reports "File not found" error when issued
against temporary table.

Fixed by disabling a brunch of code (in case it gets temporary table)
that is responsible for updating frm version as it is not needed
for temporary tables.


mysql-test/r/check.result:
  A test case for BUG#26325.
mysql-test/t/check.test:
  A test case for BUG#26325.
sql/handler.cc:
  No need to update frm version in case table was created or checked
  by server with the same version. This also ensures that we do not
  update frm version for temporary tables as this code doesn't support
  temporary tables.
2007-07-19 13:51:31 +05:00
unknown
8b59beaebe Merge gleb.loc:/home/uchum/work/bk/5.0-opt-28524
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-07-19 10:54:39 +05:00
unknown
8b8b430bbc Bug#26909: Specified key was too long; max key length is 255 bytes \
when creating table

Federated tables had an artificially low maximum of key length, 
because the handler failed to implement a method to return it and 
the default value is taked from the prototype handler.

Now, implement that method and return the maximum possible key
length, which is that of InnoDB.


mysql-test/r/federated.result:
  Verify that unique keys may be longer than 255 characters.
mysql-test/t/federated.test:
  Verify that unique keys may be longer than 255 characters.
sql/ha_federated.h:
  Implement the virtual method that tells the max size of parts to 
  make a key.
  
  Backport the length defined in 5.1.
2007-07-18 14:03:58 -04:00
unknown
2bfe84d434 Fixed bug #28524.
For each view the mysqldump utility creates a temporary table
with the same name and the same columns as the view 
in order to satisfy views that depend on this view.
After the creation of all tables, mysqldump drops all
temporary tables and creates actual views.
However, --skip-add-drop-table and --compact flags disable
DROP TABLE statements for those temporary tables. Thus, it was
impossible to create the views because of existence of the
temporary tables with the same names.


client/mysqldump.c:
  Fixed bug #28524.
  The mysqldump utility has been modified to unconditionally drop
  temporary tables before the creation of views.
mysql-test/t/mysqldump.test:
  Updated test case for bug #28524 and updated result of previous tests.
mysql-test/r/mysqldump.result:
  Updated test case for bug #28524 and updated result of previous tests.
2007-07-18 19:14:48 +05:00
unknown
6981af6ff5 Add a test case for Bug#22427 create table if not exists + stored
function results in inconsistent behavior.

The bug itself was fixed by the patch for bug 20662.


mysql-test/r/sp-prelocking.result:
  Update results (Bug#22427)
mysql-test/t/sp-prelocking.test:
  Add a test case for Bug#22427 create table if not exists + stored 
  function results in inconsistent behavior
2007-07-18 17:09:03 +04:00
unknown
c0277a1192 A fix and a test case for Bug#26104 Bug on foreign key class constructor.
Fix the typo in the constructor. Cover a semantic check that previously
never worked with a test.


mysql-test/r/create.result:
  Update results (Bug#26104)
mysql-test/r/innodb.result:
  Update results.
mysql-test/t/create.test:
  Add a test case for Bug#26104 Bug on foreign key class constructor
mysql-test/t/innodb.test:
  Return a new error number (MySQL error instead of internal InnoDB error).
sql/sql_class.h:
  A fix for Bug#26104 Bug on foreign key class constructor -- fix
  the typo in the constructor
2007-07-18 16:22:05 +04:00
unknown
5f462f9626 Add a test case for Bug#27248 Triggers: error if insert affects temporary
table.
The bug itself is yet another manifestation of Bug 26141.


mysql-test/r/trigger.result:
  Update results.
mysql-test/t/trigger.test:
  Add a test case for Bug#27248 Triggers: error if insert affects temporary
  table
2007-07-18 14:42:06 +04:00
unknown
6947f2d131 Fix for bug #28125: ERROR 2013 when adding index.
Problem: we may break a multibyte char sequence using a key 
reduced to maximum allowed length for a storage engine
(that leads to failed assertion in the innodb code, 
see also #17530). 

Fix: align truncated key length to multibyte char boundary.


mysql-test/r/innodb_mysql.result:
  Fix for bug #28125: ERROR 2013 when adding index.
    - test result.
mysql-test/t/innodb_mysql.test:
  Fix for bug #28125: ERROR 2013 when adding index.
    - test case.
sql/sql_table.cc:
  Fix for bug #28125: ERROR 2013 when adding index.
    - align truncated key length to multibyte char boundary.
    - display real key length in bytes raising warnings.
2007-07-18 12:13:45 +05:00
unknown
475eac91ce Bug #29784 YaSSL assertion failure when reading 8k key.
Fixed the yassl base64 decoding to correctly allocate a maximum decoded buffer size. 


mysql-test/std_data/server8k-cert.pem:
  BitKeeper file /Users/dkatz/50/mysql-test/std_data/server8k-cert.pem
mysql-test/std_data/server8k-key.pem:
  BitKeeper file /Users/dkatz/50/mysql-test/std_data/server8k-key.pem
extra/yassl/taocrypt/src/coding.cpp:
  Fixed buffer allocation to compute the proper maximum decoded size: (EncodedLength * 3/4) + 3
mysql-test/r/ssl_8k_key.result:
  New BitKeeper file ``mysql-test/r/ssl_8k_key.result''
  
  Test connection to server using large SSL key.
mysql-test/t/ssl_8k_key.test:
  New BitKeeper file ``mysql-test/t/ssl_8k_key.test''
  
  Test connection to server using large SSL key.
2007-07-17 14:43:56 -04:00
unknown
91301448e9 Merge ramayana.hindu.god:/home/tsmith/m/bk/50
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/50


sql/mysql_priv.h:
  Auto merged
2007-07-17 11:32:50 -06:00
unknown
b94fb82847 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.(none):/opt/local/work/mysql-5.0-runtime


mysql-test/t/sp.test:
  Auto merged
sql/item.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_show.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Manual merge.
mysql-test/t/innodb_mysql.test:
  Manual merge.
2007-07-16 23:41:28 +04:00
unknown
6e078ff543 Extended fix for the bug#29555.
The get_time_value function is added. It is used to obtain TIME values both
from items the can return time as an integer and from items that can return
time only as a string.
The Arg_comparator::compare_datetime function now uses pointer to a getter
function to obtain values to compare. Now this function is also used for
comparison of TIME values.
The get_value_func variable is added to the Arg_comparator class.
It points to a getter function for the DATE/DATETIME/TIME comparator.


mysql-test/t/type_time.test:
  Extended test case for the bug#29555.
mysql-test/r/type_time.result:
  Extended test case for the bug#29555.
sql/item_cmpfunc.cc:
  Extended fix for the bug#29555.
  The get_time_value function is added. It is used to obtain TIME values both
  from items the can return time as an integer and from items that can return
  time only as a string.
  The Arg_comparator::compare_datetime function now uses pointer to a getter
  function to obtain values to compare. Now this function is also used for
  comparison of TIME values.
sql/item_cmpfunc.h:
  Extended fix for the bug#29555.
  The get_value_func variable is added to the Arg_comparator class.
  It points to a getter function for the DATE/DATETIME/TIME comparator.
2007-07-15 21:51:36 +04:00
unknown
8023d91929 Add a teste case for Bug#27296 "Assertion in ALTER TABLE SET DEFAULT in
Linux Debug build (possible deadlock)"

The bug is not repeatable any more.


mysql-test/r/innodb_mysql.result:
  Update test results (Bug#27296)
mysql-test/t/innodb_mysql.test:
  Add a teste case for Bug#27296 "Assertion in ALTER TABLE SET DEFAULT in 
  Linux Debug build (possible deadlock)"
2007-07-15 13:34:35 +04:00
unknown
4b7e6a3842 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/29729-bug-5.0-opt-mysql
2007-07-14 23:30:07 +04:00
unknown
4f146f656c Bug#29729: Wrong conversion error led to an empty result set.
The Field_newdate::store when storing a DATETIME value was returning the
'value was cut' error even if the thd->count_cuted_fields flag is set to
CHECK_FIELD_IGNORE. This made range optimizr think that there is no
appropriate data in the table and thus to return an empty set.

Now the Field_newdate::store function returns conversion error only if the
thd->count_cuted_fields flag isn't set to CHECK_FIELD_IGNORE.


mysql-test/t/type_time.test:
  Added a test case for the bug#29729: Wrong conversion error led to an empty result set.
mysql-test/r/type_time.result:
  Added a test case for the bug#29729: Wrong conversion error led to an empty result set.
sql/field.cc:
  Bug#29729: Wrong conversion error led to an empty result set.
2007-07-14 22:43:58 +04:00
unknown
25545b4bfb BUG#29740: Make the test result deterministic 2007-07-14 22:02:10 +04:00
unknown
a90ccb1bae Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/psergey/mysql-5.0-bug29740
2007-07-14 20:31:59 +04:00
unknown
8c56d8e89c Merge olga.mysql.com:/home/igor/mysql-5.0-rpl
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-merge
2007-07-13 19:05:30 -07:00
unknown
85603b2e0b Merge gleb.loc:/home/uchum/work/bk/5.0
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-07-13 20:49:21 +05:00
unknown
38f4c6137a BUG#29740: Wrong query results for index_merge/union over HEAP table.
- return HA_KEY_SCAN_NOT_ROR flag for HASH indexes;
- Fix ha_heap::cmp_ref() to work with BTREE index scans.


mysql-test/r/index_merge.result:
  BUG#29740: testcase
mysql-test/t/index_merge.test:
  BUG#29740: testcase
sql/ha_heap.h:
  BUG#29740: Wrong query results for index_merge/union over HEAP table.
  - make HEAP table engine return HA_KEY_SCAN_NOT_ROR flag for HASH 
    indexes,as HASH index does not guarantee any ordering for rows
    within the hash bucket.
  - Fix BTREE indexes: make ha_heap::cmp_ref() compare the rowids in the 
    same way as ha_key_cmp() does.
sql/opt_range.cc:
  BUG#29740: Fix comment about ROR scans.
2007-07-13 19:13:40 +04:00
unknown
2a0498c0f9 disabled the output of the full path in tesing bug 29325 2007-07-13 16:32:29 +03:00
unknown
b806ca22c6 Bug 29325: moved the test from create_not_windows to symlink. 2007-07-13 13:56:22 +03:00
unknown
4bbeef1c12 Minor fixes for test failures and compiler warnings for Bug #29579.
BitKeeper/deleted/.del-ssl_big.test:
  Delete: mysql-test/t/ssl_big.test
extra/yassl/include/yassl_int.hpp:
  added comment
extra/yassl/src/yassl_int.cpp:
  Changed init order to fix a compiler warning.
mysql-test/r/mysqltest.result:
  There is no limit to connections anymore.
mysql-test/t/mysqltest.test:
  There is no limit to connections anymore.
2007-07-13 00:45:54 -04:00
unknown
91112d124e Merge damien-katzs-computer.local:/Users/dkatz/mysql50
into  damien-katzs-computer.local:/Users/dkatz/50
2007-07-12 22:19:07 -04:00
unknown
b7527f6b72 Bug #29579 Clients using SSL can hang the server
Added an option to yassl to allow "quiet shutdown" like openssl does. This option causes the SSL libs to NOT perform the close_notify handshake during shutdown. This fixes a hang we experience because we hold a lock during socket shutdown.


mysql-test/t/ssl_big.test:
  BitKeeper file /Users/dkatz/50/mysql-test/t/ssl_big.test
mysql-test/r/ssl-big.result:
  BitKeeper file /Users/dkatz/50/mysql-test/r/ssl-big.result
client/mysqltest.c:
  Added new command to mysqltest to send a quit command to the server, but to not close the actual socket on our end.
  
  Also changed code to reuse connection slots, so that the tests can open and close sockets in a loop.
extra/yassl/include/openssl/ssl.h:
  Added C accessors to the quietShutdown option.
extra/yassl/include/yassl_int.hpp:
  Added quietShutdown_ member and accessor methods to the SSL class.
extra/yassl/src/ssl.cpp:
  Added accessors to get/set the quietShutdown option and to not perform the shutdown handshake if quietShutdown is set.
extra/yassl/src/yassl_int.cpp:
  Added quietShutdown_ member and accessor methods to the SSL class.
vio/viossl.c:
  Added line to set the quiet_shutdown option before shutting down the socket.
mysql-test/t/ssl-big.test:
  Added a test that causes an unpatched server to hang during SSL socket shutdown.
2007-07-12 22:06:33 -04:00
unknown
e08e63b192 Bug#29739: Incorrect time comparison in BETWEEN.
Time values were compared by the BETWEEN function as strings. This led to a
wrong result in cases when some of arguments are less than 100 hours and other
are greater.

Now if all 3 arguments of the BETWEEN function are of the TIME type then
they are compared as integers.


mysql-test/t/type_time.test:
  Added a tes tcase for the bug#29739: Incorrect time comparison in BETWEEN.
mysql-test/r/type_time.result:
  Added a tes tcase for the bug#29739: Incorrect time comparison in BETWEEN.
sql/item_cmpfunc.cc:
  Bug#29739: Incorrect time comparison in BETWEEN.
  Now if all 3 arguments of the BETWEEN function are of the TIME type then
  they are compared as integers.
2007-07-12 23:09:55 +04:00
unknown
1d40659c1f Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  bodhi.(none):/opt/local/work/mysql-5.0-26141-final


sql/sql_yacc.yy:
  Auto merged
2007-07-12 22:28:13 +04:00
unknown
9dc3088f9e A fix and a test case for Bug#26141 mixing table types in trigger
causes full table lock on innodb table.
Also fixes Bug#28502 Triggers that update another innodb table 
will block on X lock unnecessarily (duplciate).
Code review fixes.

Both bugs' synopses are misleading: InnoDB table is
not X locked. The statements, however, cannot proceed concurrently, 
but this happens due to lock conflicts for tables used in triggers,
not for the InnoDB table. 

If a user had an InnoDB table, and two triggers, AFTER UPDATE and 
AFTER INSERT, competing for different resources (e.g. two distinct
MyISAM tables), then these two triggers would not be able to execute
concurrently. Moreover, INSERTS/UPDATES of the InnoDB table would
not be able to run concurrently. 
The problem had other side-effects (see respective bug reports).

This behavior was a consequence of a shortcoming of the pre-locking
algorithm, which would not distinguish between different DML operations
(e.g. INSERT and DELETE) and pre-lock all the tables
that are used by any trigger defined on the subject table.

The idea of the fix is to extend the pre-locking algorithm to keep track,
for each table, what DML operation it is used for and not
load triggers that are known to never be fired.


mysql-test/r/trigger-trans.result:
  Update results (Bug#26141)
mysql-test/r/trigger.result:
  Update results (Bug#28502)
mysql-test/t/trigger-trans.test:
  Add a test case for Bug#26141 mixing table types in trigger causes 
  full table lock on innodb table.
mysql-test/t/trigger.test:
  Add a test case for Bug#28502 Triggers that update another innodb 
  table will block echo on X lock unnecessarily. Add more test 
  coverage for triggers.
sql/item.h:
  enum trg_event_type is needed in table.h
sql/sp.cc:
  Take into account table_list->trg_event_map when determining
  what tables to pre-lock. 
  
  After this change, if we attempt to fire a 
  trigger for which we had not pre-locked any tables, error
  'Table was not locked with LOCK TABLES' will be printed.
  This, however, should never happen, provided the pre-locking
  algorithm has no programming bugs.
  
  Previously a trigger key in the sroutines hash was based on the name 
  of the table the trigger belongs to. This was possible because we would
  always add to the pre-locking list all the triggers defined for a table when
  handling this table.
  Now the key is based on the name of the trigger, owing
  to the fact that a trigger name must be unique in the database it
  belongs to.
sql/sp_head.cc:
  Generate sroutines hash key in init_spname(). This is a convenient
  place since there we have all the necessary information and can
  avoid an extra alloc.
  
  Maintain and merge trg_event_map when adding and merging elements
  of the pre-locking list.
sql/sp_head.h:
  Add ,m_sroutines_key member, used when inserting the sphead for a
  trigger into the cache of routines used by a statement.
  Previously the key was based on the table name the trigger belonged
  to, since for a given table we would add to the sroutines list
  all the triggers defined on it.
sql/sql_lex.cc:
  Introduce a new lex step: set_trg_event_type_for_tables().
  It is called when we have finished parsing but before opening
  and locking tables. Now this step is used to evaluate for each
  TABLE_LIST instance which INSERT/UPDATE/DELETE operation, if any,
  it is used in.
  In future this method could be extended to aggregate other information
  that is hard to aggregate during parsing.
sql/sql_lex.h:
  Add declaration for set_trg_event_type_for_tables().
sql/sql_parse.cc:
  Call set_trg_event_type_for_tables() after MYSQLparse(). Remove tabs.
sql/sql_prepare.cc:
  Call set_trg_event_type_for_tables() after  MYSQLparse().
sql/sql_trigger.cc:
  Call set_trg_event_type_for_tables() after MYSQLparse().
sql/sql_trigger.h:
  Remove an obsolete member.
sql/sql_view.cc:
  Call set_trg_event_type_for_tables() after MYSQLparse().
sql/sql_yacc.yy:
  Move assignment of sp_head::m_type before calling sp_head::init_spname(), 
  one is now used inside another.
sql/table.cc:
  Implement TABLE_LIST::set_trg_event_map() - a method that calculates
  wh triggers may be fired on this table when executing a statement.
sql/table.h:
  Add missing declarations.
  Move declaration of trg_event_type from item.h (it will be needed for 
  trg_event_map bitmap when we start using Bitmap template instead
  of uint8).
2007-07-12 22:26:41 +04:00
unknown
5529b14f7a Merge kpettersson@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime
2007-07-12 15:38:23 +02:00
unknown
5ee37c1439 Merge adventure.(none):/home/thek/Development/cpp/bug28249/my50-bug28249
into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime


mysql-test/t/query_cache.test:
  Auto merged
sql/ha_myisam.cc:
  Auto merged
sql/handler.h:
  Auto merged
mysql-test/r/query_cache.result:
  SCCS merged
2007-07-12 15:30:34 +02:00
unknown
ad492a6db7 Bug 29325: test suite is not applicable on windows 2007-07-12 15:12:56 +03:00
unknown
30810f80b1 Bug#28249 Query Cache returns wrong result with concurrent insert / certain lock
A race condition in the integration between MyISAM and the query cache code 
caused the query cache to fail to invalidate itself on concurrently inserted
data.

This patch fix this problem by using the existing handler interface which, upon
each statement cache attempt, compare the size of the table as viewed from the 
cache writing thread and with any snap shot of the global table state. If the
two sizes are different the global table size is unknown and the current
statement can't be cached.


mysql-test/r/query_cache.result:
  Added test case
mysql-test/t/query_cache.test:
  Added test case
sql/ha_myisam.cc:
  - Implemented handler interface for ha_myisam class to dermine if the table
   belonging to the currently processed statement can be cached or not.
sql/ha_myisam.h:
  - Implemented handler interface for ha_myisam class to dermine if the table
   belonging to the currently processed statement can be cached or not.
sql/handler.h:
  - Documented register_query_cache_table method in the handler interface.
2007-07-12 13:29:51 +02:00
unknown
181599582d Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug29604
2007-07-11 21:05:09 -07:00
unknown
b1e5568043 Fixed bug #29604.
A bug in the restore_prev_nj_state function allowed interleaving 
inner tables of outer join operations with outer tables. With the
current implementation of the nested loops algorithm it could lead
to wrong result sets for queries with nested outer joins.
Another bug in this procedure effectively blocked evaluation of some
valid execution plans for queries with nested outer joins. 


mysql-test/r/join_nested.result:
  Added a test case for bug #29604.
mysql-test/t/join_nested.test:
  Added a test case for bug #29604.
2007-07-11 18:45:35 -07:00
unknown
0bc3e69f92 A fix and a test case for Bug#25859 ALTER DATABASE works w/o parameters.
Fix the parser to make the database options not optional.


mysql-test/r/information_schema.result:
  Update results (Bug#25859)
mysql-test/t/information_schema.test:
  Add a test case for Bug#25859 "ALTER DATABASE works w/o parameters"
sql/sql_yacc.yy:
  Fix Bug#25859 ALTER DATABASE works w/o parameters - require
  parameters in the parser.
2007-07-12 01:10:29 +04:00
unknown
2b4810030b Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/29555-bug-5.0-opt-mysql
2007-07-11 23:37:02 +04:00
unknown
25e28d4d28 Bug#29555: Comparing time values as strings may lead to a wrong result.
Time values were compared as strings. This led to a wrong comparison
result when comparing values one of which is under 100 hours and another is
over 100 hours.

Now when the Arg_comparator::set_cmp_func function sees that both items to
compare are of the TIME type it sets the comparator to the
Arg_comparator::compare_e_int or the Arg_comparator::compare_int_unsigned
functions.


sql/item_cmpfunc.cc:
  Bug#29555: Comparing time values as strings may lead to a wrong result.
  Now when the Arg_comparator::set_cmp_func function sees that both items to
  compare are of the TIME type it sets the comparator to the
  Arg_comparator::compare_e_int or the Arg_comparator::compare_int_unsigned
  functions.
mysql-test/r/type_time.result:
  Added a test case for the bug#29555: Comparing time values as strings may
  lead to a wrong result.
mysql-test/t/type_time.test:
  Added a test case for the bug#29555: Comparing time values as strings may
  lead to a wrong result.
2007-07-11 23:18:02 +04:00
unknown
ad1190ec6c Merge gleb.loc:/home/uchum/work/bk/5.0-opt-29360
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-07-12 00:15:01 +05:00
unknown
0920c75b5e Fixed bug #29360.
The special `zero' enum value was coerced to the normal
empty string enum value during a field-to-field copy.
This bug affected CREATE ... SELECT statements and
SELECT aggregate GROUP BY enum field statements.

Also this bug made unnecessary warnings during
the execution of CREATE ... SELECT statements:
Warning       1265    Data truncated for column...


sql/field_conv.cc:
  Fixed bug #29360.
  The field_conv function has been modified to properly convert
  the special `zero' enum value between enum fields.
mysql-test/t/type_enum.test:
  Updated test case for bug #29360.
mysql-test/r/type_enum.result:
  Updated test case for bug #29360.
mysql-test/r/type_ranges.result:
  Updated test case for bug #29360.
2007-07-12 00:03:08 +05:00
unknown
2f0e00175b Addendum to bug 29325:
test if TRUNCATE TABLE works with keep_files_on_create
2007-07-11 18:02:47 +03:00
unknown
2b1fb350c3 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B29325-5.0-opt


include/my_base.h:
  Auto merged
2007-07-11 11:59:46 +03:00
unknown
1abab6c7c7 Bug #29325:
By default MyISAM overwrites .MYD and .MYI files no 
DATA DIRECTORY option is used. This can lead to two tables
using the same .MYD and .MYI files (that can't be dropped).

To prevent CREATE TABLE from overwriting a file a new option
is introduced : keep_files_on_create
When this is on the CREATE TABLE throws an error if either
the .MYD or .MYI exists for a MyISAM table.
The option is off by default (resulting in compatible behavior).


include/my_base.h:
  Bug #29325: introduce keep_files_on_create
myisam/mi_create.c:
  Bug #29325: introduce keep_files_on_create
mysql-test/r/create.result:
  Bug #29325: test case
mysql-test/t/create.test:
  Bug #29325: test case
sql/ha_myisam.cc:
  Bug #29325: introduce keep_files_on_create
sql/set_var.cc:
  Bug #29325: introduce keep_files_on_create
sql/sql_class.h:
  Bug #29325: introduce keep_files_on_create
sql/sql_table.cc:
  Bug #29325: introduce keep_files_on_create
sql/unireg.cc:
  Bug #29325: introduce keep_files_on_create
2007-07-11 10:49:54 +03:00
unknown
3d9841622e Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/home/tnurnberg/22540/50-22540


sql/log.cc:
  Auto merged
2007-07-10 18:33:20 +02:00
unknown
4f4764cdcb Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B29070-5.0-opt
2007-07-10 10:40:49 +03:00
unknown
0fdcf49189 rpl_misc_functions.result, rpl_misc_functions.test:
Backport from 5.1 a fix to make this test deterministic


mysql-test/r/rpl_misc_functions.result:
  Backport from 5.1 a fix to make this test deterministic
mysql-test/t/rpl_misc_functions.test:
  Backport from 5.1 a fix to make this test deterministic
2007-07-09 13:18:27 -06:00
unknown
2ad26498cf Bug #29070: Error in spatial index
1. Threat MBR for a key as double[] and convert it only
when about to store it on disk.
2. Remove the redundant function get_double().


myisam/sp_key.c:
  Bug #29070: 
  1. threat MBR for a key as double[] and convert it only
  when about to store it on disk.
  2. remove the redundant function get_double()
mysql-test/r/gis-rtree.result:
  Bug #29070: test case
mysql-test/t/gis-rtree.test:
  Bug #29070: test case
2007-07-09 17:41:24 +03:00
unknown
8b1b980df9 Merge sita.local:/Users/tsmith/m/bk/50
into  sita.local:/Users/tsmith/m/bk/maint/50


sql/log.cc:
  Auto merged
2007-07-09 01:22:54 -06:00
unknown
ee7519a5d5 Merge sita.local:/Users/tsmith/m/bk/41
into  sita.local:/Users/tsmith/m/bk/maint/41
2007-07-09 01:21:22 -06:00
unknown
dabd3c9724 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  sita.local:/Users/tsmith/m/bk/maint/50
2007-07-09 01:14:33 -06:00
unknown
82ac789172 Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
dollin' it up for Guilhem ;) -- test streamlined,
better comments, faster code, add'l assert.


mysql-test/r/binlog.result:
  Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
  
  streamlined test
mysql-test/t/binlog.test:
  Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
  
  streamlined test
sql/log.cc:
  Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
  
  comment clarified
2007-07-09 08:11:38 +02:00
unknown
0d177e16d0 Merge mysql.com:/home/ram/work/mysql-5.0-maint
into  mysql.com:/home/ram/work/b28808/b28808.5.0
2007-07-09 10:17:04 +05:00
unknown
e5da88af78 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  sita.local:/Users/tsmith/m/bk/maint/50
2007-07-08 19:39:54 -06:00
unknown
25cba45009 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/29461-bug-5.0-opt-mysql
2007-07-09 02:02:18 +04:00
unknown
bfa027e72e Bug#29461: Sort order of the collation wasn't used when comparing characters
with the space character.

When the my_strnncollsp_simple function compares two strings and one is a prefix
of another then this function compares characters in the rest of longer key
with the space character to find whether the longer key is greater or less.
But the sort order of the collation isn't used in this comparison. This may
lead to a wrong comparison result, wrongly created index or wrong order of the
result set of a query with the ORDER BY clause.

Now the my_strnncollsp_simple function uses collation sort order to compare
the characters in the rest of longer key with the space character.


mysql-test/t/ctype_collate.test:
  Added a test case for the bug#29461: Sort order of the collation wasn't used when
  comparing characters with the space character.
mysql-test/r/ctype_collate.result:
  Added a test case for the bug#29461: Sort order of the collation wasn't used when
  comparing characters with the space character.
strings/ctype-simple.c:
  Bug#29461: Sort order of the collation wasn't used when comparing characters
  with the space character.Now the my_strnncollsp_simple function uses collation sort order to compare
  the characters in the rest of longer key with the space character.
2007-07-09 01:23:33 +04:00
unknown
f045039d86 Merge gshchepa@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-07-08 11:46:52 +05:00
unknown
3561de50b1 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug29417


mysql-test/r/type_newdecimal.result:
  Manual merge.
mysql-test/t/type_newdecimal.test:
  Manual merge.
2007-07-07 15:45:28 -07:00
unknown
7ec0820b19 Merge gshchepa@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-07-08 03:40:01 +05:00
unknown
0671e30ae6 Fixed bug #29417.
An assertion abort could occur for some grouping queries that employed 
decimal user variables with assignments to them.

The problem appeared the constructors of the class Field_new_decimal
because the function my_decimal_length_to_precision did not guarantee
returning decimal precision not greater than DECIMAL_MAX_PRECISION.


mysql-test/r/type_newdecimal.result:
  Added a test case for bug #29417.
mysql-test/t/type_newdecimal.test:
  Added a test case for bug #29417.
sql/field.cc:
  Fixed bug #29417.
  An assertion abort could occur for some grouping queries that employed 
  decimal user variables with assignments to them.
  
  The problem appeared the constructors of the class Field_new_decimal
  because the function my_decimal_length_to_precision did not guarantee
  returning decimal precision not greater than DECIMAL_MAX_PRECISION.
  
  Now if the precision returned by calls to my_decimal_length_to_precision
  in the constructors of the class Field_new_decimal is greater than 
  DECIMAL_MAX_PRECISION the precision is set to this value.
2007-07-07 12:31:55 -07:00
unknown
16fc3a2771 Merge gleb.loc:/home/uchum/work/bk/5.0
into  gleb.loc:/home/uchum/work/bk/5.0-opt


mysql-test/r/innodb_mysql.result:
  Auto merged
mysql-test/t/innodb_mysql.test:
  Merge with 5.0 (main).
2007-07-08 00:19:31 +05:00
unknown
3756819e4b Fixed bug #29415.
The cast operation ignored the cases when the precision and/or the scale exceeded
the limits, 65 and 30 respectively. No errors were reported in these cases.
For some queries this may lead to an assertion abort.

Fixed by throwing errors for such cases.


mysql-test/r/type_newdecimal.result:
  Added a test case for bug #29415.
mysql-test/t/type_newdecimal.test:
  Added a test case for bug #29415.
2007-07-07 10:33:02 -07:00
unknown
1f1366c4c6 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0-engines
into  sita.local:/Users/tsmith/m/bk/maint/50
2007-07-06 17:55:46 -06:00
unknown
89688aefcf Merge sita.local:/Users/tsmith/m/bk/50
into  sita.local:/Users/tsmith/m/bk/maint/50
2007-07-06 17:50:01 -06:00
unknown
b1dce946cc Merge acurtis@bk-internal.mysql.com:/home/bk/mysql-5.0
into  ppcg5.local:/private/Network/Servers/anubis.xiphis.org/home/antony/work/mysql-5.0-engines.merge
2007-07-06 14:29:58 -07:00
unknown
a077186b70 fix test for bug29299 2007-07-06 11:35:10 -07:00
unknown
fec6d3f134 Merge anubis.xiphis.org:/usr/home/antony/work/mysql-5.0-engines
into  anubis.xiphis.org:/usr/home/antony/work/mysql-5.0-engines.merge


sql/sql_insert.cc:
  Auto merged
2007-07-06 09:00:40 -07:00
unknown
0b24005753 Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.0
into  labbari.dsl.inet.fi:/home/my/bk/mysql-5.0-marvel


libmysql/libmysql.c:
  Auto merged
mysql-test/r/innodb_mysql.result:
  Manual merge from main 5.1 to 5.1-marvel.
mysql-test/t/innodb_mysql.test:
  Manual merge from main 5.1 to 5.1-marvel.
2007-07-06 09:51:02 +03:00
unknown
8195a213c2 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug29392


sql/item.h:
  Auto merged
2007-07-05 17:39:51 -07:00
unknown
50373d1ae7 Merge gshchepa@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-07-06 03:49:40 +05:00
unknown
725b49716b Fixed bug #29442.
The SELECT INTO OUTFILE FIELDS ENCLOSED BY digit or minus sign,
followed by the same LOAD DATA INFILE statement, used wrond encoding
of non-string fields contained the enclosed character in their text
representation.

Example:
  SELECT 15, 9 INTO OUTFILE 'text' FIELDS ENCLOSED BY '5';

Old encoded result in the text file:
  5155 595
         ^ was decoded as the 1st enclosing character of the 2nd field;
        ^ was skipped as garbage;
  ^    ^ was decoded as a pair of englosing characters of the 1st field;
      ^   was decoded as traling space of the first field;
    ^^ was decoded as a doubled enclosed character.

New encoded result in the text file:
  51\55 595
  ^   ^ pair of enclosing characters of the 1st field;
    ^^ escaped enclosed character.



sql/sql_class.h:
  Fixed bug #29442.
  The NUMERIC_CHARS macro constant has been defined to enumerate
  all possible characters of a numeric value text representation.
  The select_export::is_unsafe_field_sep boolean flag has been added
  to apply the encoding algorithm to non-string values when it is
  necessary.
sql/sql_class.cc:
  Fixed bug #29442.
  The select_export::send_data method has been modified to encode text
  representation of fields of all data types like string fields.
mysql-test/t/loaddata.test:
  Updated test case for bug #29442.
mysql-test/r/loaddata.result:
  Updated test case for bug #29442.
2007-07-06 03:43:23 +05:00
unknown
6139d34c92 Bug #29166:
AsText() needs to know the maximum number of
characters a IEEE double precision value can
occupy to make sure there's enough buffer space.
The number was too small to hold all possible
values and this caused buffer overruns.
Fixed by correcting the calculation of the 
maximum digits in a string representation of an
IEEE double precision value as printed by 
String::qs_append(double).


mysql-test/r/gis.result:
  Bug #29166: test case
mysql-test/t/gis.test:
  Bug #29166: test case
sql/spatial.cc:
  Bug #29166: correct calculation of the maximum digits in
  a string representation of a double
2007-07-05 18:24:48 +03:00
unknown
32c6341ea8 Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
Problem: logging queries not using indexes we check a special flag which 
is set only at the server startup and is not changing with a corresponding
server variable together.

Fix: check the variable value instead of the flag.



mysql-test/r/show_check.result:
  Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
    - test result.
mysql-test/t/show_check.test:
  Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
    - test case.
sql/mysqld.cc:
  Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
    - SPECIAL_LOG_QUERIES_NOT_USING_INDEXES is not used anymore.
sql/sql_parse.cc:
  Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
    - check opt_log_queries_not_using_indexes instead of 
      SPECIAL_LOG_QUERIES_NOT_USING_INDEXES flag.
sql/unireg.h:
  Fix for bug #28808: log_queries_not_using_indexes variable dynamic change is ignored
    - SPECIAL_LOG_QUERIES_NOT_USING_INDEXES is not used anymore.
2007-07-05 15:34:12 +05:00
unknown
b15bd3086e Merge mysql.com:/home/bar/mysql-work/mysql-5.0.b29333
into  mysql.com:/home/bar/mysql-work/mysql-5.0-rpl
2007-07-05 14:55:02 +05:00
unknown
0d8f353b93 Fix for bug #29420: crash with show and purge binlogs
Problem: in case of failed 'show binlog events...' we don't inform that 
the log is not in use anymore. That may confuse following 'purge logs...'
command as it takes into account logs in use.

Fix: always notify that the log is not in use anymore.


mysql-test/r/rpl_rotate_logs.result:
  Fix for bug #29420: crash with show and purge binlogs
    - test result.
mysql-test/t/rpl_rotate_logs.test:
  Fix for bug #29420: crash with show and purge binlogs
    - test case.
sql/sql_repl.cc:
  Fix for bug #29420: crash with show and purge binlogs
    - always zero thd->current_linfo at the end of the mysql_show_binlog_events().
2007-07-05 13:09:56 +05:00
unknown
e8966deecc A fix and a test case for Bug#29050 Creation of a legal stored procedure
fails if a database is not selected prior.

The problem manifested itself when a user tried to
create a routine that had non-fully-qualified identifiers in its bodies
and there was no current database selected.

This is a regression introduced by the fix for Bug 19022:

The patch for Bug 19022 changes the code to always produce a warning
if we can't resolve the current database in the parser. 
In this case this was not necessary, since even though the produced
parsed tree was incorrect, we never re-use sphead
that was obtained at first parsing of CREATE PROCEDURE.
The sphead that is anyhow used is always obtained through db_load_routine,
and there we change the current database to sphead->m_db before
calling yyparse.

The idea of the fix is to resolve the current database directly using 
lex->sphead->m_db member when parsing a stored routine body, when
such is present.

This patch removes the need to reset the current database
when loading a trigger or routine definition into SP cache.
The redundant code will be removed in 5.1.


mysql-test/r/sp.result:
  Update test results (Bug#29050)
mysql-test/r/trigger.result:
  Update results.
mysql-test/t/sp.test:
  Add a test case for Bug#29050
mysql-test/t/trigger.test:
  Fix wrong behavior covered with tests.
sql/sql_lex.cc:
  Implement st_lex::copy_db_to().
sql/sql_lex.h:
  Declare st_lex::copy_db_to().
sql/sql_parse.cc:
  Use st_lex::copy_db_to() in add_table_to_list, rather than
  THD::copy_db_to(). The former will use the database of the sphead,
  if we're parsing a stored routine, not the default database in
  THD. The default database is needed to initialize tables->db
  when the database part was not explicitly specified in the identifier.
sql/sql_yacc.yy:
  Use st_lex::copy_db_to() in the parser, rather than
  THD::copy_db_to(). The former will use the database of the sphead,
  if we're parsing a stored routine, not the default database in
  THD.
2007-07-05 11:34:04 +04:00
unknown
5d88b654ed Fixed bug #29392.
This bug may manifest itself for select queries over a multi-table view
that includes an ORDER BY clause in its definition. If the select list of 
the query contains references to the same view column with different
aliases the names of the columns in the result output will be nevertheless
the same, coinciding with one of the alias.

The bug happened because the method Item_ref::get_tmp_table_item that
was inherited by the class Item_direct_view_ref ignored the fact that
the name of the view column reference must be inherited by the fields
of the temporary table that was created in order to get the result rows
sorted.


mysql-test/r/view.result:
  Added a test case for bug #29392.
mysql-test/t/view.test:
  Added a test case for bug #29392.
sql/item.h:
  Fixed bug #29392.
  This bug may manifest itself for select queries over a multi-table view
  that includes an ORDER BY clause in its definition. If the select list of 
  the query contains references to the same view column with different
  aliases the names of the columns in the result output will be nevertheless
  the same, coinciding with one of the alias.
  
  The bug happened because the method Item_ref::get_tmp_table_item that
  was inherited by the class Item_direct_view_ref ignored the fact that
  the name of the view column reference must be inherited by the fields
  of the temporary table that was created in order to get the result rows
  sorted.
  
  Fixed by providing a proper implementation of the get_tmp_table_item 
  method for the Item_direct_view_ref class.
2007-07-04 21:12:07 -07:00
unknown
e0f93ca8c1 Merge gleb.loc:/home/uchum/work/bk/5.0
into  gleb.loc:/home/uchum/work/bk/5.0-opt


sql/sql_class.h:
  Auto merged
2007-07-05 03:34:56 +05:00
unknown
b1ec3b534d A fix and a teset case for Bug#28551 The warning
'No database selected' is reported when calling stored procedures

Remove the offending warning introduced by the fix for Bug
25082
This minimal patch relies on the intrinsic knowledge of the fact that
mysql_change_db is never called with 'force_switch' set to TRUE
when such a warning may be needed:
 * every stored routine belongs to a database (unlike, e.g., a 
user defined function, which does not), so if we're activating the
database of a stored routine, it can never be NULL.
Therefore, this branch is never called for activation.
 * if we're restoring the 'old' current database after routine
execution is complete, we should not issue a warning, since it's OK to 
call a routine without having previously selected the current database.

TODO: 'force_switch' is an ambiguous flag, since we do not actually
have to 'force' the switch in case of stored routines at all.
When we activate the routine's database, we should perform
all the checks as in case of 'use db', and so we already do (in this
case 'force_switch' is unused).
When we load a routine into cache, we should not use mysql_change_db
at all, since there it's enough to call thd->reset_db(). We
do it this way for triggers, but code for routines is different (wrongly). 

TODO: bugs are lurking in replication, since it bypasses mysql_change_db
and calls thd->[re_]set_db to set the current database.
The latter does not change thd->db_charset, thd->sctx->db_access
and thd->variables.collation_database (and this may have nasty side
effects).

These todo items are to be addressed in a separate patch, if at all.


mysql-test/r/sp.result:
  Update results (Bug#28551)
mysql-test/t/sp.test:
  Add a test case (Bug#28551)
sql/sp.cc:
  Remove an obsolete comment.
  Replace a check with an assert.
sql/sql_db.cc:
  Remove the offending warning introduced by the fix for Bug
  25082
  This minimal patch relies on the intrinsic knowledge of the fact that
  mysql_change_db is never called with 'force_switch' set to TRUE
  when such a warning may be needed.
2007-07-05 02:20:32 +04:00
unknown
8d2d15203f Merge maint1.mysql.com:/data/localhome/tsmith/bk/50
into  maint1.mysql.com:/data/localhome/tsmith/bk/maint/50
2007-07-04 21:24:32 +02:00
unknown
1b827e0399 Merge maint1.mysql.com:/data/localhome/tsmith/bk/41
into  maint1.mysql.com:/data/localhome/tsmith/bk/maint/41
2007-07-04 21:22:35 +02:00
unknown
8e871c1a39 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  mysql.com:/home/bar/mysql-work/mysql-5.0.b29484
2007-07-04 17:04:41 +05:00
unknown
3b1fefbf14 Bug#29333 myisam corruption with character set cp932 collate cp932_japanese_ci
Problem: wrong comparison with trailing space.
  This problem was fixed for all other character sets under terms of
  bug 7788 ""Table is full" occurs during a multitable update".
  ctype-cp932.c was forgotten.
  Fix: applying the same fix for ctype-cp932.c.
  (see ctype-sjis.c as an example of a previously correctly fixed file)


mysql-test/r/ctype_cp932.result:
  Adding test
mysql-test/t/ctype_cp932.test:
  Adding test
strings/ctype-cp932.c:
  Applying the same fix which was done for all other
      character sets under terms of bug 7788.
strings/ctype-utf8.c:
  Fixing the same problem for utf8_general_cs,
  which was forgotten in bug 7788 as well.
2007-07-04 16:17:40 +05:00
unknown
d64e738396 Bug#29484 ctype_big5 fails on 'double whopper' in mysql-5.1-new-rpl
Problem: "mysqldump" doesn exists when running "mysql-test-run --embedded-server".
Fix: changing test to use "SELECT INTO OUTFILE" instead of "mysqldump -T".


mysql-test/r/ctype_big5.result:
  Fixing tests to use "SELECT INTO OUTFILE" instead of "mysqldump -T"
mysql-test/t/ctype_big5.test:
  Fixing tests to use "SELECT INTO OUTFILE" instead of "mysqldump -T"
2007-07-04 14:21:29 +05:00
unknown
de82433c20 Bug#29499 Converting 'del' from ascii to Unicode results in 'question mark'
mysql-test/r/ctype_latin1.result:
  Adding tests
mysql-test/r/ctype_ucs.result:
  Adding tests
mysql-test/t/ctype_latin1.test:
  Adding tests
mysql-test/t/ctype_ucs.test:
  Adding tests
sql/share/charsets/ascii.xml:
  Changing mapping of 0x7F from "unassigned" to U+007F.
strings/ctype-extra.c:
  Regenerating ctype-extra.c from new ascii.xml
2007-07-04 12:04:57 +05:00
unknown
8d035c57f0 loaddata.result, loaddata.test:
Updated test case for bug #29294.


mysql-test/t/loaddata.test:
  Updated test case for bug #29294.
mysql-test/r/loaddata.result:
  Updated test case for bug #29294.
2007-07-04 03:15:37 +05:00
unknown
c700a77623 Merge gleb.loc:/home/uchum/work/bk/4.1-opt
into  gleb.loc:/home/uchum/work/bk/5.0-opt


sql/sql_class.cc:
  Auto merged
sql/sql_class.h:
  Auto merged
sql/sql_load.cc:
  Auto merged
mysql-test/r/loaddata.result:
  Merge with 4.1-opt.
mysql-test/t/loaddata.test:
  Merge with 4.1-opt.
2007-07-04 02:09:56 +05:00
unknown
bc3e008688 loaddata.result, loaddata.test:
Test case update for bug #29294.


mysql-test/t/loaddata.test:
  Test case update for bug #29294.
mysql-test/r/loaddata.result:
  Test case update for bug #29294.
2007-07-03 21:45:20 +05:00
unknown
166d3c9186 Fixed bug #29294.
The `SELECT 'r' INTO OUTFILE ... FIELDS ENCLOSED BY 'r' ' statement
encoded the 'r' string to a 4 byte string of value x'725c7272'
(sequence of 4 characters: r\rr).
The LOAD DATA statement decoded this string to a 1 byte string of
value x'0d' (ASCII Carriage Return character) instead of the original
'r' character.
The same error also happened with the FIELDS ENCLOSED BY clause
followed by special characters: 'n', 't', 'r', 'b', '0', 'Z' and 'N'.

NOTE 1: This is a result of the undocumented feature: the LOAD DATA INFILE
recognises 2-byte input sequences like \n, \t, \r and \Z in addition
to documented 2-byte sequences: \0 and \N. This feature should be
documented (here backspace character is a default ESCAPED BY character,
in the real-life example it may be any ESCAPED BY character).

NOTE 2, changed behaviour:
Now the `SELECT INTO OUTFILE' statement with the `FIELDS ENCLOSED BY'
clause followed by one of: 'n', 't', 'r', 'b', '0', 'Z' or 'N' characters
encodes this special character itself by doubling it ('r' --> 'rr'),
not by prepending it with an escape character.


sql/sql_class.h:
  Fixed bug #29294.
  The ESCAPE_CHARS macro constant is defined to enumerate
  symbolic names of espace-sequences like  '\n', '\t' etc.
  The select_export::is_ambiguous_field_sep field has been added
  to distinguish special values of the field_sep field from
  another values (see ESCAPE_CHARS).
sql/sql_class.cc:
  Fixed bug #29294.
  The select_export::send_data method has been modified to
  encode special values of the field_sep field by
  doubling of those values instead of prepending them with a
  value of the escape_char field.
  Example: The SELECT 'r' INTO OUTFILE FIELDS ENCLOSED BY 'r'
  now produces the 'rr' output string instead of x'5c72'
  (i.e. instead of sequence of 2 bytes: \ and r).
sql/sql_load.cc:
  Fixed bug #29294.
  Added commentary for the READ_INFO::unescape method.
mysql-test/t/loaddata.test:
  Updated test case for bug #29294.
mysql-test/r/loaddata.result:
  Updated test case for bug #29294.
2007-07-03 19:37:46 +05:00
unknown
7edcebc97a Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  mysql.com:/home/bar/mysql-work/mysql-5.0.b27345
2007-07-03 13:58:19 +05:00
unknown
416a49a669 Bug#24924 shared-memory-base-name that is too long causes buffer overflow
- Testcase fixup.


mysql-test/t/windows_shm.test:
  Bug#24924 shared-memory-base-name that is too long causes buffer overflow
  - Pass user, port and host to mysqladmin.
2007-07-02 14:22:03 -04:00
unknown
b0696f5457 Fix testcase to be platform-independent 2007-07-02 22:18:41 +04:00
unknown
c68336b15a Merge lthalmann@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mysql.com:/nfsdisk1/lars/bk/mysql-5.0-rpl


sql/sql_yacc.yy:
  Auto merged
2007-07-02 17:02:01 +02:00
unknown
2b09b6c57c Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge


sql/item_sum.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2007-07-02 13:22:23 +02:00
unknown
a9b675e200 Merge mysql.com:/home/svoj/devel/bk/mysql-5.0-engines
into  mysql.com:/home/svoj/devel/mysql/BUG29299/mysql-5.0-engines
2007-07-02 12:31:34 +05:00
unknown
68e1f851ed Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
minor fixes to appease pushbuild.


mysql-test/r/binlog.result:
  Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
  
  make test portable so it will work on servers with
  funny names.
mysql-test/t/binlog.test:
  Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
  
  make test portable so it will work on servers with
  funny names.
sql/log.cc:
  Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
  
  change type to uchar * so it's the same as in 5.1.
2007-07-02 07:13:40 +02:00
unknown
07dcc80023 Fixed bug #25798.
This bug may manifest itself not only with the queries for which
the index-merge access method is chosen. It also may display
itself for queries with DISTINCT.

The bug was in how the Unique::get method used the merge_buffers
function. To compare elements in the the queue employed by
merge_buffers() it must use the buffpek_compare function rather
than the function for binary comparison. 


mysql-test/r/innodb_mysql.result:
  Added a test case for bug #25798.
mysql-test/t/innodb_mysql.test:
  Added a test case for bug #25798.
sql/filesort.cc:
  Fixed bug #25798.
  The function merge_buffers() when called from the Uniques::get method
  must use function buffpek_compare to compare elements in the queue it
  employs. The pointer to buffpek_compare and the info for the function
  that compares sorted records are passed to merge_buffers through certain 
  designated fields of the SORTPARAM structure.
sql/sql_sort.h:
  Fixed bug #25798.
  Added fields to the SORTPARAM structure to be used in the function 
  merge_buffers when called by the Uniques::get method.
sql/uniques.cc:
  Fixed bug 25798.
  The function merge_buffers() when called from the Uniques::get method
  must use function buffpek_compare to compare elements in the queue it
  employes.
2007-07-01 15:33:28 -07:00
unknown
c182dfa240 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.(none):/opt/local/work/mysql-5.0-runtime


sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
2007-07-02 02:01:05 +04:00
unknown
8dcd5fca69 Merge olga.mysql.com:/home/igor/mysql-4.1-opt
into  olga.mysql.com:/home/igor/mysql-5.0-opt


mysql-test/r/type_enum.result:
  Auto merged
mysql-test/t/type_enum.test:
  Auto merged
sql/field_conv.cc:
  SCCS merged
2007-06-30 16:24:09 -07:00
unknown
0b0cef486d Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  sin.intern.azundris.com:/home/tnurnberg/22540/50-22540
2007-06-30 03:41:31 +02:00
unknown
59ab2d4612 Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
previous correction didn't. make sure "tail" is fixed up
when filling cache several times; rework formulae.


mysql-test/r/binlog.result:
  Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
  
  show that fix for absolute end_log_pos in binlog also
  works when cache is read several times and headers are
  split across that boundary
mysql-test/t/binlog.test:
  Bug#22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
  
  show that fix for absolute end_log_pos in binlog also
  works when cache is read several times and headers are
  split across that boundary
2007-06-30 02:30:42 +02:00
unknown
a89259fad8 Merge gleb.loc:/home/uchum/work/bk/5.0-opt-29205
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-06-30 02:47:22 +05:00
unknown
db397d16ad Fixed bug #29205.
When a UNION statement forced conversion of an UTF8
charset value to a binary charset value, the byte
length of the result values was truncated to the
CHAR_LENGTH of the original UTF8 value.


sql/item.cc:
  Fixed bug #29205.
  The calculation of data length was modified in
  the Item_type_holder::join_types method to take into
  account possible conversion of a multibyte charset
  value to a binary charset value, when each
  multibyte character is converted into a sequence
  of bytes (not to a single byte of binary charset).
mysql-test/t/ctype_utf8.test:
  Updated test case for bug #29205.
mysql-test/r/ctype_utf8.result:
  Updated test case for bug #29205.
2007-06-30 02:09:50 +05:00
unknown
eda9c97e98 Merge anubis.xiphis.org:/usr/home/antony/work/mysql-5.0-engines
into  anubis.xiphis.org:/usr/home/antony/work/5.0-engines-merge
2007-06-29 14:04:08 -07:00
unknown
6a00ce7170 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/29261-bug-5.0-opt-mysql
2007-06-29 22:22:05 +04:00
unknown
4772a012b3 Bug#29261: Sort order of the collation wasn't used when comparing trailing
spaces.

When the my_strnncollsp_simple function compares two strings and one is a prefix
of another then this function compares characters in the rest of longer key
with the space character to find whether the longer key is greater or less.
But the sort order of the collation isn't used in this comparison. This may
lead to a wrong comparison result, wrongly created index or wrong order of the
result set of a query with the ORDER BY clause.

Now the my_strnncollsp_simple function uses collation sort order to compare
the characters in the rest of longer key with the space character.


mysql-test/t/ctype_collate.test:
  Added a test case for the bug#29261: Sort order of the collation wasn't used
  when comparing trailing spaces.
mysql-test/r/ctype_collate.result:
  Added a test case for the bug#29261: Sort order of the collation wasn't used
  when comparing trailing spaces.
strings/ctype-simple.c:
  Bug#29261: Sort order of the collation wasn't used when comparing trailing
  spaces.
  Now the my_strnncollsp_simple function uses collation sort order to compare
  the characters in the rest of longer key with the space character.
2007-06-29 22:13:33 +04:00
unknown
f30a53a09e Merge bk-internal:/home/bk/mysql-5.0-maint
into  pilot.(none):/data/msvensson/mysql/mysql-5.0-maint
2007-06-29 11:06:21 +02:00
unknown
c8dde6dfe6 Merge pilot.(none):/data/msvensson/mysql/bug28356/my50-bug28356
into  pilot.(none):/data/msvensson/mysql/mysql-5.0-maint


mysql-test/t/sp.test:
  Auto merged
2007-06-29 10:27:21 +02:00
unknown
0870afe37d Bug#28356 Exec'ing "diff" from "mysqltest" loses the output, no information available
- Use SQL for diffing master and slave


mysql-test/r/rpl_misc_functions.result:
  Dump t1 on slave and load it back into temporary table on master
  to allow comapre with SQL
mysql-test/t/rpl_misc_functions.test:
  Dump t1 on slave and load it back into temporary table on master
  to allow comapre with SQL
2007-06-29 10:26:20 +02:00
unknown
33eb22a35f Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B27333-gcov-5.0-opt
2007-06-29 11:05:59 +03:00
unknown
c2e961cf2e Bug#27333: subquery grouped for aggregate of outer
query / no aggregate of subquery
 The optimizer counts the aggregate functions that 
 appear as top level expressions (in all_fields) in 
 the current subquery. Later it makes a list of these
 that it uses to actually execute the aggregates in
 end_send_group().
 That count is used in several places as a flag whether
 there are aggregates functions.
 While collecting the above info it must not consider
 aggregates that are not aggregated in the current 
 context. It must treat them as normal expressions 
 instead. Not doing that leads to incorrect data about
 the query, e.g. running a query that actually has no
 aggregate functions as if it has some (and hence is
 expected to return only one row).
 Fixed by ignoring the aggregates that are not aggregated
 in the current context. 
 One other smaller omission discovered and fixed in the 
 process : the place of aggregation was not calculated for
 user defined functions. Fixed by calling 
 Item_sum::init_sum_func_check() and 
 Item_sum::check_sum_func() as it's done for the rest of 
 the aggregate functions.


mysql-test/r/subselect.result:
  Bug #27333: test case
mysql-test/t/subselect.test:
  Bug #27333: test case
sql/item_subselect.cc:
  Bug#27333: need select_lex to filter out
   aggregates that are not aggregated in
   the current select.
sql/item_sum.cc:
  Bug#27333: need select_lex to filter out
   aggregates that are not aggregated in
   the current select.
sql/item_sum.h:
  Bug#27333: calculate the place of 
   aggregation for user defined functions.
sql/sql_select.cc:
  Bug#27333: When counting the aggregated functions
   and collecting a list of them we must not consider
   the aggregates that are not aggregated in the local
   context as "local" : i.e. we must treat them as 
   normal functions and not add them to the aggregate
   functions list.
sql/sql_select.h:
  Bug#27333: need select_lex to filter out
   aggregates that are not aggregated in
   the current select.
2007-06-29 10:39:17 +03:00
unknown
dba70720a7 Bug#25513
"Federared Transactions Failure"
  Bug occurs when the user performs an operation which inserts more than 
  one row into the federated table and the federated table references a 
  remote table stored within a transactional storage engine. When the
  insert operation for any one row in the statement fails due to 
  constraint violation, the federated engine is unable to perform 
  statement rollback and so the remote table contains a partial commit. 
  The user would expect a statement to perform the same so a statement 
  rollback is expected.
  This bug was fixed by implementing  bulk-insert handling into the
  federated storage engine. This will relieve the bug for most common
  situations by enabling the generation of a multi-row insert into the
  remote table and thus permitting the remote table to perform 
  statement rollback when neccessary.
  The multi-row insert is limited to the maximum packet size between 
  servers and should the size overflow, more than one insert statement 
  will be sent and this bug will reappear. Multi-row insert is disabled
  when an "INSERT...ON DUPLICATE KEY UPDATE" is being performed.
  The bulk-insert handling will offer a significant performance boost 
  when inserting a large number of small rows.
This patch builds on Bug29019 and Bug25511


sql/ha_federated.cc:
  bug25513
    new member methods:
      start_bulk_insert() - initializes memory for bulk insert
      end_bulk_insert() - sends any remaining bulk insert and frees memory
      append_stmt_insert() - create the INSERT statement
sql/ha_federated.h:
  bug25513
    new member value:
      bulk_insert
    new member methods:
      start_bulk_insert(), end_bulk_insert(), append_stmt_insert()
    make member methods private:
      read_next(), index_read_idx_with_result_set()
mysql-test/r/federated_innodb.result:
  New BitKeeper file ``mysql-test/r/federated_innodb.result''
mysql-test/t/federated_innodb-slave.opt:
  New BitKeeper file ``mysql-test/t/federated_innodb-slave.opt''
mysql-test/t/federated_innodb.test:
  New BitKeeper file ``mysql-test/t/federated_innodb.test''
2007-06-28 16:03:01 -07:00
unknown
94beb7cd8d Bug#25511
"Federated INSERT failures"
  Federated does not correctly handle "INSERT...ON DUPLICATE KEY UPDATE"
  However, implementing such support is not reasonably possible without
  increasing complexity of the storage engine: checking that constraints
  on remote server match local server and parsing error messages.
  This patch causes 'ON DUPLICATE KEY' to fail with ER_DUP_KEY message
  if a conflict occurs and not to fail silently.


include/my_base.h:
  bug25511
    new storage engine hint: HA_EXTRA_INSERT_WITH_UPDATE
mysql-test/r/federated.result:
  test for bug25511
mysql-test/t/federated.test:
  test for bug25511
sql/ha_federated.cc:
  bug25511
    implement support for handling HA_EXTRA_INSERT_WITH_UPDATE hint
sql/ha_federated.h:
  bug25511
    new property: insert_dup_update
sql/sql_insert.cc:
  bug25511
    implement support for HA_EXTRA_INSERT_WITH_UPDATE
    When checking duplicates flag, if it is DUP_UPDATE, send hint
    to the storage engine.
2007-06-28 13:36:26 -07:00
unknown
925c33db65 Fix for BUG#10491: Server returns data as charset binary
SHOW CREATE TABLE or SELECT FROM I_S.

Actually, the bug discovers two problems:
  - the original query is not preserved properly. This is the problem
    of BUG#16291;
  - the resultset of SHOW CREATE TABLE statement is binary.

This patch fixes the second problem for the 5.0.

Both problems will be fixed in 5.1.


mysql-test/r/show_check.result:
  Update result file.
mysql-test/t/show_check.test:
  Provide test case for BUG#10491.
sql/item.h:
  Use utf8_general_ci instead of binary collation by default,
  because for views and base tables utf8 is the character set
  in which their definition is stored. For system constants
  it's the default character set, and for other objects
  (routines, triggers), no character set is stored, and
  therefore no character set is known, so returning utf8
  is just as good as any non-binary character set.
  This latter problem is fixed in 5.1 by 16291. In 5.1
  we will return the "real" character set.
2007-06-28 13:24:52 +04:00
unknown
54344f681d Bug#27345 Incorrect data returned when range-read from utf8_danish_ci indexes
Problem: like_range() returned wrong ranges for contractions (like 'ch' in Czech').
Fix: adding a special code to handle tricky cases:
- contraction head followed by a wild character
- full contraction
- contraction part followed by another contraction part,
  but they are not a contraction together.


mysql-test/r/ctype_uca.result:
  Adding test case
mysql-test/t/ctype_uca.test:
  Adding test case
strings/ctype-mb.c:
  Adding test case
strings/ctype-uca.c:
  Allocate additional 256 bytes for flags "is contraction part".
strings/ctype-ucs2.c:
  Adding test case
2007-06-28 13:34:44 +05:00
unknown
0e5e884b11 Bug#29019
"REPLACE/INSERT IGNORE/UPDATE IGNORE doesn't work"
  Federated does not record neccessary HA_EXTRA flags in order to
  support REPLACE/INSERT IGNORE/UPDATE IGNORE.
  Implement ::extra() to capture flags neccessary for functionality.
New function append_ident() to better escape identifiers consistantly.


mysql-test/r/federated.result:
  test for bug29019
mysql-test/t/federated.test:
  test for bug29019
sql/ha_federated.cc:
  Bug29019
    Federated does not record neccessary HA_EXTRA flags in order to
    support REPLACE/INSERT IGNORE/UPDATE IGNORE.
    Implement ::extra() to capture flags neccessary for functionality.
  New function append_ident() to better escape identifiers consistantly.
sql/ha_federated.h:
  bug29019
    add 2 member values to ha_federated class
      ignore_duplicates and replace_duplicates.
    add 1 member method to ha_federated class
      extra()
2007-06-28 00:23:14 -07:00
unknown
b728d0a65e Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B26642-5.0-opt
2007-06-28 09:27:27 +03:00
unknown
61c423a2bd Change "exec rm" to "remove_file"
mysql-test/t/sp.test:
  Change "exec rm" to "remove_file"
  Change two "remove file if exists" to "check that file not exist"
2007-06-27 18:21:20 +02:00
unknown
d99af83936 Merge dkatz@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  damien-katzs-computer.local:/Users/dkatz/mysql50
2007-06-27 12:03:49 -04:00
unknown
6f059005ef Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-base
into  weblab.(none):/home/marcsql/TREE/mysql-5.0-rt-merge
2007-06-27 09:13:01 -06:00
unknown
030d98d397 BUG#29299 - repeatable myisam fulltext index corruption
Fulltext index may get corrupt by certain gbk characters.

The problem was that when skipping leading non-true-word-characters,
we assumed that these characters are always 1 byte long. This is not
the case with gbk character set, since non-true-word-characters may
be 2 bytes long.

Affects 5.0 only.


myisam/ft_parser.c:
  Leading non-true-word-characters may also be multi-byte (e.g. in
  gbk character set).
mysql-test/r/fulltext2.result:
  A test case for BUG#29299.
mysql-test/t/fulltext2.test:
  A test case for BUG#29299.
2007-06-27 18:10:19 +05:00
unknown
f0ccaddf8b Bug#24924: shared-memory-base-name that is too long causes buffer overflow
show that shm communication still works on windows,
and that we can't overflow the base-name.


mysql-test/t/windows_shm-master.opt:
  Bug#24924: shared-memory-base-name that is too long causes buffer overflow
  
  start a server with shm communication if we're on
  windows.
mysql-test/t/windows_shm.test:
  Bug#24924: shared-memory-base-name that is too long causes buffer overflow
  
  .opt has started a server with shm communication
  if we're on windows. now start a client with shm
  and connect to that server.
2007-06-27 14:04:29 +02:00
unknown
00b3d3c245 Merge mhansson@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  dl145s.mysql.com:/dev/shm/mhansson/my50-bug28677


sql/sql_class.h:
  Auto merged
sql/sql_insert.cc:
  Auto merged
sql/sql_select.cc:
  Auto merged
2007-06-27 14:02:32 +02:00
unknown
0c31d0bbd7 Bug #26642: create index corrupts table definition in .frm
Thanks to Martin Friebe for finding and submitting a fix for this bug!
  
  A table with maximum number of key segments and maximum length key name
  would have a corrupted .frm file, due to an incorrect calculation of the
  complete key length.  Now the key length is computed correctly (I hope) :-)
  
  MyISAM would reject a table with the maximum number of keys and the maximum
  number of key segments in all keys.  It would allow one less than this total
  maximum.  Now MyISAM accepts a table defined with the maximum.  (This is a
  very minor issue.)


myisam/mi_open.c:
  Bug #26642: change >= to > in a comparison (i.e., error 
  only if key_parts_in_table really is greater than 
  MAX_KEY * MAX_KEY_SEG)
mysql-test/r/create.result:
  Bug #26642: test case
mysql-test/t/create.test:
  Bug #26642: test case
sql/table.cc:
  Bug #26642: In create_frm(), fix formula for key_length; 
  it was too small by (keys * 2) bytes
2007-06-27 14:35:49 +03:00
unknown
a38b1ae7c9 BUG#29207 - archive table reported as corrupt by check table (P1)
CHECK TABLE against ARCHIVE table may falsely report table corruption,
or cause server crash.

Fixed by using proper buffer for CHECK TABLE.

Affects both 5.0 and 5.1.


mysql-test/r/archive.result:
  A test case for BUG#28916.
mysql-test/t/archive.test:
  A test case for BUG#28916.
sql/ha_archive.cc:
  We call Field::get_length() from get_row(). Field::get_length() assumes
  that the row was read into table->record[0] buffer, which is not the
  case when we check a table. As a result we get wrongly initialized
  blob length.
  
  Use table->record[0] as record buffer for check table instead.
2007-06-27 13:19:34 +05:00
unknown
96af756525 Merge damien-katzs-computer.local:/Users/dkatz/mysql50
into  damien-katzs-computer.local:/Users/dkatz/50
2007-06-26 20:47:15 -04:00
unknown
5d1d9f11d7 Bug #29307 status.test fails with different Table_locks_immediate
Added more sleep time befoe reap to allow query to be executed.


mysql-test/t/status.test:
  Added more sleep time befoe reap to allow query to be executed.
2007-06-26 20:33:53 -04:00
unknown
39ef7a533e Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug29087
2007-06-26 16:37:02 -07:00
unknown
7fbf6303d2 Fixed bug #29251.
Sometimes special 0 ENUM values was ALTERed to normal
empty string ENUM values.

Special 0 ENUM value has the same string representation
as normal ENUM value defined as '' (empty string).
The do_field_string function was used to convert
ENUM data at an ALTER TABLE request, but this
function doesn't care about numerical "indices" of
ENUM values, i.e. do_field_string doesn't distinguish
a special 0 value from an empty string value.

A new copy function called do_field_enum has been added to
copy special 0 ENUM values without conversion to an empty
string.


sql/field_conv.cc:
  Fixed bug #29251.
  The Copy_field::get_copy_func method has been modified to
  return a pointer to the do_field_enum function if a conversion
  between two columns of incompatible enum types is required.
  The do_field_enum function has been added for the correct
  conversion of special 0 enum values.
mysql-test/t/type_enum.test:
  Updated test case for bug #29251.
mysql-test/r/type_enum.result:
  Updated test case for bug #29251.
2007-06-27 03:41:50 +05:00
unknown
cfd57501ae Merge maint1.mysql.com:/data/localhome/tsmith/bk/50
into  maint1.mysql.com:/data/localhome/tsmith/bk/maint/50
2007-06-26 23:58:48 +02:00
unknown
58419e9e18 Merge maint1.mysql.com:/data/localhome/tsmith/bk/41
into  maint1.mysql.com:/data/localhome/tsmith/bk/maint/41
2007-06-26 23:56:56 +02:00
unknown
0127c1a30f Fixed bug #29087. This bug manifested itself for queries that performed
a lookup into a BINARY index by a key ended with spaces. It caused
an assertion abort for a debug version and wrong results for non-debug
versions.

The problem occurred because the function _mi_pack_key stripped off 
the trailing spaces from binary search keys while the function _mi_make_key
did not do it when keys were inserted into the index.

Now the function _mi_pack_key does not remove the trailing spaces from
search keys if they are of the binary type.


mysql-test/r/binary.result:
  Added a test case for bug #29087.
mysql-test/t/binary.test:
  Added a test case for bug #29087.
2007-06-25 22:44:22 -07:00
unknown
c5ebbb6571 Merge weblab.(none):/home/marcsql/TREE/mysql-5.0-base
into  weblab.(none):/home/marcsql/TREE/mysql-5.0-rt-merge


sql/sql_yacc.yy:
  Auto merged
2007-06-25 10:32:38 -06:00
unknown
279529c11c Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
fix binlog-writing so that end_log_pos is given correctly even
within transactions for both SHOW BINLOG and SHOW MASTER STATUS,
that is as absolute values (from log start) rather than relative
values (from transaction's start).
---
Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  sin.intern.azundris.com:/home/tnurnberg/22540/50-22540


mysql-test/r/binlog.result:
  Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
  
  show that end_log_pos in SHOW BINLOG EVENTS is correct even in transactions.
  show that SHOW MASTER STATUS returns correct values while in transactions
  (so that mysqldump --master-data will work correctly).
  also remove bdb dependency.
  ---
  manual merge
mysql-test/t/binlog.test:
  Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
  
  show that end_log_pos in SHOW BINLOG EVENTS is correct even in transactions.
  show that SHOW MASTER STATUS returns correct values while in transactions
  (so that mysqldump --master-data will work correctly).
  also remove bdb dependency.
sql/log.cc:
  Bug #22540: Incorrect value in column End_log_pos of SHOW BINLOG EVENTS using InnoDB
  
  fix output for SHOW BINLOG EVENTS so that end_log_pos is given correctly
  even within transactions. do this by rewriting the commit-buffer in place.
2007-06-25 11:34:23 +02:00
unknown
4ea2eb4a75 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B29154-5.0-opt
2007-06-25 11:00:58 +03:00
unknown
39459397cd Bug #29154: LOCK TABLES is not atomic when >1 InnoDB tables are locked
LOCK TABLES takes a list of tables to lock. It may lock several 
  tables successfully and then encounter a tables that it can't lock, 
  e.g. because it's locked. In such case it needs to undo the locks on
  the already locked tables. And it does that. But it has also notified
  the relevant table storage engine handlers that they should lock.
  The only reliable way to ensure that the table handlers will give up
  their locks is to end the transaction. This is what UNLOCK TABLE 
  does : it ends the transaction if there were locked tables by LOCK 
  tables.
  It is possible to end the transaction when the lock fails in 
  LOCK TABLES because LOCK TABLES ends the transaction at its start 
  already. 
  Fixed by ending (again) the transaction when LOCK TABLES fails to
  lock a table.


mysql-test/r/innodb_mysql.result:
  Bug #29154: test case
mysql-test/t/innodb_mysql.test:
  Bug #29154: test case
sql/sql_parse.cc:
  Bug #29154: end the trasaction at a failing 
  LOCK TABLES so the handler can free its locks.
2007-06-25 10:44:52 +03:00
unknown
f30db30991 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug25602


sql/sql_select.cc:
  Auto merged
2007-06-24 10:50:24 -07:00
unknown
b3b8d5165d BUG#15787 - MySQL crashes when archive table exceeds 2GB
Max compressed file size was calculated incorretly causing server
crash on INSERT.

With this patch we use proper max file size provided by zlib.

Affects 5.0 only.


sql/ha_archive.cc:
  When calculating max compressed file size, use the real offset size
  that is provided by zlib, instead of sizeof(z_off_t), which may be
  different from actual offset size.
  
  When we're about to write and the data file is almost full flush gzio
  buffer to get accurate real file size.
mysql-test/r/archive-big.result:
  New BitKeeper file ``mysql-test/r/archive-big.result''
mysql-test/t/archive-big.test:
  New BitKeeper file ``mysql-test/t/archive-big.test''
2007-06-24 19:44:54 +05:00
unknown
fec835f1eb Merge gleb.loc:/home/uchum/work/bk/5.0
into  gleb.loc:/home/uchum/work/bk/5.0-opt


sql/log_event.cc:
  Auto merged
2007-06-24 12:58:45 +05:00
unknown
e009b764b9 Fixed bug #25602. A query with DISTINCT in the select list to which
the loose scan optimization for grouping queries was applied returned 
a wrong result set when the query was used with the SQL_BIG_RESULT
option.

The SQL_BIG_RESULT option forces to use sorting algorithm for grouping
queries instead of employing a suitable index. The current loose scan
optimization is applied only for one table queries when the suitable
index is covering. It does not make sense to use sort algorithm in this
case. However the create_sort_index function does not take into account
the possible choice of the loose scan to implement the DISTINCT operator
which makes sorting unnecessary. Moreover the current implementation of
the loose scan for queries with distinct assumes that sorting will
never happen. Thus in this case create_sort_index should not call
the function filesort.


mysql-test/r/group_min_max.result:
  Added a test case for bug #25602.
mysql-test/t/group_min_max.test:
  Added a test case for bug #25602.
2007-06-23 23:33:55 -07:00
unknown
d37471b4ef Merge gleb.loc:/home/uchum/work/bk/5.0-opt-29095
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-06-24 01:22:25 +05:00
unknown
1bab1ddc55 Fixed bug #29095.
INSERT into table from SELECT from the same table
with ORDER BY and LIMIT was inserting other data
than sole SELECT ... ORDER BY ... LIMIT returns.

One part of the patch for bug #9676 improperly pushed
LIMIT to temporary table in the presence of the ORDER BY
clause.
That part has been removed.


sql/sql_select.cc:
  Fixed bug #29095.
  One part of the patch for bug #9676 improperly pushed
  LIMIT to temporary table in the presence of the ORDER BY
  clause.
  That part has been removed.
mysql-test/t/insert_select.test:
  Expanded the test case for bug #9676.
  Created a test case for bug #29095.
mysql-test/r/insert_select.result:
  Expanded the test case for bug #9676.
  Created a test case for bug #29095.
2007-06-24 01:20:14 +05:00
unknown
ab5e152132 Merge adventure.(none):/home/thek/Development/cpp/bug28846/my50-bug28846
into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime


sql/sql_class.h:
  Auto merged
sql/sql_parse.cc:
  Auto merged
sql/sql_prepare.cc:
  Auto merged
sql/sql_view.cc:
  Auto merged
sql/sql_yacc.yy:
  Auto merged
2007-06-22 15:40:35 +02:00
unknown
9b940d0cb7 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  mysql.com:/home/bar/mysql-work/mysql-5.0.b28925


sql/sql_yacc.yy:
  Auto merged
mysql-test/r/ctype_ucs2_def.result:
  After merge fix
mysql-test/t/ctype_ucs2_def.test:
  After merge fix
2007-06-22 17:28:26 +05:00
unknown
46c3d7b87d Bug#28925 GROUP_CONCAT inserts wrong separators for a ucs2 column
Problem: separator was not converted to the result character set,
so the result was a mixture of two different character sets,
which was especially bad for UCS2.
Fix: convert separator to the result character set.


mysql-test/r/ctype_ucs.result:
  Adding test case
mysql-test/r/ctype_ucs2_def.result:
  Adding test case
mysql-test/t/ctype_ucs.test:
  Adding test case
mysql-test/t/ctype_ucs2_def.test:
  Adding test case
sql/item_sum.cc:
  Adding conversion of separator to the result character set
sql/sql_yacc.yy:
  Fixing GROUPC_CONCAT problems when "mysqld --default-character-set=ucs2".
2007-06-22 17:18:40 +05:00
unknown
099be80130 Bug#28846 Use of undocumented Prepared Statements crashes server
ALTER VIEW is currently not supported as a prepared statement
and should be disabled as such as they otherwise could cause server crashes.

ALTER VIEW is currently not supported when called from stored
procedures or functions for related reasons and should also be disabled.

This patch disables these DDL statements and adjusts the appropriate test
cases accordingly.

Additional tests has been added to reflect on the fact that we do support
CREATE/ALTER/DROP TABLE for Prepared Statements (PS), Stored Procedures (SP)
and PS within SP.


mysql-test/r/ps_1general.result:
  - Updated test to reflect on the new policy to disallow ALTER VIEW within SP.
mysql-test/r/sp-dynamic.result:
  - Added PS ALTER TABLE test from within SP-context to demonstrate that CREATE/ALTER/DROP
  TABLE statements is working.
  - Added PS CREATE/ALTER/DROP VIEW tests from within SP-context to show that
  ALTER VIEW is not supported, CREATE VIEW/DROP VIEW are supported.
mysql-test/r/sp-error.result:
  - Updated test to reflect on the new policy to disallow VIEW DDL within SP.
mysql-test/t/ps_1general.test:
  - Updated test to reflect on the new policy to disallow VIEW DDL within SP.
mysql-test/t/sp-dynamic.test:
  - Add PS ALTER TABLE test from within SP to demonstrate that CREATE/ALTER/DROP
  TABLE statements are supported.
mysql-test/t/sp-error.test:
  - Updated test to reflect on the new policy to disallow ALTER VIEW
  within SP-context.
  - Changed error code 1314 to the more abstract ER_SP_BADSTATEMENT.
sql/sql_class.h:
  - Added comment for clarity
sql/sql_parse.cc:
  - Added comment for clarity
sql/sql_prepare.cc:
  - Disallow ALTER VIEW as prepared statements until they are
    properly supported. Note that SQLCOM_CREATE_VIEW also handles ALTER VIEW
    statements.
sql/sql_view.cc:
  - converted to doxygen comments
  - Added comment for clarity
sql/sql_yacc.yy:
  - Disallow ALTER VIEW statements within a SP.
  If the parser is operating within the SP context, this is shown
  on the sp->sphead pointer. If this flag is set for view DDL operations
  we stop parsing with the error 'ER_SP_BAD_STATEMENT'.
2007-06-22 11:55:48 +02:00
unknown
f0dbd3101e Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  maint1.mysql.com:/data/localhome/tsmith/bk/maint/50
2007-06-22 11:23:12 +02:00
unknown
e434a5ca05 Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/28839/my50-28839
2007-06-22 10:12:15 +05:00
unknown
cb606a661a rpl_skip_error.test fixed
mysql-test/r/rpl_skip_error.result:
  test result fixed
mysql-test/t/rpl_skip_error.test:
  inconsistent column results hidden
2007-06-22 09:28:38 +05:00
unknown
37344c68f5 Bug #29138 'kill' fails in pushbuild
The reason the "reap;" succeeds unexpectedly is because the query was completing(almost always) and the network buffer was big enough to store the query result (sometimes) on Windows, meaning the response was completely sent before the server thread could be killed.

Therefore we use a much longer running query that doesn't have a chance to fully complete before the reap happens, testing the kill properly.


mysql-test/r/kill.result:
  We use a much longer running query that doesn't have a chance to fully complete before the reap happens.
mysql-test/t/kill.test:
  We use a much longer running query that doesn't have a chance to fully complete before the reap happens.
2007-06-21 21:39:52 -04:00
unknown
1944601586 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug29104


sql/item.cc:
  Auto merged
2007-06-21 15:25:23 -07:00
unknown
fc7f407a11 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  maint1.mysql.com:/data/localhome/tsmith/bk/maint/50


mysql-test/t/innodb.test:
  Auto merged
mysql-test/r/innodb.result:
  Manual merge
2007-06-21 20:09:04 +02:00
unknown
0e99d690cb Merge maint1.mysql.com:/data/localhome/tsmith/bk/50
into  maint1.mysql.com:/data/localhome/tsmith/bk/maint/50


configure.in:
  Auto merged
2007-06-21 18:28:52 +02:00
unknown
12e1a9df4f Merge mysql.com:/nfsdisk1/lars/bk/mysql-5.0
into  mysql.com:/nfsdisk1/lars/bk/mysql-5.0-rpl
2007-06-21 17:10:35 +02:00
unknown
8b3c5753c7 Test fix 2007-06-21 16:55:52 +02:00
unknown
022ee2b0b3 Merge pilot.(none):/data/msvensson/mysql/bug28769/my50-bug28769
into  pilot.(none):/data/msvensson/mysql/mysql-5.0-maint
2007-06-21 15:14:00 +02:00
unknown
f77d416821 Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/28839/my50-28839
2007-06-21 15:28:19 +05:00
unknown
4cd1b2d313 rpl_skip_error test fixed
mysql-test/r/rpl_skip_error.result:
  result fixed
mysql-test/t/rpl_skip_error.test:
  master port dependency eliminated
2007-06-21 15:25:28 +05:00
unknown
8c353de957 Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/28839/my50-28839


sql/log_event.cc:
  Auto merged
2007-06-21 12:04:13 +05:00
unknown
b5eb3fcb82 Fixed bug #28293.
Occasionally mysqlbinlog --hexdump failed with error:
  ERROR 1064 (42000) at line ...: You have an error in your
  SQL syntax; check the manual that corresponds to your MySQL
  server version for the right syntax to use near
  'Query thread_id=... exec_time=... error_code=...

When the length of hexadecimal dump of binlog header was
divisible by 16, commentary sign '#' after header was lost.
The Log_event::print_header function has been modified to always
finish hexadecimal binlog header with "\n# ".


sql/log_event.cc:
  Fixed bug #28293.
  The Log_event::print_header function has been modified to always
  finish hexadecimal binlog header with "\n# ".
mysql-test/r/mysqlbinlog.result:
  Updated test case for bug #28293.
mysql-test/t/mysqlbinlog.test:
  Updated test case for bug #28293.
2007-06-21 02:11:28 +05:00
unknown
39bf2b9662 Fixed bug #29104: assertion abort for grouping queries using views.
The abort happened when a query contained a conjunctive predicate
of the form 'view column = constant' in the WHERE condition and 
the grouping list also contained a reference to a view column yet
a different one.

Removed the failing assertion as invalid in a general case.

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


mysql-test/r/view.result:
  Added a test case for bug #29104.
mysql-test/t/view.test:
  Added a test case for bug #29104.
sql/item.cc:
  Fixed bug #29104: assertion abort for grouping queries using views.
  The abort happened when a query contained a conjunctive predicate
  of the form 'view column = constant' in the WHERE condition and 
  the grouping list also contained a reference to a view column yet
  a different one.
  
  Removed the failing assertion as invalid in a general case.
  
  Also fixed a bug that prevented applying some optimization for grouping
  queries using views. If the WHERE condition of such a query contains
  a conjunctive condition of the form 'view column = constant' and
  this view column is used in the grouping list then grouping by this
  column can be eliminated. The bug blocked performing this elimination.
  This bug was in the function Item_field::eq while the failing
  assertion was in the function Item_direct_view_ref::eq.
2007-06-20 12:43:14 -07:00
unknown
cb3ce981c7 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0


mysql-test/r/innodb_mysql.result:
  SCCS merged
mysql-test/t/innodb_mysql.test:
  SCCS merged
2007-06-20 19:25:44 +03:00
unknown
9b8b0000ce Allow multiple calls to mysql_server_end()
(Part of fix for Bug#25621 Error in my_thread_global_end(): 1 threads didn't exit)
Give correct error message if InnoDB table is not found
(This allows us to drop a an innodb table that is not in the InnoDB registery)


BitKeeper/etc/ignore:
  added include/abi_check
libmysql/libmysql.c:
  Allow multiple calls to mysql_server_end()
  (Part of fix for Bug#25621 Error in my_thread_global_end(): 1 threads didn't exit)
mysql-test/r/innodb_mysql.result:
  Test case for drop of table that only has a .frm file
mysql-test/t/innodb_mysql.test:
  Test case for drop of table that only has a .frm file
sql/ha_innodb.cc:
  Give correct error message if InnoDB table is not found.
  (This allows us to drop a an innodb table that is not in the InnoDB registery)
2007-06-20 19:22:27 +03:00
unknown
39cc31b307 BUG#29030 (DROP USER command that errors still gets written to binary log
and replicated):

A DROP USER statement with a non-existing user was correctly written to
the binary log (there might be users that were removed, but not all),
but the error code was not set, which caused the slave to stop with an
error.

The error reporting code was moved to before the statement was logged
to ensure that the error information for the thread was correctly set
up. This works since my_error() will set the fields net.last_errno and
net.last_error for the thread that is reporting the error, and this
will then be picked up when the Query_log_event is created and written
to the binary log.


sql/sql_acl.cc:
  Moving error reporting code to ensure that thd->net.last_err{or,no} is
  set and adding debug printout.
mysql-test/r/rpl_grant.result:
  New BitKeeper file ``mysql-test/r/rpl_grant.result''
mysql-test/t/rpl_grant.test:
  New BitKeeper file ``mysql-test/t/rpl_grant.test''
2007-06-20 14:24:31 +02:00
unknown
e0ab35230e Merge magare.gmz:/home/kgeorge/mysql/work/B29116-4.1-opt
into  magare.gmz:/home/kgeorge/mysql/work/B29116-5.0-opt


mysql-test/t/rpl_change_master.test:
  Auto merged
2007-06-20 12:46:56 +03:00
unknown
4310ceb0f9 Merge gleb.loc:/home/uchum/work/bk/5.0-opt-28898
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-06-20 14:22:32 +05:00
unknown
8e35de2a90 metadata.test, metadata.result:
Updated test case for bug #28898. Additional cleanup.


mysql-test/t/metadata.test:
  Updated test case for bug #28898. Additional cleanup.
mysql-test/r/metadata.result:
  Updated test case for bug #28898. Additional cleanup.
2007-06-20 14:21:48 +05:00
unknown
d5cc204e58 Bug #28839 Errors in strict mode silently stop SQL thread if --slave-skip-errors exists.
slave_sql thread calls thd->clear_error() to force error to be ignored,
though this method didn't clear thd->killed state, what causes
slave_sql thread to stop.

clear thd->killed state if we ignore an error


mysql-test/r/rpl_skip_error.result:
  Bug #28839 Errors in strict mode silently stop SQL thread if --slave-skip-errors exists.
  
  test result
mysql-test/t/rpl_skip_error.test:
  Bug #28839 Errors in strict mode silently stop SQL thread if --slave-skip-errors exists.
  
  test case
sql/log_event.cc:
  Bug #28839 Errors in strict mode silently stop SQL thread if --slave-skip-errors exists.
  
  clear thd->killed state if we ignore the error
2007-06-20 14:05:49 +05:00
unknown
e2aa6ee13e Merge gleb.loc:/home/uchum/work/bk/5.0-opt-28898
into  gleb.loc:/home/uchum/work/bk/5.0-opt


sql/sql_select.cc:
  Auto merged
2007-06-20 13:06:24 +05:00
unknown
e855bf33b3 Fixed bug #28898.
For a join query with GROUP BY and/or ORDER BY and a view reference
in the FROM list the metadata erroneously showed empty table aliases
and database names for the view columns.



sql/item.h:
  Fixed bug #28898.
  Body of Item_ref::get_tmp_table_item method has been moved
  to item.cc file.
mysql-test/t/metadata.test:
  Updated test case for bug #28898.
sql/item.cc:
  Fixed bug #28898.
  The Item_ref::get_tmp_table_item method has been modified
  to copy pointers to the table alias and database name to the new
  Item_field object created for a field stored in the temporary
  table.
mysql-test/r/metadata.result:
  Updated test case for bug #28898.
sql/sql_select.cc:
  Fixed bug #28898.
  The change_to_use_tmp_fields function has been modified to
  to copy pointers to the table alias and database name from
  the Item_ref objects to the new Item_field objects created
  for fields stored in the temporary table.
2007-06-20 12:25:07 +05:00
unknown
bfc61f2ea9 Merge damien-katzs-computer.local:/Users/dkatz/mysql50
into  damien-katzs-computer.local:/Users/dkatz/50_win


sql/sql_yacc.yy:
  Auto merged
2007-06-19 18:03:47 -04:00
unknown
cb5f8fa50b Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.(none):/opt/local/work/mysql-5.0-runtime
2007-06-19 14:53:13 +04:00
unknown
f0d59bf49e Bug #29116: Test "rpl_change_master" returns different
counters from relay

Updated the test to return columns vertically.


mysql-test/r/rpl_change_master.result:
  Bug #29116: test updated
mysql-test/t/rpl_change_master.test:
  Bug #29116: test updated
2007-06-19 13:19:20 +03:00
unknown
71eff9f175 Merge bk-internal:/home/bk/mysql-5.0-maint
into  pilot.(none):/data/msvensson/mysql/mysql-5.0-maint


mysql-test/mysql-test-run.pl:
  Auto merged
mysql-test/t/mysqltest.test:
  Auto merged
2007-06-19 11:34:54 +02:00
unknown
9fb4bffa37 Merge bk-internal:/home/bk/mysql-4.1-maint
into  pilot.(none):/data/msvensson/mysql/mysql-4.1-maint
2007-06-19 11:30:45 +02:00
unknown
8d04d7bba1 Merge pilot.(none):/data/msvensson/mysql/wl3232/my41-wl3232
into  pilot.(none):/data/msvensson/mysql/wl3232/my50-wl3232


mysql-test/r/mysqltest.result:
  Auto merged
mysql-test/t/mysqltest.test:
  Auto merged
2007-06-19 11:07:39 +02:00
unknown
9aac6fd7bd WL#3232 mysqltest, enable --source $variables/<remaining_path_to_file>
- Add test case for this already existing feature 


mysql-test/r/mysqltest.result:
  Update result file
mysql-test/t/mysqltest.test:
  Add test case for this feature
2007-06-19 11:06:02 +02:00
unknown
b269713c10 Bug#28769 Test case "innodb" fails with --skip-log-bin
- Move binlog related tests to binlog_innodb.test
 - Remove "source include/have_log_bin.inc" from innodb.test


mysql-test/r/innodb.result:
  Move binlog related tests to binlog_innodb.test
mysql-test/t/innodb.test:
  Move binlog related tests to binlog_innodb.test
mysql-test/r/binlog_innodb.result:
  Move binlog related tests to binlog_innodb.test
mysql-test/t/binlog_innodb.test:
  Move binlog related tests to binlog_innodb.test
2007-06-19 09:56:19 +02:00
unknown
5941479ee3 Bug #28921 Queries containing UDF functions are cached
Fixed runtime to no longer allow the caching of queries with UDF calls.


mysql-test/r/udf.result:
  Added a test that turns on caching and checks that querys calling UDFs don't get cached.
mysql-test/t/udf.test:
  Added a test that turns on caching and checks that querys calling UDFs don't get cached.
sql/sql_yacc.yy:
  Fixed code to set safe_to_cache_query=0 regardless if the function call is a UDF or SP. Where it was placed previously -- at the very end of the else testing for UDFs -- it only executed the statement if the function call was a stored procedure call.
2007-06-18 17:55:12 -04:00
unknown
2a9bb27424 Bug #29053 SQL_CACHE in UNION causes non-deterministic functions to be cached
Changed code to enforce that SQL_CACHE only in the first SELECT is used to turn on caching(as documented), but any SQL_NO_CACHE will turn off caching (not documented, but a useful behaviour, especially for machine generated queries). Added test cases to explicitly test the documented caching behaviour and test cases for the reported bug. 


mysql-test/r/query_cache.result:
  Added non-bug specific tests that ensure that only SQL_CACHE in the first SELECT is respected when encountered by the parser. These tests validate what is already documented, that only the outer most SELECTS can use the SQL_CACHE option to turn on caching. Because it would break existing SQL applications, we do not return an error if the SQL_CACHE expression is found in nested SELECTs. Also added test to validate nested SELECT can contain SQL_NO_CACHE and it will always turn off caching for the whole query. 
  
  Also added a bug specific test case to validate that the buggy behavior as reported has been fixed.
mysql-test/t/query_cache.test:
  Added non-bug specific tests that ensure that only SQL_CACHE in the first SELECT is respected when encountered by the parser. These tests validate what is already documented, that only the outer most SELECTS can use the SQL_CACHE option to turn on caching. Because it would break existing SQL applications, we do not return an error if the SQL_CACHE expression is found in nested SELECTs. Also added test to validate nested SELECT can contain SQL_NO_CACHE and it will always turn off caching for the whole query. 
  
  Also added a bug specific test case to validate that the buggy behavior as reported has been fixed.
sql/sql_yacc.yy:
  Added an explicit check to make sure "SELECT SQL_CACHE" only works on the first select in a query.
  
  The parser will always hit the outermost SELECT first, and if the SQL_CACHE option is found it sets the safe_to_query flag in the lex. Then, if there are subseqent "uncachable" subqueries or functions, as it parses those elements it sets the safe_to_query to 0. However, this cause problems if nested SELECTs also used the SQL_CACHE option, because then it would set back safe_to_query to 1, even though there are uncacheable expressions previously parsed.
  
  By adding the check to ensure only the first SELECT can turn caching on, it means a subsequent SQL_CACHE option can't turn caching back on after a uncacheable subsequery was already encountered.
2007-06-18 17:16:20 -04:00
unknown
34a55d77e4 Merge maint1.mysql.com:/data/localhome/tsmith/bk/50
into  maint1.mysql.com:/data/localhome/tsmith/bk/maint/50
2007-06-18 22:11:49 +02:00
unknown
ccae0cf8b2 Merge gleb.loc:/home/uchum/work/bk/5.0
into  gleb.loc:/home/uchum/work/bk/5.0-opt


sql/item_func.cc:
  Auto merged
2007-06-18 18:45:55 +05:00
unknown
3d31e3d641 Bug#28677: SELECT on missing column gives extra error
The method select_insert::send_error does two things, it rolls back a statement
being executed and outputs an error message. But when a 
nonexistent column is referenced, an error message has been published already and
there is no need to publish another.
Fixed by moving all functionality beyond publishing an error message into 
select_insert::abort() and calling only that function.


mysql-test/r/errors.result:
  Bug#28677: test result
mysql-test/t/errors.test:
  Bug#28677: test case
sql/sql_class.h:
  Bug#28677: overriding abort()
sql/sql_insert.cc:
  Bug#28677: 
  - moved everything beyond producing an error message out of select_insert::send_error 
  and into new override select_insert::abort() 
  - made corresponding move of code from select_create::send_error to select_create::abort
sql/sql_select.cc:
  Bug#28677: No need to pusblish an error here
2007-06-18 16:35:01 +03:00
unknown
6633093592 Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge
2007-06-18 12:02:39 +02:00
unknown
caf55fffef Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge


mysql-test/t/innodb.test:
  Auto merged
2007-06-18 09:33:43 +02:00
unknown
82a7ceb315 Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-engines
2007-06-17 22:06:34 +02:00
unknown
c982517540 correct test and result 2007-06-17 22:04:01 +02:00
unknown
145696de54 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug27130


mysql-test/r/func_str.result:
  Manual merge
mysql-test/t/func_str.test:
  Manual merge
2007-06-17 11:35:14 -07:00
unknown
a07b055b9a Fixed bug #27130. If the third argument of the function SUBSTR was
represented by an expression of the type UNSIGNED INT and this 
expression was evaluated to 0 then the function erroneously returned
the value of the first argument instead of an empty string. 

This problem was introduced by the patch for bug 10963.

The problem has been resolved by a proper modification of the code of
Item_func_substr::val_str.


mysql-test/r/func_str.result:
  Added a test case for bug #27130.
mysql-test/t/func_str.test:
  Added a test case for bug #27130.
2007-06-17 11:23:19 -07:00
unknown
2eb468f322 Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-engines


sql/handler.h:
  Auto merged
2007-06-17 19:52:01 +02:00
unknown
1f2c0193f4 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
2007-06-17 19:50:07 +02:00
unknown
57667d06c2 Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-engines
2007-06-17 19:28:01 +02:00
unknown
f2c7b62a3e BUG#27640
- correct test and result file
2007-06-17 19:27:20 +02:00
unknown
0df9dea436 Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-engines
2007-06-17 16:26:35 +02:00
unknown
c18b568983 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/home/ram/work/b28144/b28144.5.0
2007-06-17 10:10:36 +05:00
unknown
67988a75fc bigint.test:
Updated test case for bug #28625.


mysql-test/t/bigint.test:
  Updated test case for bug #28625.
2007-06-16 17:00:29 +05:00
unknown
3e2e6ea9e3 Merge chilla.local:/home/mydev/mysql-5.0-amain
into  chilla.local:/home/mydev/mysql-5.0-axmrg


configure.in:
  Auto merged
sql/mysqld.cc:
  Auto merged
2007-06-16 11:34:21 +02:00
unknown
b1dc106bf0 Merge gleb.loc:/home/uchum/work/bk/5.0-opt
into  gleb.loc:/home/uchum/work/bk/5.0-opt-28625


sql/item_func.cc:
  Auto merged
2007-06-16 13:49:26 +05:00
unknown
1b9f594f4a Fixed bug #28625:
DECIMAL column was used instead of BIGINT for the minimal possible
BIGINT (-9223372036854775808).

The Item_func_neg::fix_length_and_dec has been adjusted to
to inherit the type of the argument in the case when it's an 
Item_int object whose value is equal to LONGLONG_MIN.


sql/item_func.cc:
  Fixed bug #28625.
  The Item_func_neg::fix_length_and_dec has been adjusted to
  to inherit the type of the argument in the case when it's an 
  Item_int object whose value is equal to LONGLONG_MIN.
mysql-test/t/bigint.test:
  Added test result for bug #28625.
mysql-test/r/bigint.result:
  Added test case for bug #28625.
2007-06-16 13:05:07 +05:00
unknown
651a8e7f73 binlog.result, binlog.test:
Post-merge fix: replace xid=* with XID to isolate from number of transactions


mysql-test/r/binlog.result:
  Post-merge fix: replace xid=* with XID to isolate from number of transactions
mysql-test/t/binlog.test:
  Post-merge fix: replace xid=* with XID to isolate from number of transactions
2007-06-15 23:57:53 +02:00
unknown
5b013eb685 Fixed warnings raised from mysqltest (unknown -- commands) 2007-06-15 11:15:22 -06:00
unknown
c2db927bf7 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/jun14/50


configure.in:
  Auto merged
sql/mysqld.cc:
  Auto merged
2007-06-15 17:59:04 +02:00