Commit graph

15959 commits

Author SHA1 Message Date
kroki/tomash@moonlight.home
664cd8b6a9 BUG#25897: Some queries are no longer possible after a CREATE VIEW
fails

The bug was introduced with the push of the fix for bug#20953: after
the error on view creation we never reset the error state, so some
valid statements would give the same error after that.

The solution is to properly reset the error state.
2007-02-04 16:49:24 +03:00
malff/marcsql@weblab.(none)
093eba867d Improved comments 2007-02-01 09:36:17 -07:00
malff/marcsql@weblab.(none)
3c6d988756 Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  weblab.(none):/home/marcsql/TREE/mysql-5.0-21904
2007-01-30 10:16:46 -07:00
malff/marcsql@weblab.(none)
f5ad4eed95 Bug#21904 (parser problem when using IN with a double "(())")
Before this fix, a IN predicate of the form: "IN (( subselect ))", with two
parenthesis, would be evaluated as a single row subselect: if the subselect
returns more that 1 row, the statement would fail.

The SQL:2003 standard defines a special exception in the specification,
and mandates that this particular form of IN predicate shall be equivalent
to "IN ( subselect )", which involves a table subquery and works with more
than 1 row.

This fix implements "IN (( subselect ))", "IN ((( subselect )))" etc
as per the SQL:2003 requirement.

All the details related to the implementation of this change have been
commented in the code, and the relevant sections of the SQL:2003 spec
are given for reference, so they are not repeated here.

Having access to the spec is a requirement to review in depth this patch.
2007-01-29 17:32:52 -07:00
kroki/tomash@moonlight.home
f4f51a017a Merge moonlight.home:/home/tomash/src/mysql_ab/mysql-5.0
into  moonlight.home:/home/tomash/src/mysql_ab/mysql-5.0-bug23527
2007-01-25 20:10:40 +03:00
kroki/tomash@moonlight.home
68a3e96333 BUG#23527: set global query_cache_size can crash the server under
high load

MySQL server could crash if two or more threads would initiate query
cache resize at the moments very close in time.

The problem was introduced with the fix of bug 21051 in 5.0 and 5.1:
simultaneous query cache resizes would wait for the first one in
progress, but then each thread would try to finish the operation,
accessing the data that was already reset (attempt to dereference
'bins' pointer, which may be NULL already).

The solution is to check after synchronization if another thread has
done the reset already (test 'query_cache_size > 0' again).

No test case is provided because the bug is a subject to a race.
2007-01-25 20:00:12 +03:00
dlenev@mockturtle.local
8b69d169d4 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mockturtle.local:/home/dlenev/src/mysql-5.0-merge
2007-01-25 11:26:18 +03:00
svoj@mysql.com/april.(none)
de1572d687 Merge mysql.com:/home/svoj/devel/bk/mysql-5.0
into  mysql.com:/home/svoj/devel/mysql/merge/mysql-5.0-engines
2007-01-25 01:31:58 +04:00
svoj@mysql.com/april.(none)
ea7fe60fbc Merge mysql.com:/home/svoj/devel/bk/mysql-5.0
into  mysql.com:/home/svoj/devel/mysql/merge/mysql-5.0-engines
2007-01-25 01:26:57 +04:00
dlenev@mockturtle.local
c762789096 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mockturtle.local:/home/dlenev/src/mysql-5.0-merge
2007-01-24 19:33:06 +03:00
df@kahlann.erinye.com
cb6c5f7ee7 Merge kahlann.erinye.com:/home/df/mysql/build/mysql-5.0
into  kahlann.erinye.com:/home/df/mysql/build/mysql-5.0-build-work
2007-01-24 09:24:52 +01:00
tomas@poseidon.mysql.com
f869a0d605 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  poseidon.mysql.com:/home/tomas/mysql-5.0-ndb
2007-01-24 09:13:47 +07:00
dlenev@mockturtle.local
6562df201a Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mockturtle.local:/home/dlenev/src/mysql-5.0-bg24491
2007-01-23 15:57:46 +03:00
dlenev@mockturtle.local
2b63f10601 Proposed fix for bug#24491 "using alias from source table in insert ...
on duplicate key".

INSERT ... SELECT ... ON DUPLICATE KEY UPDATE which was used in
stored routine or as prepared statement and which in its ON DUPLICATE
KEY clause erroneously tried to assign value to a column mentioned only
in its SELECT part was properly emitting error on the first execution
but succeeded on the second and following executions.

Code which is responsible for name resolution of fields mentioned in
UPDATE clause (e.g. see select_insert::prepare()) modifies table list
and Name_resolution_context used in this process. It uses
Name_resolution_context_state::save_state/restore_state() to revert
these modifications. Unfortunately those two methods failed to revert
properly modifications to TABLE_LIST::next_name_resolution_table
and this broke name resolution process for successive executions.

This patch fixes Name_resolution_context_state::save_state/restore_state()
in such way that it properly handles TABLE_LIST::next_name_resolution_table.
2007-01-23 15:03:48 +03:00
pekka@clam.ndb.mysql.com/clam.(none)
56e2d4ffcb ndb - bug#25562 use byte-size max_data_length() when setting blob part size 2007-01-23 12:58:10 +01:00
tomas@poseidon.mysql.com
12911bb5c0 bug#25746 ndb: 4209 error with 2 VARCHAR primary keys
- post review changes
2007-01-23 07:12:03 +07:00
tomas@poseidon.mysql.com
9605aee4fe bug#25746 ndb: 4209 error with 2 VARCHAR primary keys
- make sure keys are copied correctly when varchar has 2 length bytes
- test case
2007-01-23 00:34:00 +07:00
joerg@trift2.
9e46e0aa74 Merge trift2.:/MySQL/M50/mysql-5.0
into  trift2.:/MySQL/M50/push-5.0
2007-01-22 10:32:22 +01:00
dlenev@mockturtle.local
92704745f7 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mockturtle.local:/home/dlenev/src/mysql-5.0-bg25044
2007-01-20 14:10:20 +03:00
dlenev@mockturtle.local
7b1a94ef78 Fix for bug #25044 "ALTER TABLE ... ENABLE KEYS acquires global 'opening
tables' lock."

Execution of ALTER TABLE ... ENABLE KEYS on a table (which can take rather
long time) prevented concurrent execution of all statements using tables.

The problem was caused by the fact that we were holding LOCK_open mutex
during whole duration of this statement and particularly during call
to handler::enable_indexes(). This behavior was introduced as part of the
fix for bug 14262 "SP: DROP PROCEDURE|VIEW (maybe more) write to binlog
too late (race cond)"

The patch simply restores old behavior. Note that we can safely do this as
this operation takes exclusive lock (similar to name-lock) which blocks both
DML and DDL on the table being altered.

It also introduces mysql-test/include/wait_show_pattern.inc helper script
which is used to make test-case for this bug robust enough.
2007-01-19 23:15:59 +03:00
ramil/ram@mysql.com/myoffice.izhnet.ru
86322e269f Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/usr/home/ram/work/bug22533/my50-bug22533
2007-01-19 08:56:03 +04:00
malff/marcsql@weblab.(none)
4064c89d24 Manual merge 2007-01-18 18:37:52 -07:00
tsmith@siva.hindu.god
244b2004ee Merge siva.hindu.god:/home/tsmith/m/bk/mrg-jan17/50
into  siva.hindu.god:/home/tsmith/m/bk/mrg-jan17/maint/50
2007-01-18 10:06:36 -07:00
ramil/ram@mysql.com/myoffice.izhnet.ru
6eba677517 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/usr/home/ram/work/bug22533/my50-bug22533
2007-01-18 17:10:00 +04:00
joerg@trift2.
f5e2857b0b Merge trift2.:/MySQL/M50/mysql-5.0
into  trift2.:/MySQL/M50/push-5.0
2007-01-18 13:33:23 +01:00
ramil/ram@mysql.com/myoffice.izhnet.ru
c57442d6d8 after merge fix. 2007-01-18 15:28:45 +04:00
kroki/tomash@moonlight.home
ec21b828f0 Merge moonlight.home:/home/tomash/src/mysql_ab/mysql-5.0
into  moonlight.home:/home/tomash/src/mysql_ab/mysql-5.0-bug24404
2007-01-18 13:06:10 +03:00
kroki/tomash@moonlight.home
6e771358ce Bug#24404: strange bug with view+permission+prepared statement.
The problem was that if a prepared statement accessed a view, the
access to the tables listed in the query after that view was done in
the security context of the view.

The bug was in the assigning of the security context to the tables
belonging to a view: we traversed the list of all query tables
instead.  It didn't show up in the normal (non-prepared) statements
because of the different order of the steps of checking privileges
and descending into a view for normal and prepared statements.

The solution is to traverse the list and stop once the last table
belonging to the view was processed.
2007-01-18 12:48:17 +03:00
ramil/ram@mysql.com/myoffice.izhnet.ru
5c42e68388 after merge fix. 2007-01-18 10:51:29 +04:00
ramil/ram@mysql.com/myoffice.izhnet.ru
e8968822dc Merge mysql.com:/usr/home/ram/work/bug22533/my41-bug22533
into  mysql.com:/usr/home/ram/work/bug22533/my50-bug22533
2007-01-18 09:39:47 +04:00
joerg@trift2.
4da7643924 Merge trift2.:/MySQL/M50/mysql-5.0
into  trift2.:/MySQL/M50/push-5.0
2007-01-17 20:56:01 +01:00
lars/lthalmann@mysql.com/dl145j.mysql.com
b25079d61a Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge
2007-01-17 19:30:05 +01:00
kostja@bodhi.local
15c9d8a6c9 Disable symlinks under valgrind builds (again), with a comment. 2007-01-17 20:46:09 +03:00
kostja@bodhi.local
a9590803fc Merge bodhi.local:/opt/local/work/mysql-4.1-runtime
into  bodhi.local:/opt/local/work/mysql-5.0-runtime-debug-max
2007-01-17 16:00:33 +03:00
kostja@bodhi.local
6399db740e Fix a failure of lowercase_tables2 test on powermacg5, introduced
by the patch for Bug#4968
2007-01-17 15:46:30 +03:00
kostja@bodhi.local
175438819a Fix a ps.test failure in 5.0-runtime tree. 2007-01-17 14:24:54 +03:00
msvensson@pilot.mysql.com
51292deb36 Merge pilot.mysql.com:/home/msvensson/mysql/mysql-5.0
into  pilot.mysql.com:/home/msvensson/mysql/mysql-5.0-maint
2007-01-17 11:53:00 +01:00
tulin/mysqldev@mysql.com/production.mysql.com
2fed34d7ea ha_ndbcluster.cc:
Bug #25668    - corrected patch after test failures
2007-01-17 10:41:52 +01:00
tulin/mysqldev@mysql.com/production.mysql.com
1d6fe0ffaa ha_ndbcluster.cc:
Bug #25668    ndb: mysqld may core if cluster disconnected
    -- pTrans may be NULL, remove not needed usage of handler::ndb_err
2007-01-17 10:06:50 +01:00
dlenev@mockturtle.local
693bc6a233 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mockturtle.local:/home/dlenev/src/mysql-5.0-bg20390-2
2007-01-16 07:25:23 +03:00
kostja@bodhi.local
6e16458487 Merge bodhi.local:/opt/local/work/mysql-4.1-runtime
into  bodhi.local:/opt/local/work/mysql-5.0-runtime
2007-01-15 23:29:02 +03:00
kostja@bodhi.local
d49ac4fbb7 A post-merge fix. 2007-01-15 23:25:16 +03:00
dlenev@mockturtle.local
af838b4c55 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mockturtle.local:/home/dlenev/src/mysql-5.0-bg20390-2
2007-01-15 13:48:07 +03:00
kostja@bodhi.local
d7a63c0f6a Manual merge. 2007-01-15 13:10:07 +03:00
kostja@bodhi.local
d53072d190 Merge bk-internal.mysql.com:/home/bk/mysql-4.1-runtime
into  bodhi.local:/opt/local/work/mysql-4.1-4968-to-push
2007-01-15 13:03:21 +03:00
dlenev@mockturtle.local
ab98cbc88a Fix for bug#20390 "SELECT FOR UPDATE does not release locks
of untouched rows in full table scans".

SELECT ... FOR UPDATE/LOCK IN SHARE MODE statements as well as
UPDATE/DELETE statements which were executed using full table
scan were not releasing locks on rows which didn't satisfy
WHERE condition.
This bug surfaced in 5.0 and affected NDB tables. (InnoDB tables
intentionally don't support such unlocking in default mode).

This problem occured because code implementing join didn't call
handler::unlock_row() for rows which didn't satisfy part of condition
attached to this particular table/level of nested loop. So we solve
the problem adding this call.
Note that we already had this call in place in 4.1 but it was lost
(actually not quite correctly placed) when we have introduced nested 
joins.

Also note that additional QA should be requested once this patch is
pushed as interaction between handler::unlock_row() and many recent
MySQL features such as subqueries, unions, views is not tested enough.
2007-01-15 12:32:38 +03:00
kostja@bodhi.local
5a99ffdf92 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-runtime
2007-01-12 21:59:17 +03:00
kostja@bodhi.local
a7862496ce Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  bodhi.local:/opt/local/work/mysql-4.1-runtime
2007-01-12 18:06:43 +03:00
lars/lthalmann@mysql.com/dl145j.mysql.com
c380de50ef Merge mysql.com:/nfsdisk1/lars/bkroot/mysql-5.0-rpl
into  mysql.com:/nfsdisk1/lars/MERGE/mysql-5.0-merge
2007-01-12 12:22:54 +01:00
gluh@mysql.com/eagle.(none)
c081e28ef5 Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.0
2007-01-12 13:57:40 +04:00