Commit graph

11200 commits

Author SHA1 Message Date
cmiller@zippy.cornsilk.net
cdc03f7a19 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
2007-08-07 06:53:40 -04:00
cmiller@zippy.cornsilk.net
c2df7e082a Merge zippy.cornsilk.net:/home/cmiller/work/mysql/bug27562/my50-bug27562
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
2007-08-07 06:52:34 -04:00
cmiller@zippy.cornsilk.net
0221888e39 Bug#27562: ascii.xml invalid?
Two character mappings were way off (backtick and tilde were "E"
and "Y"!), and three others were slightly rotated.  The first 
would cause collisions, and the latter was probably benign.

Now, assign the character mappings exactly to their normal values.
2007-08-07 05:35:20 -04:00
mkindahl@dl145h.mysql.com
ea9848094a Merge mkindahl@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.0-2team
2007-08-03 18:59:16 +02:00
bar@mysql.com/bar.myoffice.izhnet.ru
7754da28f9 After merge fix 2007-08-03 15:57:14 +05:00
bar@bar.myoffice.izhnet.ru
c01ce7b1e3 Merge mysql.com:/home/bar/mysql-work/mysql-5.0.b28875
into  mysql.com:/home/bar/mysql-work/mysql-5.0-rpl
2007-08-03 15:30:31 +05:00
bar@mysql.com/bar.myoffice.izhnet.ru
4eebfd09c2 Bug#28875 Conversion between ASCII and LATIN1 charsets does not function
(Regression, caused by a patch for the bug 22646).
Problem: when result type of date_format() was changed from
binary string to character string, mixing date_format()
with a ascii column in CONCAT() stopped to work.
Fix:
- adding "repertoire" flag into DTCollation class,
to mark items which can return only pure ASCII strings.
- allow character set conversion from pure ASCII to other character sets.
2007-08-03 15:25:23 +05:00
ramil/ram@ramil.myoffice.izhnet.ru
0d9301585b Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/home/ram/work/b30088/b30088.5.0
2007-08-02 18:23:23 +05:00
tsmith@ramayana.hindu.god
534c3f325d Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/50
2007-08-01 18:39:13 -06:00
tsmith@ramayana.hindu.god
8575227571 Merge ramayana.hindu.god:/home/tsmith/m/bk/50
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/50
2007-08-01 18:14:50 -06:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
7fb417d0ba Fix for bug #29928: INSERT ... VALUES(connection_id(), ...) incorrect
restores from mysqlbinlog out

Problem: using "mysqlbinlog | mysql" for recoveries the connection_id() 
result may differ from what was used when issuing the statement.

Fix: if there is a connection_id() in a statement, write to binlog
SET pseudo_thread_id= XXX; before it and use the value later on.
2007-08-01 15:27:03 +05:00
kostja@bodhi.(none)
d0dc51b4f7 Fix an unstable test. It was reliant on the current time. 2007-08-01 12:28:08 +04:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
c62d7528c8 Fix for bug #30088: Can't disable myisam-recover by a value of "".
- test result.

Problem: we don't proper handle "" value of the --myisam-recover option.

Fix: turn off myisam recovering if --myisam-recover="" is set.
2007-08-01 11:41:13 +05:00
kostja@bodhi.(none)
1bf318b895 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.(none):/opt/local/work/mysql-5.0-runtime
2007-07-31 20:03:52 +04:00
gkodinov/kgeorge@magare.gmz
daa5c20360 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B27417-5.0-opt
2007-07-31 15:23:25 +03:00
holyfoot/hf@hfmain.(none)
de8f84adfd Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/hf/work/29717/my50-29717
2007-07-31 11:53:56 +05:00
gshchepa/uchum@gleb.loc
120866c273 Merge gleb.loc:/home/uchum/work/bk/5.0-opt-30120
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-07-31 11:16:11 +05:00
holyfoot/hf@mysql.com/hfmain.(none)
0c63efcaf5 merging 2007-07-31 11:10:03 +05:00
gkodinov/kgeorge@magare.gmz
9a0e6ec6d2 (pushing for Andrei)
Bug #27417 thd->no_trans_update.stmt lost value inside of SF-exec-stack
  
Once had been set the flag might later got reset inside of a stored routine 
execution stack.
The reason was in that there was no check if a new statement started at time 
of resetting.
The artifact affects most of binlogable DML queries. Notice, that multi-update 
is wrapped up within
  bug@27716 fix, multi-delete bug@29136.
  
Fixed with saving parent's statement flag of whether the statement modified 
non-transactional table, and unioning (merging) the value with that was gained 
in mysql_execute_command.
  
Resettling thd->no_trans_update members into thd->transaction.`member`;
Asserting code;
Effectively the following properties are held.
  
1. At the end of a substatement thd->transaction.stmt.modified_non_trans_table
   reflects the fact if such a table got modified by the substatement.
   That also respects THD::really_abort_on_warnin() requirements.
2. Eventually thd->transaction.stmt.modified_non_trans_table will be computed as
   the union of the values of all invoked sub-statements.
   That fixes this bug#27417;

Computing of thd->transaction.all.modified_non_trans_table is refined to base to 
the stmt's value for all the case including insert .. select statement which 
before the patch had an extra issue bug@28960.
Minor issues are covered with mysql_load, mysql_delete, and binloggin of insert in
to temp_table select. 
  
The supplied test verifies limitely, mostly asserts. The ultimate testing is defered
for bug@13270, bug@23333.
2007-07-30 18:27:36 +03:00
evgen@moonbone.local
002696b648 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/24989-bug-5.0-opt-mysql
2007-07-30 18:10:34 +04:00
evgen@moonbone.local
8de5603d1d Bug#24989: The DEADLOCK error is improperly handled by InnoDB.
When innodb detects a deadlock it calls ha_rollback_trans() to rollback the 
main transaction. But such action isn't allowed from inside of triggers and
functions. When it happen the 'Explicit or implicit commit' error is thrown
even if there is no commit/rollback statements in the trigger/function. This
leads to the user confusion.

Now the convert_error_code_to_mysql() function doesn't call the 
ha_rollback_trans() function directly but rather calls the
mark_transaction_to_rollback function and returns an error.
The sp_rcontext::find_handler() now doesn't allow errors to be caught by the
trigger/function error handlers when the thd->is_fatal_sub_stmt_error flag
is set. Procedures are still allowed to catch such errors.
The sp_rcontext::find_handler function now accepts a THD handle as a parameter.
The transaction_rollback_request and the is_fatal_sub_stmt_error flags are 
added to the THD class. The are initialized by the THD class constructor.
Now the ha_autocommit_or_rollback function rolls back main transaction
when not in a sub statement and the thd->transaction_rollback_request
is set.
The THD::restore_sub_statement_state function now resets the 
thd->is_fatal_sub_stmt_error flag on exit from a sub-statement.
2007-07-30 17:14:34 +04:00
gshchepa/uchum@gleb.loc
1eb20fc0a5 Fixed bug #30120.
SP with local variables with non-ASCII names crashed the server.

The server replaces SP local variable names with NAME_CONST calls
when putting statements into the binary log. It used UTF8-encoded
item names as variable names for the replacement inside NAME_CONST
calls. However, statement string may be encoded by any
known character set by the SET NAMES statement.
The server used byte length of UTF8-encoded names to increment
the position in the query string that led to array index overrun.
2007-07-30 04:35:16 +05:00
evgen@moonbone.local
e53a484ec9 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/29856-bug-5.0-opt-mysql
2007-07-28 22:47:03 +04:00
gshchepa/uchum@gleb.loc
d90a826271 Merge gshchepa@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-07-28 23:47:02 +05:00
gshchepa/uchum@gleb.loc
a077dd8f61 Merge gleb.loc:/home/uchum/work/bk/5.0-opt-29834
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-07-28 23:36:27 +05:00
gshchepa/uchum@gleb.loc
ff5d72021e Fixed bug #29834.
Using view columns by their names during an execution of
a prepared SELECT statement or a SELECT statement inside
a SP caused a memory leak.
2007-07-28 23:10:38 +05:00
evgen@moonbone.local
72311008e5 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/30020-bug-5.0-opt-mysql
2007-07-28 21:39:03 +04:00
gshchepa/uchum@gleb.loc
d9f7c44351 Merge gleb.loc:/home/uchum/work/bk/5.0
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-07-28 21:24:19 +05:00
evgen@moonbone.local
f18b23861a Bug#30020: Insufficient check led to a wrong info provided by the
information schema table.

The get_schema_views_record() function fills records in the view table of
the informations schema with data about given views. Among other info
the is_updatable flag is set. But the check whether the view is updatable or
not wasn't covering all cases thus sometimes providing wrong info.
This might led to a user confusion.

Now the get_schema_views_record function additionally calls to the 
view->can_be_merge() function to find out whether the view can be updated or
not.
2007-07-28 16:02:29 +04:00
evgen@moonbone.local
123666299e 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.
2007-07-28 15:01:29 +04:00
holyfoot/hf@hfmain.(none)
e4f4a46f76 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
thek@adventure.(none)
8f5fad2c34 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
thek@adventure.(none)
889b4ebcee 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.
2007-07-27 16:56:29 +02:00
holyfoot/hf@mysql.com/hfmain.(none)
03dfd986d7 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.
2007-07-27 18:42:25 +05:00
kostja@bodhi.(none)
11c57540f7 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.
2007-07-27 16:37:29 +04:00
svoj@june.mysql.com
81905ee14f 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
svoj@mysql.com/june.mysql.com
9d1bfec265 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.
2007-07-27 14:30:25 +05:00
sergefp@pylon.mylan
3301955b6e Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/psergey/mysql-5.0-bdb-fix
2007-07-26 20:54:28 +04:00
sergefp@mysql.com
9c8262da33 BUG#28591: make the fix work for BDB tables too:
- make ha_berkeley::cmp_ref() take into account that auto-generated PKs 
   are stored in LSB-first order. 
 - Remove the temporary code that made the bugfix work for innodb only
2007-07-26 20:52:53 +04:00
acurtis/antony@ltamd64.xiphis.org
c2080430c3 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
gkodinov/kgeorge@magare.gmz
f98eb3a634 Addendum to bug 29571: wait for INSERT DELAYED to finish on master 2007-07-26 16:59:21 +03:00
gkodinov/kgeorge@magare.gmz
9bc5e92614 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B29571-5.0-opt
2007-07-26 11:32:27 +03:00
gkodinov/kgeorge@magare.gmz
02fe5e27d2 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.
2007-07-26 11:31:10 +03:00
gshchepa/uchum@gleb.loc
bb22e3667e Merge gleb.loc:/home/uchum/work/bk/5.0
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-07-26 03:33:43 +05:00
acurtis/antony@xiphis.org/ltamd64.xiphis.org
fbcd70a494 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.
2007-07-25 12:23:24 -07:00
anozdrin/alik@ibm.
9f8593e81c 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.
2007-07-25 19:46:50 +04:00
tsmith@ramayana.hindu.god
9524c9670d Merge ramayana.hindu.god:/home/tsmith/m/bk/50
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/jul24/50
2007-07-24 16:12:23 -06:00
evgen@moonbone.local
fd1a43b080 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.
2007-07-24 18:15:44 +04:00
acurtis/antony@ltamd64.xiphis.org
bfeb65d095 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
antony@pcg5ppc.xiphis.org
6b38c5b762 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.
2007-07-23 23:35:43 -07:00