Commit graph

35306 commits

Author SHA1 Message Date
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
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
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
holyfoot/hf@mysql.com/hfmain.(none)
60e0dceae8 Merge mysql.com:/home/hf/work/mrg/mysql-4.1-opt
into  mysql.com:/home/hf/work/mrg/mysql-5.0-opt
2007-03-09 13:39:03 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
4752db40e8 aftermerge fix 2007-03-09 13:37:06 +04: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
holyfoot/hf@mysql.com/hfmain.(none)
618ccf376f Merge bk@192.168.21.1:mysql-4.1
into  mysql.com:/home/hf/work/mrg/mysql-4.1-opt
2007-03-08 21:14:31 +04:00
evgen@moonbone.local
35e5925673 sql_select.cc:
Postfix for bug#22331.
2007-03-08 19:38:21 +03:00
msvensson@pilot.blaudden
193c3178bc Merge bk-internal:/home/bk/mysql-4.1-maint
into  pilot.blaudden:/home/msvensson/mysql/mysql-4.1-maint
2007-03-08 15:10:24 +01:00
msvensson@pilot.blaudden
433d3e6cf7 Merge pilot.blaudden:/home/msvensson/mysql/mysql-4.1-maint
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
2007-03-08 14:55:39 +01:00
msvensson@pilot.blaudden
49d862230e Merge bk-internal:/home/bk/mysql-5.0-maint
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
2007-03-08 13:30:04 +01:00
tsmith@quadxeon.mysql.com
fee7ab58c6 comp_err.c: return ha_checksum from checksum_format_specifier() - more correct, avoid a compiler warning 2007-03-08 08:15:30 +01:00
tulin/mysqldev@mysql.com/production.mysql.com
34c3cd810e Merge bk-internal:/home/bk/mysql-5.0-ndb
into  mysql.com:/data0/mysqldev/users/tomas/mysql-5.0-maint
2007-03-08 04:23:19 +01:00
tomas@poseidon.mysql.com
948ed82a2c Merge poseidon.mysql.com:/home/tomas/mysql-5.0
into  poseidon.mysql.com:/home/tomas/mysql-5.0-ndb
2007-03-08 08:33:38 +07:00
tsmith@quadxeon.mysql.com
faecfb44a4 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mar07/stage2/50
2007-03-08 02:22:50 +01:00
tsmith@quadxeon.mysql.com
d093ba4757 Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mar07/stage2/41
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mar07/stage2/50
2007-03-08 01:12:09 +01:00
tsmith@quadxeon.mysql.com
5959e8a60a Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mar07/stage2/40
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mar07/stage2/41
2007-03-08 01:06:04 +01:00
tsmith@quadxeon.mysql.com
de61dde90b Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0-build
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mar07/stage2/50
2007-03-08 01:00:49 +01:00
tsmith@quadxeon.mysql.com
6661e6b4a3 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-4.1-build
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mar07/stage2/41
2007-03-08 00:59:15 +01:00
tsmith@quadxeon.mysql.com
c06499b210 Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/50
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mrg0306/50
2007-03-07 23:55:25 +01:00
tsmith@quadxeon.mysql.com
a5e0f606af Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/40
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mrg0306/40
2007-03-07 23:54:52 +01:00
tsmith@quadxeon.mysql.com
4656023eec update test results for bdb_gis after merge of fix for b26038 2007-03-07 23:49:46 +01:00
kent@mysql.com/kent-amd64.(none)
781b271c6f Merge mysql.com:/home/kent/bk/tmp/mysql-4.1-build
into  mysql.com:/home/kent/bk/tmp/mysql-5.0-build
2007-03-07 23:07:03 +01:00
kent@mysql.com/kent-amd64.(none)
8b2a4b2c47 Merge kboortz@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/kent/bk/tmp/mysql-5.0-build
2007-03-07 23:05:46 +01:00
kent@mysql.com/kent-amd64.(none)
5736467ab6 Merge kboortz@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/home/kent/bk/tmp/mysql-4.1-build
2007-03-07 23:04:25 +01:00
evgen@moonbone.local
999c1cdcc1 sql_select.cc:
Postfix for bug#22331 for windows platform.
explain.test, explain.result:
  Cleanup after bugfix#22331.
2007-03-08 00:27:42 +03:00
evgen@moonbone.local
8936e53fca 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-07 22:23:08 +03:00
evgen@moonbone.local
c4fc9c5ef9 Merge moonbone.local:/mnt/gentoo64/work/22331-bug-5.0-opt-mysql
into  moonbone.local:/mnt/gentoo64/work/25373-bug-5.0-opt-mysql
2007-03-07 22:22:19 +03:00
evgen@moonbone.local
b81b814cd1 Bug#25373: Stored functions wasn't compared correctly which leads to a wrong
result.

For built-in functions like sqrt() function names are hard-coded and can be
compared by pointer. But this isn't the case for a used-defined stored
functions - names there are dynamical and should be compared as strings.

Now the Item_func::eq() function employs my_strcasecmp() function to compare
used-defined stored functions names.
2007-03-07 22:11:57 +03:00
evgen@moonbone.local
7afa5f1c5a Bug#22331: Wrong WHERE in EXPLAIN EXTENDED when all expressions were optimized
away.

During optimization stage the WHERE conditions can be changed or even
be removed at all if they know for sure to be true of false. Thus they aren't
showed in the EXPLAIN EXTENDED which prints conditions after optimization.

Now if all elements of an Item_cond were removed this Item_cond is substituted
for an Item_int with the int value of the Item_cond.
If there were conditions that were totally optimized away then values of the
saved cond_value and having_value will be printed instead.
2007-03-07 21:44:58 +03:00
igor@olga.mysql.com
34a643b692 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug26560
2007-03-07 07:58:34 -08:00
iggy@recycle.(none)
d3bdfa2c30 Bug#25222 Win32 HANDLE leak in my_sopen()
- When attempting to associate a Windows File handle to a C run-time file
handle there is an upper bound.  Once reached, the newly created handles
will cause a memory leak since they are not properly associated with a
handle that can later be cleaned up.
2007-03-07 10:46:38 -05:00
kostja@bodhi.local
b89b192201 A fix for the windows build (harmless warning). 2007-03-07 14:03:44 +03:00
gkodinov/kgeorge@magare.gmz
946745e1f7 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B19342-5.0-opt
2007-03-07 11:55:37 +02:00
kostja@bodhi.local
c2e0e5af09 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  bodhi.local:/opt/local/work/mysql-5.0-26750
2007-03-07 12:28:16 +03:00
kostja@bodhi.local
86f02cd378 A fix for Bug#26750 "valgrind leak in sp_head" (and post-review
fixes).

The legend: on a replication slave, in case a trigger creation
was filtered out because of application of replicate-do-table/
replicate-ignore-table rule, the parsed definition of a trigger was not 
cleaned up properly. LEX::sphead member was left around and leaked 
memory. Until the actual implementation of support of 
replicate-ignore-table rules for triggers by the patch for Bug 24478 it 
was never the case that "case SQLCOM_CREATE_TRIGGER"
was not executed once a trigger was parsed,
so the deletion of lex->sphead there worked and the memory did not leak.

The fix: 

The real cause of the bug is that there is no 1 or 2 places where
we can clean up the main LEX after parse. And the reason we 
can not have just one or two places where we clean up the LEX is
asymmetric behaviour of MYSQLparse in case of success or error. 

One of the root causes of this behaviour is the code in Item::Item()
constructor. There, a newly created item adds itself to THD::free_list
- a single-linked list of Items used in a statement. Yuck. This code
is unaware that we may have more than one statement active at a time,
and always assumes that the free_list of the current statement is
located in THD::free_list. One day we need to be able to explicitly
allocate an item in a given Query_arena.
Thus, when parsing a definition of a stored procedure, like
CREATE PROCEDURE p1() BEGIN SELECT a FROM t1; SELECT b FROM t1; END;
we actually need to reset THD::mem_root, THD::free_list and THD::lex
to parse the nested procedure statement (SELECT *).
The actual reset and restore is implemented in semantic actions
attached to sp_proc_stmt grammar rule.
The problem is that in case of a parsing error inside a nested statement
Bison generated parser would abort immediately, without executing the
restore part of the semantic action. This would leave THD in an 
in-the-middle-of-parsing state.
This is why we couldn't have had a single place where we clean up the LEX
after MYSQLparse - in case of an error we needed to do a clean up
immediately, in case of success a clean up could have been delayed.
This left the door open for a memory leak.

One of the following possibilities were considered when working on a fix:
- patch the replication logic to do the clean up. Rejected
as breaks module borders, replication code should not need to know the
gory details of clean up procedure after CREATE TRIGGER.
- wrap MYSQLparse with a function that would do a clean up.
Rejected as ideally we should fix the problem when it happens, not
adjust for it outside of the problematic code.
- make sure MYSQLparse cleans up after itself by invoking the clean up
functionality in the appropriate places before return. Implemented in 
this patch.
- use %destructor rule for sp_proc_stmt to restore THD - cleaner
than the prevoius approach, but rejected
because needs a careful analysis of the side effects, and this patch is 
for 5.0, and long term we need to use the next alternative anyway
- make sure that sp_proc_stmt doesn't juggle with THD - this is a 
large work that will affect many modules.

Cleanup: move main_lex and main_mem_root from Statement to its
only two descendants Prepared_statement and THD. This ensures that
when a Statement instance was created for purposes of statement backup,
we do not involve LEX constructor/destructor, which is fairly expensive.
In order to track that the transformation produces equivalent 
functionality please check the respective constructors and destructors
of Statement, Prepared_statement and THD - these members were
used only there.
This cleanup is unrelated to the patch.
2007-03-07 12:24:46 +03:00
tsmith@quadxeon.mysql.com
3b4032362b Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mrg0306/41
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mrg0306/50
2007-03-07 10:16:53 +01:00
evgen@moonbone.local
7b77956f58 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/25376-bug-5.0-opt-mysql
2007-03-07 12:10:59 +03:00
tsmith@quadxeon.mysql.com
98f9b507fc Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-4.1-runtime
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mrg0306/41
2007-03-07 07:02:00 +01:00
tsmith@quadxeon.mysql.com
a15fe85de2 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mrg0306/50
2007-03-07 06:54:35 +01:00
tsmith@quadxeon.mysql.com
0f95450e67 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-4.1
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/mrg0306/41
2007-03-07 05:59:56 +01:00