Commit graph

16353 commits

Author SHA1 Message Date
tomas@whalegate.ndb.mysql.com
6bab2f13b7 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
2007-03-22 05:44:39 +01:00
kostja@bodhi.local
c011a25f66 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-runtime
2007-03-21 23:57:12 +03:00
tomas@whalegate.ndb.mysql.com
37b8c96197 Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-telco-gca
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
2007-03-21 09:00:38 +01:00
tomas@whalegate.ndb.mysql.com
5682efdfcf Bug #26825 MySQL Server Crashes in high load
- initialize to NULL, to avoid call of free on uninitialized variable
2007-03-21 08:40:24 +01:00
evgen@moonbone.local
31b9145ab3 sql_insert.cc:
Removed wrong fix for the bug#27006.
  The bug was added by the fix for the bug#19978 and fixed by Monty on 2007/02/21.
trigger.test, trigger.result:
  Corrected test case for the bug#27006.
2007-03-20 00:46:19 +03:00
kostja@bodhi.local
a9065201d5 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.local:/opt/local/work/mysql-5.0-runtime
2007-03-19 23:59:53 +03:00
evgen@moonbone.local
e84584e2e3 Bug#27006: AFTER UPDATE triggers not fired with INSERT ... ON DUPLICATE KEY
UPDATE if the row wasn't actually changed.

This bug was caused by fix for bug#19978. It causes AFTER UPDATE triggers
not firing if a row wasn't actually changed by the update part of the
INSERT .. ON DUPLICATE KEY UPDATE.

Now triggers are always fired if a row is touched by the INSERT ... ON
DUPLICATE KEY UPDATE.
2007-03-16 17:23:26 +03:00
gkodinov/kgeorge@magare.gmz
830c134e84 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B26261-5.0-opt
2007-03-16 10:50:33 +02:00
gkodinov/kgeorge@macbook.gmz
61d93679c3 Bug #26261:
INSERT uses query_id to verify what fields are
 mentioned in the fields list of the INSERT command.
 However the check for that is made after the 
 ON DUPLICATE KEY is processed. This causes all
 the fields mentioned in ON DUPLICATE KEY to be 
 considered as mentioned in the fields list of 
 INSERT.
 Moved the check up, right after processing the
 fields list.
2007-03-16 10:35:39 +02:00
gluh@mysql.com/eagle.(none)
3912ce7f33 Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
2007-03-16 12:16:15 +04:00
gluh@mysql.com/eagle.(none)
ec4f730ba7 Bug#26285 selecting information_schema crahes server
The crash happens when 'skip-grant-tables' is enabled.
We skip the filling of I_S privilege tables 
if acl_cache is not initialized.
2007-03-16 12:15:51 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
1e01c70351 Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/mrg/mysql-5.0-opt
2007-03-16 12:06:36 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
5cb3d4f173 Merge bk@192.168.21.1:mysql-5.0
into  mysql.com:/home/hf/work/mrg/mysql-5.0-opt
2007-03-16 11:55:16 +04:00
evgen@moonbone.local
3d0df38f49 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/27033-bug-5.0-opt-mysql
2007-03-15 23:56:21 +03:00
evgen@moonbone.local
92c8558224 Bug#27033: 0 as LAST_INSERT_ID() after INSERT .. ON DUPLICATE if rows were
touched but not actually changed.

The LAST_INSERT_ID() is reset to 0 if no rows were inserted or changed.
This is the case when an INSERT ... ON DUPLICATE KEY UPDATE updates a row
with the same values as the row contains.

Now the LAST_INSERT_ID() values is reset to 0 only if there were no rows
successfully inserted or touched.
The new 'touched' field is added to the COPY_INFO structure. It holds the
number of rows that were touched no matter whether they were actually
changed or not.
2007-03-15 23:21:29 +03:00
holyfoot/hf@mysql.com/hfmain.(none)
2e3ce3c20f Merge mysql.com:/home/hf/work/26833/my50-26833
into  mysql.com:/home/hf/work/mrg/mysql-5.0-opt
2007-03-15 16:26:37 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
21847d6890 Merge bk@192.168.21.1:mysql-5.0
into  mysql.com:/home/hf/work/mrg/mysql-5.0-opt
2007-03-15 16:21:43 +04:00
dlenev@mockturtle.local
01bd08b5d7 Fix for bug #25966 "2MB per second endless memory consumption after LOCK
TABLE ... WRITE".

Memory and CPU hogging occured when connection which had to wait for table
lock was serviced by thread which previously serviced connection that was
killed (note that connections can reuse threads if thread cache is enabled).
One possible scenario which exposed this problem was when thread which
provided binlog dump to replication slave was implicitly/automatically
killed when the same slave reconnected and started pulling data through
different thread/connection.
The problem also occured when one killed particular query in connection
(using KILL QUERY) and later this connection had to wait for some table
lock.

This problem was caused by the fact that thread-specific mysys_var::abort
variable, which indicates that waiting operations on mysys layer should
be aborted (this includes waiting for table locks), was set by kill
operation but was never reset back. So this value was "inherited" by the
following statements or even other connections (which reused the same
physical thread). Such discrepancy between this variable and THD::killed
flag broke logic on SQL-layer and caused CPU and memory hogging.

This patch tries to fix this problem by properly resetting this member.

There is no test-case associated with this patch since it is hard to test
for memory/CPU hogging conditions in our test-suite.
2007-03-15 11:51:35 +03:00
malff/marcsql@weblab.(none)
f87899c50e Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  weblab.(none):/home/marcsql/TREE/mysql-5.0-26503
2007-03-14 14:29:27 -06:00
malff/marcsql@weblab.(none)
bef323b1d6 Bug#26503 (Illegal SQL exception handler code causes the server to crash)
Before this fix, the parser would accept illegal code in SQL exceptions
handlers, that later causes the runtime to crash when executing the code,
due to memory violations in the exception handler stack.

The root cause of the problem is instructions within an exception handler
that jumps to code located outside of the handler. This is illegal according
to the SQL 2003 standard, since labels located outside the handler are not
supposed to be visible (they are "out of scope"), so any instruction that
jumps to these labels, like ITERATE or LEAVE, should not parse.

The section of the standard that is relevant for this is :
  SQL:2003 SQL/PSM (ISO/IEC 9075-4:2003)
  section 13.1 <compound statement>,
  syntax rule 4
<quote>
  The scope of the <beginning label> is CS excluding every <SQL schema
  statement> contained in CS and excluding every
  <local handler declaration list> contained in CS. <beginning label> shall
  not be equivalent to any other <beginning label>s within that scope.
</quote>

With this fix, the C++ class sp_pcontext, which represent the "parsing
context" tree (a.k.a symbol table) of a stored procedure, has been changed
as follows:
- constructors have been cleaned up, so that only building a root node for
the tree is public; building nodes inside a tree is not public.
- a new member, m_label_scope, indicates if a given syntactic context
belongs to a DECLARE HANDLER block,
- label resolution, in the method find_label(), has been changed to
implement the restriction of scope regarding labels used in a compound
statement.

The actions in the parser, when parsing the body of a SQL exception handler,
have been changed as follows:
- the implementation of an exception handler (DECLARE HANDLER) now creates
explicitly a new sp_pcontext, to isolate the code inside the handler from
the containing compound statement context.
- registering exception handlers as a result occurs in the parent context,
see the rule sp_hcond_element
- the code in sp_hcond_list has been cleaned up, to avoid code duplication

In addition, the flags IN_SIMPLE_CASE and IN_HANDLER, declared in sp_head.h
have been removed, since they are unused and broken by design (as seen with
Bug 19194 (Right recursion in parser for CASE causes excessive stack usage,
limitation), representing a stack in a single flag is not possible.

Tests in sp-error have been added to show that illegal constructs are now
rejected.

Tests in sp have been added for code coverage, to show that ITERATE or LEAVE
statements are legal when jumping to a label in scope, inside the body of
an exception handler.
2007-03-14 12:02:32 -06:00
gkodinov/kgeorge@magare.gmz
2525db66fa Bug #26794: fixed valgrind warning 2007-03-14 15:58:14 +02:00
gkodinov/kgeorge@magare.gmz
30a16b45d7 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B26794-5.0-opt
2007-03-14 11:55:40 +02:00
gkodinov/kgeorge@magare.gmz
8c1f70aef6 Bug #26794:
Different set of conditions is used to verify
the validity of index definitions over a GEOMETRY
column in ALTER TABLE and CREATE TABLE. 
The difference was on how sub-keys notion validity
is checked.
Fixed by extending the CREATE TABLE condition to
support the cases allowed in ALTER TABLE.
Made the SHOW CREATE TABLE not to display spatial
indexes using the sub-key notion.
2007-03-14 11:54:20 +02:00
gkodinov/kgeorge@magare.gmz
96629f2c99 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B26672-5.0-opt
2007-03-13 18:46:46 +02:00
svoj@mysql.com/april.(none)
de21b9b8ef Merge mysql.com:/home/svoj/devel/mysql/BUG26881/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG26881/mysql-5.0-engines
2007-03-13 18:11:47 +04:00
svoj@mysql.com/april.(none)
cb132bea8f BUG#26881 - Large MERGE tables report incorrect specification when no
differences in tables
Certain merge tables were wrongly reported as having incorrect definition:
- Some fields that are 1 byte long (e.g. TINYINT, CHAR(1)), might
  be internally casted (in certain cases) to a different type on a
  storage engine layer. (affects 4.1 and up)
- If tables in a merge (and a MERGE table itself) had short VARCHAR column (less
  than 4 bytes) and at least one (but not all) tables were ALTER'ed (even to an
  identical table: ALTER TABLE xxx ENGINE=yyy), table definitions went ouf of
  sync. (affects 4.1 only)

This is fixed by relaxing a check for underlying conformance and setting
field type to FIELD_TYPE_STRING in case varchar is shorter than 4
when a table is created.
2007-03-13 18:02:06 +04:00
svoj@mysql.com/april.(none)
11384fece2 Merge mysql.com:/home/svoj/devel/bk/mysql-5.0
into  mysql.com:/home/svoj/devel/mysql/BUG26881/mysql-5.0-engines
2007-03-13 16:58:52 +04:00
svoj@mysql.com/april.(none)
576db4f44c Merge mysql.com:/home/svoj/devel/bk/mysql-4.1
into  mysql.com:/home/svoj/devel/mysql/BUG26881/mysql-4.1-engines
2007-03-13 16:57:16 +04:00
igor@olga.mysql.com
d0a6231201 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug26963
2007-03-12 02:24:09 -07:00
igor@olga.mysql.com
06a315ded6 Fixed bug #26738: incomplete string values in a result set column
when the column is to be read from a derived table column which 
was specified as a concatenation of string literals.
The bug happened because the Item_string::append did not adjust the
value of Item_string::max_length. As a result of it the temporary 
table column  defined to store the concatenation of literals was 
not wide enough to hold the whole value.
2007-03-12 01:39:57 -07:00
igor@olga.mysql.com
e7284ace4f Fixed bug #26963: invalid optimization of the pushdown conditions
after single-row table substitution could lead to a wrong result set.
The bug happened because the function Item_field::replace_equal_field
erroniously assumed that any field included in a multiple equality
with a constant has been already substituted for this constant.
This not true for fields becoming constant after row substitutions
for constant tables.
2007-03-11 23:34:40 -07:00
gkodinov/kgeorge@magare.gmz
ea99afb4f4 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/WL3527-5.0-opt-merge
2007-03-11 10:10:33 +02:00
evgen@moonbone.local
f3e56b5adb Merge moonbone.local:/mnt/gentoo64/work/15757-bug-5.0-opt-mysql
into  moonbone.local:/mnt/gentoo64/work/25373-bug-5.0-opt-mysql
2007-03-10 19:57:18 +03:00
evgen@moonbone.local
6f6b9ae3ad Bug#15757: Wrong SUBSTRING() result when a tmp table was employed.
When the SUBSTRING() function was used over a LONGTEXT field the max_length of
the SUBSTRING() result was wrongly calculated and set to 0. As the max_length
parameter is used while tmp field creation it limits the length of the result
field and leads to printing an empty string instead of the correct result.

Now the Item_func_substr::fix_length_and_dec() function correctly calculates
the max_length parameter.
2007-03-10 19:55:34 +03:00
evgen@moonbone.local
e7a309197b Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/25373-bug-5.0-opt-mysql
2007-03-10 19:53:59 +03:00
holyfoot/hf@mysql.com/hfmain.(none)
6088b025d7 bug #26833 (Compile error with embedded lib)
org_tables declaration was mistakenly #ifdef-ed with the EMBEDDED_LIBRARY
instead of ACCESS_CHECKS
2007-03-10 17:44:25 +04:00
igor@olga.mysql.com
ec4593f59a Fixed bug #26830: a crash for the query with a subselect containing ROLLUP.
Crash happened because the function get_best_group_min_max detected
joins with ROLLUP incorrectly.
2007-03-10 02:47:47 -08:00
evgen@moonbone.local
04f5c46d5d Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
away.

Additional fix for bug#22331. Now Item_field prints its value in the case of
the const field.
2007-03-10 00:29:02 +03:00
gkodinov/kgeorge@magare.gmz
7acdb67643 Merge bk-internal:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/work/WL3527-5.0-opt-merge
2007-03-09 16:30:44 +02:00
gkodinov/kgeorge@macbook.gmz
6bea442d26 WL#3527: Extend IGNORE INDEX so places where index is ignored can
be specified
 5.0 part of the fix. Implements IGNORE INDEX FOR JOIN as a synonym
 of IGNORE INDEX for backward compatibility with the 5.1 fix.
2007-03-09 15:20:06 +02:00
gkodinov/kgeorge@magare.gmz
9625f2e902 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B26281-5.0-opt
2007-03-09 14:48:19 +02:00
gkodinov/kgeorge@magare.gmz
86cba48b8f Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B26281-5.0-opt
2007-03-09 13:05:41 +02:00
gkodinov/kgeorge@magare.gmz
740a5fd7fe Bug #26281:
Fixed boundry checks in the INSERT() function:
 were one off.
2007-03-09 12:47:12 +02:00
igor@olga.mysql.com
e10d74cff9 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  olga.mysql.com:/home/igor/mysql-5.0-opt
2007-03-09 02:45:17 -08:00
igor@olga.mysql.com
6f4da47843 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug26661
2007-03-09 01:50:17 -08:00
igor@olga.mysql.com
96cfd5ab91 Fixed bug #26661: crash when order by clause in a union
construct references invalid name.
Derived tables currently cannot use outer references.
Thus there is no outer context for them.
The 4.1 code takes this fact into account while the 
Item_field::fix_outer_field code of 5.0 lost the check that blocks
any attempts to resolve names in outer context for derived tables.
2007-03-09 01:45:32 -08:00
holyfoot/hf@mysql.com/hfmain.(none)
2b1179ad07 Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/hf/work/mrg/mysql-5.0-opt
2007-03-09 13:44:43 +04:00
anozdrin/alik@booka.opbmk
bd5b38d66c Fix typo. 2007-03-09 10:44:48 +03:00
anozdrin/alik@booka.opbmk
c666e2f276 Polishing: use constants instead of magic numbers. 2007-03-09 08:05:08 +03:00
holyfoot/hf@mysql.com/hfmain.(none)
11dd0fa326 Merge bk@192.168.21.1:mysql-5.0
into  mysql.com:/home/hf/work/mrg/mysql-5.0-opt
2007-03-08 21:42:41 +04:00