Commit graph

934 commits

Author SHA1 Message Date
igor@rurik.mysql.com
a5f2c7528c func_gconcat.result, func_gconcat.test:
Added a test case for bug #12095.
sql_class.h:
  Fixed bug #12095: a join query with GROUP_CONCAT over a single row table.
  Added a flag to the TMP_TABLE_PARAM class forcing to put constant
  items generated after elimination of a single row table into temp table
  in some cases (e.g. when GROUP_CONCAT is calculated over a single row
  table).
  bk ci sql/item_sum.cc
  Fixed bug #12095: a join query with GROUP_CONCAT over a single row table.
  If GROUP_CONCAT is calculated we always put its argument into a temp
  table, even when the argument is a constant item.
sql_select.cc:
  Fixed bug #12095: a join query with GROUP_CONCAT over one row table.
  If temp table is used to calculate GROUP_CONCAT the argument should
  be always put into this table, even when it is a constant item.
2005-07-28 19:11:29 -07:00
igor@rurik.mysql.com
f31625e613 Manual merge 2005-07-28 13:39:06 -07:00
igor@rurik.mysql.com
bcbde8af22 sql_select.cc:
Fixed bug #12144.
  Added an optimization that avoids key access with null keys for the 'ref'
  method when used in outer joins. The regilar optimization with adding
  IS NOT NULL expressions is not applied for outer join on expressions as
  the predicates of these expressions are not pushed down in 4.1.
null_key.result, null_key.test:
  Added a test case for bug #12144.
2005-07-28 13:31:15 -07:00
monty@mysql.com
d28f576cf4 We have also to test 'conds' even if there was no tables.
(This is because conds may not be a constant)
This bug caused a failure in the test suite for select.test becasue for prepared statements in one case a 'constant sub query' was not regarded as a constant
Sanja will as a separate task check if we can fix that the sub query can be recognized as a constant
Bug #12217
2005-07-27 22:58:55 +03:00
monty@mishka.local
7e83d09ce7 Simple fixes during review of new code 2005-07-19 19:25:05 +03:00
igor@rurik.mysql.com
54dd7e5ebf select.result, select.test:
Added a test case for bug #11745.
sql_select.cc:
  Fixed bug # 11745.
  Added support of where clause for queries with FROM DUAL.
sql_yacc.yy:
  Fixed bug # 11745.
  Added optional where clause for queries with FROM DUAL.
2005-07-17 09:46:14 -07:00
igor@rurik.mysql.com
553f2a59f3 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1
into rurik.mysql.com:/home/igor/mysql-4.1
2005-07-16 18:28:09 -07:00
evgen@moonbone.local
81d93df1ae Fix bug#11868 NOT NULL ref optimization in subquery used in update must be
disabled if ref is built with a key from the updated table

Problem was in add_not_null_conds() optimization function.
It contains following code:
JOIN_TAB *referred_tab= not_null_item->field->table->reginfo.join_tab;
...
add_cond_and_fix(&referred_tab->select_cond, notnull);
For UPDATE described in bug report referred_tab is 0 and dereferencing it
crashes the server.
2005-07-16 05:31:16 +04:00
evgen@moonbone.local
0298bc347a Fix bug#11482 4.1.12 produces different resultset for a complex query
than in previous 4.1.x

Wrongly applied optimization were adding NOT NULL constraint which results in
rejecting valid rows and reduced result set.

The problem was that add_notnull_conds() while checking subquery were adding
NOT NULL constraint to left joined table, to which, normally, optimization 
don't have to be applied.
2005-07-16 03:29:12 +04:00
sergefp@mysql.com
e1273aec6d Fix for BUG#11700: in add_not_null_conds(), call full fix_fields() for the created NOT NULL.
This is needed because in some cases range optimization is performed twice and added 
  NOT NULL item must have correct const_table_map() value.
2005-07-14 15:13:36 +00:00
igor@igor-inspiron.creware.com
3c98b0132e Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1
into igor-inspiron.creware.com:/home/igor/mysql-4.1
2005-07-08 06:37:09 -07:00
monty@mysql.com
2735d7dcf6 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/my/mysql-4.1
2005-07-02 16:13:35 +03:00
bell@sanja.is.com.ua
b6dc32a755 fixed create_distinct_group() to make references via ref_pointer_array 2005-07-01 20:13:07 +03:00
igor@rurik.mysql.com
343e8effa9 olap.result, olap.test:
Added a test case for bug #11543.
sql_select.cc:
  Fixed bug #11543.
  A ROLLUP query could return a wrong result set when
  its GROUP BY clause contained references to the same
  column.
2005-07-01 07:40:22 -07:00
monty@mysql.com
e3a4c1a6b2 Optimization during review
Add extra check to delete [] to ensure we are not deleting not allocated data
2005-07-01 09:40:05 +03:00
igor@rurik.mysql.com
04e6f472dd Merge rurik.mysql.com:/home/igor/mysql-4.1
into rurik.mysql.com:/home/igor/dev/mysql-4.1-0
2005-06-28 03:24:06 -07:00
igor@rurik.mysql.com
42bb0eaf9f Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1
into rurik.mysql.com:/home/igor/mysql-4.1
2005-06-28 03:20:00 -07:00
igor@rurik.mysql.com
be1478f6f9 group_by.result, group_by.test:
Added a test case for bug #11414.
sql_select.cc:
  Fixed bug #11414: crash on Windows with some simple
  GROUP BY queries.
  It happened to an allocation of an array containing
  0 Copy_field elements in setup_copy_fields.
  The bug had been already fixed in 5.0.
2005-06-28 03:18:37 -07:00
igor@rurik.mysql.com
c73c2af614 func_str.result, func_str.test:
Added a test case for bug #10124.
sql_select.h, item_subselect.cc, sql_select.cc:
  Fixed bug #10124.
  The copy method of the store_key classes can return
  STORE_KEY_OK=0, STORE_KEY_FATAL=1, STORE_KEY_CONV=2 now.
field.cc:
  Fixed bug #10124.
  When ussuing a warning the store methods return 2 instead of 1 now.
2005-06-23 06:15:50 -07:00
monty@mishka.local
1524cd001d Cleanup during review of new code
Fixed wrong allocation that could cause buffer overrun when using join cache
2005-06-21 18:18:58 +03:00
igor@igor-inspiron.creware.com
7ea12bd787 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1
into igor-inspiron.creware.com:/home/igor/mysql-4.1
2005-06-20 06:13:30 -07:00
tulin@dl145c.mysql.com
9b3d0b85a3 sql_select.cc:
fixed 64bit bug in lenght store/retrive in cache
2005-06-17 12:36:09 +02:00
igor@rurik.mysql.com
2095758a9d group_by.result, group_by.test:
Added a test case for bug #8614.
sql_select.cc:
  Fixed bug #8614.
  SELECT DISTINCT ... GROUP BY 'const' must be equivalent to
  SELECT ... GROUP BY 'const'.
2005-06-16 09:45:41 -07:00
serg@serg.mylan
0fbd67dac8 for consictency, changed to use memcpy_fixed. 2005-06-16 13:39:54 +02:00
serg@serg.mylan
a1d55ea052 cleanup for bug#11167.
portability alignment issues.
2005-06-15 22:49:52 +02:00
igor@igor-inspiron.creware.com
750fca61f9 ctype_utf8.test, ctype_utf8.result:
Added a test case for bug #11167.
sql_select.cc:
  Fixed bug #11167.
  In 4.1 char/varchar fields are limited by 255 characters in
  length that make them longer than 255 bytes in size for such
  character sets as UTF8. The functions store_record_in_cache
  and read_cached_records did not take into account this
  Moreover the code did not take into account that the size
  of the varchar fields in 5.0 can be up to 65535 bytes
2005-06-13 06:10:19 -07:00
igor@rurik.mysql.com
90dd86907e sql_select.cc, item_buff.cc, item.h:
Fixed bug #11088: a crash for queries with GROUP BY a BLOB column
  + COUNT(DISTINCT...) due to an attempt to allocate a too large
  buffer for the BLOB field.
  Now the size of the buffer is limited by max_sort_length.
group_by.test, group_by.result:
  Added a test case for bug #11088.
2005-06-07 03:05:57 -07:00
serg@serg.mylan
6a5349028c a compiler must see '#pragma implementation' *before*
'#pragma interface' (that comes with the #include'd header file)
2005-06-05 19:38:52 +02:00
monty@mysql.com
29fd1f2fd9 Move USE_PRAGMA_IMPLEMENTATION to proper place
Ensure that 'null_value' is not accessed before val() is called in FIELD() functions
Fixed initialization of key maps. This fixes some problems with keys when you have more than 64 keys
Fixed that ROLLUP don't always create a temporary table. This fix ensures that func_gconcat.test results are now predictable
2005-06-03 23:46:03 +03:00
brian@zim.(none)
efb5ed5bab Merge 2005-06-01 18:48:29 -07:00
kent@mysql.com
bd48eed988 tztime.cc:
Set #pragma implementation" earlier
Many files:
  Need to include <my_global.h> before #ifdef USE_PRAGMA_IMPLEMENTATION
2005-06-02 02:43:32 +02:00
brian@zim.(none)
ba9b9f8993 Mainly cleanups for gcc 4.0. Some small pieces from looking at -Wall. Removed a number of dumb things in ha_tina. 2005-06-01 17:34:10 -07:00
igor@rurik.mysql.com
e8a6fa4278 sql_select.cc:
Post-review modifications for the fix of bug #7894.
2005-05-30 05:25:12 -07:00
igor@rurik.mysql.com
10cc5a46df olap.result, olap.test:
Added test cases for bug #7894.
sql_select.cc:
  Fixed bug #7894: GROUP BY queries with ROLLUP returned
  wrong results for expressions containing group by columns.
  The fix ensured correct results by replacement of all
  occurrences of group by fields in non-aggregate expressions
  for corresponding ref objects and preventing creation of
  fields in temporary tables for expression containing group
  by fields.
2005-05-30 03:01:51 -07:00
msvensson@neptunus.(none)
83d430353e Add ifdefs to control when "#pragma implementation" should be used
Added some more ifdefs for "#pragma interface"
2005-05-26 12:09:14 +02:00
igor@rurik.mysql.com
80aa0062db olap.result, olap.test:
Added test cases for bug #7914.
sql_select.cc:
  Fixed bug #7914: rollup over expresssions such as sum(a)+1.
2005-05-18 05:15:48 -07:00
jimw@mysql.com
ef183de687 Merge mysql.com:/home/jimw/my/mysql-4.1-8497
into mysql.com:/home/jimw/my/mysql-4.1-clean
2005-05-07 01:00:24 -07:00
monty@mysql.com
aa84afb983 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/my/mysql-4.1
2005-04-30 03:45:12 +03:00
evgen@moonbone.local
b11705a2b0 Fix bug #9703 "Error 1032 with GROUP BY query and large tables"
Reset old error if tmp table was successfully created.

Test data is large and can be found in bug report along with test query.
2005-04-29 21:19:39 +04:00
monty@mysql.com
972f86f1ee Cleanups during review 2005-04-26 23:24:59 +03:00
igor@rurik.mysql.com
20250dc497 Merge rurik.mysql.com:/home/igor/mysql-4.1
into rurik.mysql.com:/home/igor/dev/mysql-4.1-0
2005-04-20 15:08:22 -07:00
igor@rurik.mysql.com
25c396628a sql_select.cc:
Fixed bug #9681.
  The bug happened with queries using derived tables specified by
  a SELECT with ROLLUP, such as:
  SELECT * FROM (SELECT a, SUM(a) FROM t1 GROUP BY a WITH ROLLUP) t2,
  if column a of table t1 is declared as NOT NULL.
  This was to the fact that the first column of the temporary table
  created to contain the derived table erroneously inherited the NOT NULL
  attribute from column a.
olap.result, olap.test:
  Added a test case for bug #9681.
2005-04-19 16:54:30 -07:00
sergefp@mysql.com
a76ecc5bc7 Fix for BUG#9103:
Don't produce data truncation warnings from within cp_buffer_from_ref(). This function
is only used to make index search tuples and data truncation that occurs here has no
relation with truncated values being saved into tables.
2005-04-18 05:21:44 +04:00
sergefp@mysql.com
3f6cdec788 Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/psergey/mysql-4.1-bug8877
2005-04-07 17:47:37 +04:00
sergefp@mysql.com
0cd5877b02 Post-review fixes: local variable renamed 2005-04-07 17:44:48 +04:00
sergefp@mysql.com
53e0b5b5db Removed extra comment 2005-04-05 03:34:39 +04:00
sergefp@mysql.com
d0c9b36224 Fix for BUG#8877: Implementation of
"Early NULL-values filtering for ref access" (attempt2+post-review fixes)
1. update_ref_and_keys() accumulates info about null-rejecting
predicates in in KEY_FIELD::null_rejecting, add_key_part saves
these to KEYUSE.
2. create_ref_for_key copies them to TABLE_REF.
3. add_not_null_conds adds "x IS NOT NULL" to join_tab->select_cond of
appropiate JOIN_TAB members.

Includes code cleanups: 
* add_key_field() params: s/COND/Item_func/ (as only Item_funcs are
passed to it)
* add_key_fields() params: JOIN_TAB *stat removed (wasn't used)
2005-04-05 02:42:23 +04:00
jimw@mysql.com
16efc3e333 Merge embedded-server testing changes. 2005-04-01 16:43:35 -08:00
sergefp@mysql.com
7ace3f1362 Better comment 2005-04-01 11:05:17 +04:00
jimw@mysql.com
aa4f352230 Remove result.es files and support for them, which requires splitting
up a couple of tests and adjusting the output of others. Exposes two
bugs (9472 and 9508).
2005-03-30 17:32:44 -08:00