Commit graph

38156 commits

Author SHA1 Message Date
gkodinov/kgeorge@magare.gmz
846cbf3cd0 Bug #32400: Complex SELECT query returns correct result
only on some occasions

Referencing an element from the SELECT list in a WHERE 
clause is not permitted. The namespace of the WHERE
clause is the table columns only. This was not enforced
correctly when resolving outer references in sub-queries.

Fixed by not allowing references to aliases in a 
sub-query in WHERE.
2007-11-20 19:18:21 +02:00
holyfoot/hf@hfmain.(none)
7ab844c905 Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/mysql-5.0-opt
2007-11-20 17:04:42 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
f434cb6066 test case added for the bug #31155 2007-11-20 17:04:24 +04:00
holyfoot/hf@hfmain.(none)
93023d3142 Merge mysql.com:/home/hf/work/31868/my41-31868
into  mysql.com:/home/hf/work/31868/my50-31868
2007-11-20 14:51:40 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
366a87cdaf Merge mysql.com:/home/hf/work/32063/my41-32063
into  mysql.com:/home/hf/work/31868/my41-31868
2007-11-20 14:47:39 +04:00
evgen@moonbone.local
ddc04e7682 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/work/31048-bug-5.0-opt-mysql
2007-11-19 21:28:50 +00:00
evgen@moonbone.local
6f6fe52ad2 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/work/31048-bug-5.0-opt-mysql
2007-11-19 21:15:53 +00:00
evgen@moonbone.local
0288cc9dce Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/work/30384-bug-5.0-opt-mysql
2007-11-19 21:06:03 +00:00
evgen@moonbone.local
da7470afb1 Bug#30384: Having SQL_BUFFER_RESULT option in the CREATE .. KEY(..) .. SELECT
led to creating corrupted index.

Corrected fix. The new method called prepare2 is added to the select_create
class. As all preparations are done by the select_create::prepare function
it doesn't do anything. Slightly changed algorithm of calling the 
start_bulk_insert function. Now it's called from the select_insert::prepare2
function when the SQL_BUFFER_RESULT flags is set.
The is_bulk_insert_mode flag is removed as it is not needed anymore.
2007-11-19 21:05:17 +00:00
evgen@moonbone.local
67cae0d48d Bug#31048: Many nested subqueries may cause server crash.
This bug is actually two. The first one manifests itself on an EXPLAIN
SELECT query with nested subqueries that employs the filesort algorithm.
The whole SELECT under explain is marked as UNCACHEABLE_EXPLAIN to preserve
some temporary structures for explain. As a side-effect of this values of
nested subqueries weren't cached and subqueries were re-evaluated many
times. Each time buffer for filesort was allocated but wasn't freed because
freeing occurs at the end of topmost SELECT. Thus all available memory was
eaten up step by step and OOM event occur.
The second bug manifests itself on SELECT queries with conditions where
a subquery result is compared with a key field and the subquery itself also
has such condition. When a long chain of such nested subqueries is present
the stack overrun occur. This happens because at some point the range optimizer
temporary puts the PARAM structure on the stack. Its size if about 8K and
the stack is exhausted very fast.

Now the subselect_single_select_engine::exec function allows subquery result
caching when the UNCACHEABLE_EXPLAIN flag is set.
Now the SQL_SELECT::test_quick_select function calls the check_stack_overrun
function for stack checking purposes to prevent server crash.
2007-11-19 20:00:25 +00:00
gshchepa/uchum@gleb.loc
fedeec6c8a Fixed bug #32282: TEXT silently truncates when value is exactly 65536
bytes length.

The server has been modified to report warnings on truncation to
65536 bytes as usual.
2007-11-19 21:34:21 +04:00
kaa@polly.(none)
ee1bb66368 Merge polly.(none):/home/kaa/src/opt/bug32376/my50-bug26215
into  polly.(none):/home/kaa/src/opt/mysql-5.0-opt
2007-11-19 16:14:05 +03:00
kaa@polly.(none)
b93bbc5ea6 Changed the help text for --comments to make it clear which option
disables the option explicitely.
Changed the option location in code so that --help will show it in
lexical option order.

This is for bug #26215: mysql command line client should not strip
comments from SQL statements
2007-11-19 15:27:44 +03:00
gshchepa/uchum@gleb.loc
6f7755f058 Merge gleb.loc:/work/bk/5.0-opt-32335
into  gleb.loc:/work/bk/5.0-opt
2007-11-18 00:08:41 +04:00
gshchepa/uchum@gleb.loc
f93b5a9c41 Fixed bug #32335.
Comparison of a BIGINT NOT NULL column with a constant arithmetic
expression that evaluates to NULL caused error 1048: "Column '...'
cannot be null".

Made convert_constant_item() check if the constant expression is NULL
before attempting to store it in a field. Attempts to store NULL in a
NOT NULL field caused query errors.
2007-11-18 00:02:55 +04:00
holyfoot/hf@hfmain.(none)
796d2dab6e Merge mysql.com:/home/hf/work/31158/my41-31158
into  mysql.com:/home/hf/work/31158/my50-31158
2007-11-17 20:27:13 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
df5b0297fd Merge bk@192.168.21.1:mysql-4.1-opt
into  mysql.com:/home/hf/work/31158/my41-31158
2007-11-17 20:24:22 +04:00
holyfoot/hf@hfmain.(none)
80e39eb44e Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/31158/my50-31158
2007-11-17 20:23:15 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
67ce52fd66 merging 2007-11-17 17:11:05 +04:00
holyfoot/hf@hfmain.(none)
7588fa52b6 Merge mysql.com:/home/hf/work/31158/my41-31158
into  mysql.com:/home/hf/work/31158/my50-31158
2007-11-17 16:48:57 +04:00
kaa@polly.(none)
7b38492a4c Merge polly.(none):/home/kaa/src/opt/bug32241/my50-bug29131
into  polly.(none):/home/kaa/src/opt/mysql-5.0-opt
2007-11-16 14:24:06 +03:00
kaa@polly.(none)
82125f281f Fix for bug #32241: memory corruption due to large index map in 'Range
checked for each record'

The problem was in incorrectly calculated length of the buffer used to
store a hexadecimal representation of an index map in
select_describe(). This could result in buffer overrun and stack
corruption under some circumstances.

Fixed by correcting the calculation.
2007-11-16 13:58:09 +03:00
gluh@eagle.(none)
b12f4cbb73 Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
2007-11-16 14:53:54 +04:00
gluh@mysql.com/eagle.(none)
f4c2eff997 Bug#30294 blackhole engine causes 100% with 2 alter table statements running
Implement neccessary shared lock structure for table locks.
This is the backport of bug26241 fix.
2007-11-16 14:46:36 +04:00
gkodinov/kgeorge@magare.gmz
85fab707c5 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B31928-5.0-opt
2007-11-15 17:30:08 +02:00
gluh@mysql.com/eagle.(none)
b56f668ca3 after merge fix 2007-11-14 18:56:14 +04:00
gluh@eagle.(none)
294c872fa5 Merge mysql.com:/home/gluh/MySQL/Merge/4.1-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
2007-11-14 17:26:59 +04:00
gluh@eagle.(none)
246c6c35a9 Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
2007-11-14 17:26:22 +04:00
gluh@mysql.com/eagle.(none)
ea3bfdb26d Merge mysql.com:/home/gluh/MySQL/Merge/4.1
into  mysql.com:/home/gluh/MySQL/Merge/4.1-opt
2007-11-14 17:22:03 +04:00
holyfoot/hf@hfmain.(none)
fbac43bbba Merge mysql.com:/home/hf/work/31305/my41-31305
into  mysql.com:/home/hf/work/31305/my50-31305
2007-11-13 23:15:03 +04:00
holyfoot/hf@hfmain.(none)
acd198d5fa Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/31305/my50-31305
2007-11-13 23:13:59 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
0c15068ff8 Merge bk@192.168.21.1:mysql-4.1-opt
into  mysql.com:/home/hf/work/31305/my41-31305
2007-11-13 23:12:55 +04:00
gkodinov/kgeorge@magare.gmz
eea70871f1 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B31562-5.0-opt
2007-11-13 19:00:45 +02:00
gkodinov/kgeorge@magare.gmz
3384d3e96c Bug #31562: HAVING and lower case
The columns in HAVING can reference the GROUP BY and 
SELECT columns. There can be "table" prefixes when
referencing these columns. And these "table" prefixes
in HAVING use the table alias if available.
This means that table aliases are subject to the same
storage rules as table names and are dependent on 
lower_case_table_names in the same way as the table 
names are.
Fixed by :
1. Treating table aliases as table names
and make them lowercase when printing out the SQL
statement for view persistence.
2. Using case insensitive comparison for table 
aliases when requested by lower_case_table_names
2007-11-13 11:39:52 +02:00
holyfoot/hf@mysql.com/hfmain.(none)
7d111abf0e Bug #31158 Spatial, Union, LONGBLOB vs BLOB bug (crops data)
max_length parameter for BLOB-returning functions must be big enough
for any possible content. Otherwise the field created for a table
will be too small.
2007-11-13 10:51:47 +04:00
mattiasj@mattiasj-laptop.(none)
7491e15f21 Merge mattiasj@bk-internal.mysql.com:/home/bk/mysql-5.0-engines
into  mattiasj-laptop.(none):/home/mattiasj/clones/mysql-5.0-engines_with_main
2007-11-12 22:47:48 +01:00
mattiasj@mattiasj-laptop.(none)
f4c100135b Merge mattiasj-laptop.(none):/home/mattiasj/clones/mysql-5.0-main
into  mattiasj-laptop.(none):/home/mattiasj/clones/mysql-5.0-engines_with_main
2007-11-12 21:42:27 +01:00
svoj@june.mysql.com
9799d6c479 Merge mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-5.0-engines
2007-11-12 21:54:04 +04:00
svoj@mysql.com/june.mysql.com
ed8f506d29 symlink.test, symlink.result:
Use proper variable for test.
2007-11-12 21:52:30 +04:00
svoj@june.mysql.com
5e44309422 Merge mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-5.0-engines
2007-11-12 15:16:00 +04:00
svoj@mysql.com/june.mysql.com
40a78cd390 After merge fix. 2007-11-12 15:15:16 +04:00
svoj@mysql.com/june.mysql.com
a6def1f4ab Merge mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-4.0
into  mysql.com:/home/svoj/devel/mysql/BUG32111/mysql-4.1-engines
2007-11-12 15:02:42 +04:00
kaa@polly.(none)
bf2a90f14b Merge polly.(none):/home/kaa/src/opt/bug30666/my50-bug29131
into  polly.(none):/home/kaa/src/opt/mysql-5.0-opt
2007-11-12 12:29:20 +03:00
holyfoot/hf@hfmain.(none)
83a2781894 Merge mysql.com:/home/hf/work/31305/my41-31305
into  mysql.com:/home/hf/work/31305/my50-31305
2007-11-12 13:06:27 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
91e2f91897 Bug #31305 myisam tables crash when they are near capacity.
When we insert a record into MYISAM table which is almost 'full',
we first write record data in the free space inside a file, and then
check if we have enough space after the end of the file.
So if we don't have the space, table will left corrupted.
Similar error also happens when we updata MYISAM tables.

Fixed by modifying write_dynamic_record and update_dynamic_record functions
to check for free space before writing parts of a record
2007-11-12 13:00:22 +04:00
tnurnberg@white.intern.koehntopp.de
3847b1b2eb Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/misc/mysql/31700/50-31700
2007-11-10 21:53:54 +01:00
gshchepa/uchum@gleb.loc
8b21045f9b Merge gshchepa@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-11-11 00:01:24 +04:00
gshchepa/uchum@gleb.loc
e5394523d3 Merge gleb.loc:/home/uchum/work/bk/5.0-opt-28076
into  gleb.loc:/home/uchum/work/bk/5.0-opt
2007-11-10 23:58:22 +04:00
kaa@polly.(none)
b745305b20 Merge polly.(none):/home/kaa/src/opt/bug32202/my50-bug26215
into  polly.(none):/home/kaa/src/opt/mysql-5.0-opt
2007-11-10 22:46:25 +03:00
gshchepa/uchum@gleb.loc
0aabb89ee1 Fixed bug #28076: inconsistent binary/varbinary comparison.
After adding an index the <VARBINARY> IN (SELECT <BINARY> ...)
clause returned a wrong result: the VARBINARY value was illegally padded
with zero bytes to the length of the BINARY column for the index search.
(<VARBINARY>, ...) IN (SELECT <BINARY>, ... ) clauses are affected too.
2007-11-10 23:44:48 +04:00