Commit graph

324 commits

Author SHA1 Message Date
igor@rurik.mysql.com
692da27388 Post merge fix 2006-04-20 00:42:12 -07:00
gluh@eagle.intranet.mysql.r18.ru
4ef7e5b5f7 Fix for bug#18281 group_concat changes charset to binary
skip charset aggregation for order columns
2006-04-07 13:19:31 +05:00
evgen@sunlight.local
7e4535e285 item_sum.cc, sql_select.cc:
After merge fix for bug#15560
item_sum.h:
   After merge fix for bug#15560
2006-03-30 19:04:21 +04:00
evgen@sunlight.local
eb075f2255 Manual merge 2006-03-30 17:14:55 +04:00
evgen@moonbone.local
1c13e54890 Fixed bug#15560: GROUP_CONCAT wasn't ready for WITH ROLLUP queries
The GROUP_CONCAT uses its own temporary table. When ROLLUP is present
it creates the second copy of Item_func_group_concat. This copy receives the
same list of arguments that original group_concat does. When the copy is
set up the result_fields of functions from the argument list are reset to the
temporary table of this copy.
As a result of this action data from functions flow directly to the ROLLUP copy
and the original group_concat functions shows wrong result.
Since queries with COUNT(DISTINCT ...) use temporary tables to store
the results the COUNT function they are also affected by this bug.

The idea of the fix is to copy content of the result_field for the function
under GROUP_CONCAT/COUNT from  the first temporary table to the second one,
rather than setting result_field to point to the second temporary table.
To achieve this goal force_copy_fields flag is added to Item_func_group_concat
and Item_sum_count_distinct classes. This flag is initialized to 0 and set to 1
into the make_unique() member function of both classes.
To the TMP_TABLE_PARAM structure is modified to include the similar flag as
well.
The create_tmp_table() function passes that flag to create_tmp_field().
When the flag is set the create_tmp_field() function will set result_field
as a source field and will not reset that result field to newly created 
field for Item_func_result_field and its descendants. Due to this there
will be created copy func to copy data from old result_field to newly 
created field.
2006-03-29 23:30:34 +04:00
holyfoot@deer.(none)
a920d0df86 bug #15745 (COUNT(DISTINCT CONCAT(x,y)) returns wrong result 2006-03-05 20:48:31 +04:00
igor@rurik.mysql.com
09e6597015 Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-2
2005-12-02 20:42:36 -08:00
ramil@mysql.com
516fd4254e Addition to fix for bug #12956: cast make differ rounding.
- use rint() in some other val_int() methods as well.
2005-11-30 11:17:25 +04:00
igor@rurik.mysql.com
7b1b69a6e7 Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-2
2005-11-22 23:00:57 -08:00
bell@sanja.is.com.ua
806f9e24ff Inefficient usage of String::append() fixed.
Bad examples of usage of a string with its length fixed.
The incorrect length in the trigger file configuration descriptor
  fixed (BUG#14090).
A hook for unknown keys added to the parser to support old .TRG files.
2005-11-20 20:47:07 +02:00
igor@rurik.mysql.com
8e8a2d79cc Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-2
2005-11-04 17:54:47 -08:00
evgen@moonbone.local
2343ff86ca Fix bug #14466 lost sort order in GROUP_CONCAT() in a view
Item_func_group_concat::print() wasn't printing sort order thus creating wrong
view. This results in reported error.
2005-11-01 17:27:10 +03:00
igor@rurik.mysql.com
c136e9c43b Fixed bug #12762:
allowed set functions aggregated in outer subqueries, allowed nested set functions.
2005-10-15 14:32:37 -07:00
jani@a193-229-222-105.elisa-laajakaista.fi
43b544a968 Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.0
into  a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.0-icc
2005-09-30 12:36:23 +03:00
jani@a193-229-222-105.elisa-laajakaista.fi
8d3036c35e Some minor fixes revealed as warnings by
Intel compiler.
2005-09-23 21:28:56 +03:00
msvensson@neptunus.(none)
02c7645cc1 Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0
2005-09-23 09:18:56 +02:00
timour@mysql.com
633d118d01 Fix for BUG#12882 - min/max inconsistent on empty table.
The problem was in that the MIN/MAX optimization in opt_sum_query was
replacing MIN/MAX functions with their constant argument without
taking into account that a query has no result rows.
2005-09-21 09:49:19 +03:00
monty@mishka.mysql.fi
f348f62cc3 Added option --valgrind-mysqltest to mysql-test-run
Added flag to Field::store(longlong) to specify if value is unsigned.
This fixes bug #12750: Incorrect storage of 9999999999999999999 in DECIMAL(19, 0)
Fixed warning from valgrind in CREATE ... SELECT
Fixed double free of mysql.options if reconnect failed
2005-09-14 01:41:44 +03:00
sergefp@mysql.com
3d6759d190 Merge 4.1->5.0 2005-09-09 10:54:59 +04:00
igor@rurik.mysql.com
1e6736b543 Merge rurik.mysql.com:/home/igor/mysql-4.1
into rurik.mysql.com:/home/igor/dev/mysql-4.1-0
2005-09-07 16:33:12 -07:00
bar@mysql.com
cd5cd2bf79 Merge mysql.com:/usr/home/bar/mysql-4.1.b12829
into  mysql.com:/usr/home/bar/mysql-5.0
2005-09-07 14:57:27 +05:00
bar@mysql.com
2ff61bd697 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/bar/mysql-4.1.b12829
2005-09-07 13:12:29 +05:00
igor@rurik.mysql.com
af9740d0fd func_gconcat.result, func_gconcat.test:
Added test cases for bug #12863.
item_sum.cc, item_sum.h:
  Fixed bug #12863.
  Added a flag to Item_func_group_concat set to FALSE after
  concatenation of the first element of a group.
2005-09-06 22:20:11 -07:00
jimw@mysql.com
1d997477aa Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-08-31 15:24:06 -07:00
evgen@moonbone.local
f1fb30a15f Fix bug #12861 client hang with group_concat insubquery FROM DUAL.
Item_func_group_concat::fix_fields() set maybe_null flag to 0, and set it to
1 only if some of it's arguments may be null. When used in subquery in tmp 
table created field which can't be null. When no data retireved result field
have to be set to null and error mentioned in bug report occurs. Also this 
bug can occur if selecting from not null field in empty table.

Function group_concat now marked maybe_null from the very beginning not only
if some of it's argument may be null.
2005-08-31 18:26:50 +04:00
bar@mysql.com
98581508c3 Bug #12829
Cannot convert the charset of a GROUP_CONCAT result:

item_sum.cc:
  "result" character set was not set into proper value.

func_gconcat.result, func_gconcat.test:
  Fixing tests accordingly.
2005-08-30 15:36:47 +05:00
monty@mysql.com
4c0d23e156 Fixes during review of new pushed code
Removed duplicate usage of TMP_TABLE_FORCE_MYISAM by making 'options' longlong
2005-08-12 13:54:42 +03:00
sergefp@mysql.com
65566e449d Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/psergey/mysql-5.0-bug11869-part3
2005-08-07 21:32:26 +00:00
sergefp@mysql.com
d9ce6e8f25 BUG#11869:part 2: post-review fixes: merging into 5.0
We're out of bits in st_select_lex->options so make TMP_TABLE_FORCE_MYISAM ==
OPTION_FOUND_COMMENT (the latter is not used by create_tmp_table).
2005-08-07 21:21:30 +00:00
evgen@moonbone.local
1894cff045 Manual merge of #11335 bugfix 2005-08-05 00:34:42 +04:00
igor@rurik.mysql.com
7322441dc7 Manual merge 2005-08-02 13:17:49 -07:00
igor@rurik.mysql.com
5e851429de item_sum.cc:
Reversed the changes to fix bug #12095 after review
  done by SergeyG. Applied a fix suggested by him.
  Added my comment.
2005-08-02 13:12:41 -07:00
igor@rurik.mysql.com
f4c1b3bae4 Merge 2005-07-31 02:44:18 -07:00
igor@rurik.mysql.com
fea0fb2c8b 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.
2005-07-31 02:32:33 -07:00
evgen@moonbone.local
fa0ea36507 Fix bug #11335 View redefines TinyInt(1) column definition
Item_type_holder doesn't store information about length and exact type of
original item which results in redefining length to max_length and geometry 
type to longtext.

Changed the way derived tables except unions are built. Now they are created
from original field list instead of list of Item_type_holder.
2005-07-30 05:53:35 +04:00
bar@mysql.com
0255803b4e Merge mysql.com:/usr/home/bar/mysql-4.1.b10201
into  mysql.com:/usr/home/bar/mysql-5.0
2005-07-26 13:25:18 +05:00
bar@mysql.com
0c2035b7bd func_gconcat.result, func_gconcat.test:
Adding test
item_sum.cc:
  Adding a call for collation/charset aggregation,
      to collect attributes from the arguments. The actual bug fix.
item_func.h, item_func.cc, item.h, item.cc:
  - Removing collation aggrgation functions from Item_func class
      in item.cc, and adding it as non-class functions in item.cc
      to be able to reuse this code for group_concat.
      - Adding replacement for these functions into Item_func class
      as wrappers for moved functions, to minizize patch size,
2005-07-26 12:52:02 +05:00
bell@sanja.is.com.ua
d3905f3d0e Name resolution context added (BUG#6443) 2005-07-01 07:05:42 +03:00
bell@sanja.is.com.ua
a11677026f fixed printing of sum(distinct ) & avg(distinct ) & cast(... as decimal) (BUG#7015, BUG#11387) 2005-06-17 17:27:47 +03:00
monty@mysql.com
068bd3eb97 After merge fixes 2005-06-07 05:43:59 +03:00
monty@mysql.com
775f17667b Merge with 4.1 2005-06-07 00:31:53 +03: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
4b7882dc73 merge 2005-06-05 17:19:50 +03: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
kent@mysql.com
f0fcc54b0c Merge 2005-06-02 04:45:09 +02: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
monty@mysql.com
a69f432115 Code cleanups during code reviews
Ensure we get error if INSERT IGNORE ... SELECT fails
Fixed wrong key_part->key_length usage in index_merge
2005-06-01 16:35:09 +03:00
ramil@mysql.com
cc0061a122 a fix (bug #7405: group_concat with distinct and rollup => ignores distinct in some rows). 2005-05-31 10:54:33 +05:00
msvensson@neptunus.(none)
697cfe7f07 Merge from 4.1 2005-05-26 21:01:55 +02: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