Commit graph

1901 commits

Author SHA1 Message Date
holyfoot/hf@hfmain.(none)
bcc5499bab Merge mysql.com:/home/hf/work/mrg/mysql-5.0-opt
into  mysql.com:/home/hf/work/mrg/mysql-5.1-opt
2007-03-09 13:50:06 +04:00
evgen@moonbone.local
35e5925673 sql_select.cc:
Postfix for bug#22331.
2007-03-08 19:38:21 +03:00
holyfoot/hf@hfmain.(none)
75be7cd1ae Merge mysql.com:/home/hf/work/mrg/mysql-5.0-opt
into  mysql.com:/home/hf/work/mrg/mysql-5.1-opt
2007-03-08 19:08:28 +04: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
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
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
evgen@moonbone.local
6552d3064d Bug#25376: Incomplete setup of ORDER BY clause results in a wrong result.
Functions over sum functions wasn't set up correctly for the ORDER BY clause
which leads to a wrong order of the result set.

The split_sum_func() function is called now for each ORDER BY item that
contains a sum function to set it up correctly.
2007-03-06 23:58:10 +03:00
evgen@moonbone.local
f482379296 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  moonbone.local:/mnt/gentoo64/work/clean-5.0-opt-mysql
2007-03-05 23:33:57 +03:00
igor@olga.mysql.com
08efa4e0ea Fixed bug #26560.
The flag alias_name_used was not set on for the outer references
in subqueries. It resulted in replacement of any outer reference
resolved against an alias for a full field name when the frm 
representation of a view with a subquery was generated. 
If the subquery and the outer query referenced the same table in
their from lists this replacement effectively changed the meaning
of the view and led to wrong results for selects from this view. 

Modified several functions to ensure setting the right value of
the alias_name_used flag for outer references resolved against
aliases.
2007-03-04 19:54:35 -08:00
evgen@sunlight.local
629c12316d Bug#25126: Wrongly resolved field leads to a crash.
When the ORDER BY clause gets fixed it's allowed to search in the current
item_list in order to find aliased fields and expressions. This is ok for a
SELECT but wrong for an UPDATE statement. If the ORDER BY clause will
contain a non-existing field which is mentioned in the UPDATE set list
then the server will crash due to using of non-existing (0x0) field.

When an Item_field is getting fixed it's allowed to search item list for
aliased expressions and fields only for selects.
2007-03-04 00:47:42 +03:00
gluh@eagle.(none)
1967d342e4 Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-02-27 12:39:05 +04:00
gluh@mysql.com/eagle.(none)
b3cb846680 removed unused variable 2007-02-27 12:37:17 +04:00
gluh@eagle.(none)
1d49f79c53 Merge mysql.com:/home/gluh/MySQL/Merge/5.1
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-02-26 17:46:52 +04:00
gluh@mysql.com/eagle.(none)
e8635ad3cb Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
2007-02-26 16:57:45 +04:00
gluh@eagle.(none)
975a23ed0f Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-02-26 15:54:43 +04:00
monty@mysql.com/narttu.mysql.fi
f0ae3ce9b9 Fixed compiler warnings
Fixed compile-pentium64 scripts
Fixed wrong estimate of update_with_key_prefix in sql-bench
Merge bk-internal.mysql.com:/home/bk/mysql-5.1 into mysql.com:/home/my/mysql-5.1
Fixed unsafe define of uint4korr()
Fixed that --extern works with mysql-test-run.pl
Small trivial cleanups
This also fixes a bug in counting number of rows that are updated when we have many simultanous queries
Move all connection handling and command exectuion main loop from sql_parse.cc to sql_connection.cc
Split handle_one_connection() into reusable sub functions.
Split create_new_thread() into reusable sub functions.
Added thread_scheduler; Preliminary interface code for future thread_handling code.

Use 'my_thread_id' for internal thread id's
Make thr_alarm_kill() to depend on thread_id instead of thread
Make thr_abort_locks_for_thread() depend on thread_id instead of thread
In store_globals(), set my_thread_var->id to be thd->thread_id.
Use my_thread_var->id as basis for my_thread_name()
The above changes makes the connection we have between THD and threads more soft.

Added a lot of DBUG_PRINT() and DBUG_ASSERT() functions
Fixed compiler warnings
Fixed core dumps when running with --debug
Removed setting of signal masks (was never used)
Made event code call pthread_exit() (portability fix)
Fixed that event code doesn't call DBUG_xxx functions before my_thread_init() is called.
Made handling of thread_id and thd->variables.pseudo_thread_id uniform.
Removed one common 'not freed memory' warning from mysqltest
Fixed a couple of usage of not initialized warnings (unlikely cases)
Suppress compiler warnings from bdb and (for the moment) warnings from ndb
2007-02-23 13:13:55 +02:00
monty@mysql.com/narttu.mysql.fi
e5cc397f33 Fixed compiler warnings (for linux and win32 and win64)
Fixed a couple of usage of not initialized warnings (unlikely cases)
2007-02-22 16:59:57 +02:00
evgen@moonbone.local
76461a4442 Merge moonbone.local:/mnt/gentoo64/work/bk-trees/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/23800-bug1-5.0-opt-mysql
2007-02-21 23:18:17 +03:00
evgen@moonbone.local
9a233742b8 Bug#23800: Outer fields in correlated subqueries is used in a temporary table
created for sorting.

Any outer reference in a subquery was represented by an Item_field object.
If the outer select employs a temporary table all such fields should be
replaced with fields from that temporary table in order to point to the 
actual data. This replacement wasn't done and that resulted in a wrong
subquery evaluation and a wrong result of the whole query.

Now any outer field is represented by two objects - Item_field placed in the
outer select and Item_outer_ref in the subquery. Item_field object is
processed as a normal field and the reference to it is saved in the
ref_pointer_array. Thus the Item_outer_ref is always references the correct
field. The original field is substituted for a reference in the
Item_field::fix_outer_field() function.

New function called fix_inner_refs() is added to fix fields referenced from
inner selects and to fix references (Item_ref objects) to these fields.

The new Item_outer_ref class is a descendant of the Item_direct_ref class.
It additionally stores a reference to the original field and designed to
behave more like a field.
2007-02-21 23:00:32 +03:00
monty@mysql.com/narttu.mysql.fi
26aa385bc5 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2007-02-21 14:07:08 +02:00
igor@olga.mysql.com
f5888a8d10 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  olga.mysql.com:/home/igor/mysql-5.0-opt
2007-02-16 09:39:08 -08:00
evgen@moonbone.local
31d63b7971 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/16630-bug-5.0-opt-mysql
2007-02-16 19:44:54 +03:00
evgen@moonbone.local
7916d9e965 Bug#16630: The update fields of the INSERT .. SELECT .. ON DUPLICATE KEY
UPDATE contains wrong data if the SELECT employs a temporary table.

If the UPDATE values of the INSERT .. SELECT .. ON DUPLICATE KEY UPDATE
statement contains fields from the SELECT part and the select employs a
temporary table then those fields will contain wrong values because they
aren't corrected to get data from the temporary table.

The solution is to add these fields to the selects all_fields list,
to store pointers to those fields in the selects ref_pointer_array and
to access them via Item_ref objects.

The substitution for Item_ref objects is done in the new function called 
Item_field::update_value_transformer(). It is called through the
item->transform() mechanism at the end of the select_insert::prepare()
function.
2007-02-16 19:39:28 +03:00
igor@olga.mysql.com
a2d4a042d0 Fixed bug #25971: indexes on text columns were ignored when ref accesses
were evaluated.
According to the new rules for string comparison partial indexes on text
columns can be used in the same cases when partial indexes on varchar
columns can be used.
2007-02-14 22:06:41 -08:00
igor@olga.mysql.com
452c134d3f Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.1-opt
into  olga.mysql.com:/home/igor/mysql-5.1-opt
2007-02-13 16:08:01 -08:00
ibabaev@bk-internal.mysql.com
266300142e Merge bk-internal.mysql.com:/data0/bk/mysql-5.0
into  bk-internal.mysql.com:/data0/bk/mysql-5.0-opt
2007-02-13 23:35:06 +01:00
igor@olga.mysql.com
a196ccafe6 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/mysql-5.1-opt
2007-02-13 13:31:23 -08:00
cmiller@zippy.cornsilk.net
11e8f48734 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-4.1-maint
2007-02-13 10:54:04 -05:00
igor@olga.mysql.com
fb9e0ad3be Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/mysql-5.1-opt
2007-02-13 01:34:36 -08:00
igor@olga.mysql.com
0461228a70 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug26209
2007-02-12 23:10:33 -08:00
gluh@mysql.com/eagle.(none)
47e537b47c Bug#24630 Subselect query crashes mysqld
The crash happens because second filling of the same I_S table happens in
case of subselect with order by. table->sort.io_cache previously allocated
in create_sort_index() is deleted during second filling
(function get_schema_tables_result). There are two places where
I_S table can be filled: JOIN::exec and create_sort_index().
To fix the bug we should check if the table was already filled
in one of these places and skip processing of the table in second.
2007-02-12 16:06:14 +04:00
igor@olga.mysql.com
4b1a1d9eb7 Fixed bug #26209.
The function make_unireg_sortorder ignored the fact that any
view field is represented by a 'ref' object.
This could lead to wrong results for the queries containing
both GROUP BY and ORDER BY clauses.
2007-02-11 19:36:46 -08:00
tsmith@siva.hindu.god
498756195a Merge siva.hindu.god:/home/tsmith/m/bk/51
into  siva.hindu.god:/home/tsmith/m/bk/maint/51
2007-02-08 16:02:58 -07:00
msvensson@neptunus.(none)
e4001b3b5a Merge neptunus.(none):/home/msvensson/mysql/mysql-5.1
into  neptunus.(none):/home/msvensson/mysql/mysql-5.1-maint
2007-02-06 15:46:17 +01:00
msvensson@neptunus.(none)
ede3afe470 Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2007-02-06 14:45:08 +01:00
knielsen@ymer.(none)
cb9e8bcad8 Fix false Valgrind warning.
On some compiler/platform combination, an assignment of form *p= *p
would map to a memcpy() call, and Valgrind flags this as an overlapped
memcpy() error.

Fix by prefixing *p= *q with if(p!=q) when building for Valgrind
(HAVE_purify).
2007-02-05 10:50:08 +01:00
jani@a88-113-38-195.elisa-laajakaista.fi
cd75806b61 Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.1
into  a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-5.1
2007-02-03 00:58:09 +02:00
gluh@eagle.(none)
7849d31923 Merge mysql.com:/home/gluh/MySQL/Merge/5.0-opt
into  mysql.com:/home/gluh/MySQL/Merge/5.1-opt
2007-02-02 10:25:45 +04:00
gkodinov/kgeorge@rakia.gmz
0d40608fff Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  rakia.gmz:/home/kgeorge/mysql/autopush/B25551-5.0-opt
2007-02-01 10:50:41 +02:00
cmiller@zippy.cornsilk.net
522d6fb0cc Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.1-maint
2007-01-31 16:24:28 -05:00
cmiller@zippy.cornsilk.net
ad66e7a0dd Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-5.0-maint
2007-01-31 16:23:05 -05:00
ramil/ram@ramil.myoffice.izhnet.ru
30f904eb2d Merge mysql.com:/home/ram/work/b19690/b19690.5.0
into  mysql.com:/home/ram/work/b19690/b19690.5.1
2007-01-31 12:53:36 +04:00
gkodinov/kgeorge@macbook.gmz
2ba683f2ee Bug #25551: inconsistent behaviour in grouping NULL, depending on index type
The optimizer takes away columns from GROUP BY/DISTINCT if they constitute
 all the parts of an unique index.
 However if some of the columns can contain NULLs this cannot be done 
(because an UNIQUE index can have multiple rows with NULL values).
 Fixed by not using UNIQUE indexes with nullable columns to remove
 grouping columns from GROUP BY/DISTINCT.
2007-01-31 10:18:26 +02:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
f0f83a36bc Merge mysql.com:/home/ram/work/b19690/b19690.4.1
into  mysql.com:/home/ram/work/b19690/b19690.5.0
2007-01-31 10:07:56 +04:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
eb415e4920 fix for bug #19690: ORDER BY eliminates rows from the result
Depending on the queries we use different data processing methods
and can lose some data in case of double (and decimal in 4.1) fields.

The fix consists of two parts:
1. double comparison changed, now double a is equal to double b 
if (a-b) is less than 5*0.1^(1 + max(a->decimals, b->decimals)). 
For example, if a->decimals==1, b->decimals==2, a==b if (a-b)<0.005
2. if we use a temporary table, store double values there as is 
to avoid any data conversion (rounding).
2007-01-31 09:51:05 +04:00
igor@olga.mysql.com
3eff8907e2 Merge olga.mysql.com:/home/igor/dev-opt/mysql-4.1-opt-bug24987
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug24987
2007-01-30 13:14:52 -08:00
igor@olga.mysql.com
60ac1f1b78 Fixed bug #24987.
Made the function opt_sum_query to return HA_ERR_KEY_NOT_FOUND when
no matches were found (instead of -1 it returned prior this patch).
This changes allow us to avoid possible conflicts with return values
from user-defined handler methods which also may return -1. 
No particular test cases are provided with this fix.
2007-01-30 13:06:36 -08:00