Commit graph

9980 commits

Author SHA1 Message Date
unknown
e8adc3f74b Fix for bug#31615: crash after set names ucs2 collate xxx
Problem: currently, UCS-2 cannot be used as a client character set.

Fix: raise an error if one attempts to set it to USC-2.


mysql-test/r/ctype_ucs.result:
  Fix for bug#31615: crash after set names ucs2 collate xxx
    - test result.
mysql-test/t/ctype_ucs.test:
  Fix for bug#31615: crash after set names ucs2 collate xxx
    - test case.
sql/set_var.cc:
  Fix for bug#31615: crash after set names ucs2 collate xxx
    - raise an error if one is going to set character_set_client to UCS-2.
sql/set_var.h:
  Fix for bug#31615: crash after set names ucs2 collate xxx
    - raise an error if one is going to set character_set_client to UCS-2.
2007-10-17 14:28:00 +05:00
unknown
4d0ef0cc85 Backport of the 5.0 patch to 4.1
Bug#28878: InnoDB tables with UTF8 character set and indexes cause  wrong result for DML
When making key reference buffers over CHAR fields whitespace (0x20) must be used to fill in the remaining space in the field's buffer. This is what Field_string::store() does. Fixed Field_string::get_key_image() to do the same.


mysql-test/r/innodb_mysql.result:
  Bug#28878: test case
mysql-test/t/innodb_mysql.test:
  Bug#28878: test case
sql/field.cc:
  Bug#28878: Fill with space instead of binary zeros.
2007-10-04 14:22:35 +04:00
unknown
732f05a642 BUG#30385: Server crash when deleting with ORDER BY and LIMIT
in get_index_for_order(), don't walk over the end of the index key parts
when matching index description and needed ordering.


mysql-test/r/delete.result:
  BUG#30385: Testcase
mysql-test/t/delete.test:
  BUG#30385: Testcase
2007-09-10 16:26:51 +04:00
unknown
cbbc8bb3c1 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/41
2007-08-01 18:38:43 -06:00
unknown
6b745cf601 Merge mysql.com:/home/hf/work/029717/my41-29717
into  mysql.com:/home/hf/work/29717/my41-29717


sql/sql_select.cc:
  Auto merged
2007-07-31 11:00:19 +05:00
unknown
791584ae0d Bug #29717 INSERT INTO SELECT inserts values even if
SELECT statement itself returns empty.

As a result of this bug 'SELECT AGGREGATE_FUNCTION(fld) ... GROUP BY'
can return one row instead of an empty result set.

When GROUP BY only has fields of constant tables
(with a single row), the optimizer deletes the group_list.
After that we lose the information about whether we had an
GROUP BY statement. Though it's important
as SELECT min(x) from empty_table; and
   SELECT min(x) from empty_table GROUP BY y; have to return
different results - the first query should return one row,
second - an empty result set.
So here we add the 'group_optimized_away' flag to remember this case
when GROUP BY exists in the query and is removed
by the optimizer, and check this flag in end_send_group()


mysql-test/r/group_by.result:
  Bug #29717 INSERT INTO SELECT inserts values even if
   SELECT statement itself returns empty.
  
  test result
mysql-test/r/insert_select.result:
  Bug #29717 INSERT INTO SELECT inserts values even if
   SELECT statement itself returns empty.
  
  test result
mysql-test/t/group_by.test:
  Bug #29717 INSERT INTO SELECT inserts values even if
   SELECT statement itself returns empty.
  
  This is additional testcase that is more basic than the
  original bug's testcase and has the same reason.
mysql-test/t/insert_select.test:
  Bug #29717 INSERT INTO SELECT inserts values even if
   SELECT statement itself returns empty.
  
  test case
sql/sql_select.cc:
  Bug #29717 INSERT INTO SELECT inserts values even if
   SELECT statement itself returns empty.
  
  Remember the 'GROUP BY was optimized away' case in the JOIN::group_optimized
  and check this in the end_send_group()
sql/sql_select.h:
  Bug #29717 INSERT INTO SELECT inserts values even if
   SELECT statement itself returns empty.
  
  JOIN::group_optimized member added to remember the 'GROUP BY optimied away'
  case
2007-07-31 10:46:04 +05:00
unknown
947e42af55 Merge debian.(none):/M41/bug16635-4.1
into  debian.(none):/M41/push-4.1
2007-07-26 15:32:32 +02:00
unknown
00d694a900 Raise the 64 character limit for path names in the error messages
to 150 or 107 characters for those messages which are generated
by the embedded server during release builds.

This fixes bug#16635:
   Error messages wrong: absolute path names, "%s" format code

See the bug report or the changelog for "sql/share/english/errmsg.txt"
for instructions how to do that with other languages, 
even at the customer site, and for the restrictions to keep.


sql/share/english/errmsg.txt:
  The embedded server uses absolute path names in its error messages,
  in the release build environment these exceed the 64 character limit
  which the format strings for the error messages impose (bug#16635).
  
  But when the messages are output, the server does the "printf()" 
  internally in a 256 character buffer; the constant text and the
  expanded variables (strings, error number) must fit into this.
  
  (If the buffer would overflow, a format specification will not be
  expanded but just copied with its code, and the message output
  will just contain '%s' or '%d' where a value is expected.)
  
  So the string lengths are increased to 150 characters in those messages
  which are issued by the embedded server during release tests
  and contain 1 (one) path name,
  but only to 107 in the "rename" message which contains 2 (two).
  
  This solves bug#16635 for the release builds.
  
  For other languages used by OEM customers, similar fixes may be needed,
  but we cannot test them.
  
  These fixes can be done even in a binary installation at the customer site
  by following these steps:
     cd <<install-root>>/share
     $EDITOR <<lang>>/errmsg.txt
     ../../bin/comp_err -C./charsets/ <<lang>>/errmsg.txt <<lang>>/errmsg.sys
  and then restarting the server.
2007-07-26 12:52:13 +02:00
unknown
72c6c789cf Fixed bug #29911.
This bug manifested itself for join queries with GROUP BY and HAVING clauses
whose SELECT lists contained DISTINCT. It occurred when the optimizer could
deduce that the result set would have not more than one row.
The bug could lead to wrong result sets for queries of this type because
HAVING conditions were erroneously ignored in some cases in the function
remove_duplicates.   


mysql-test/r/having.result:
  Added a test case for bug #29911.
mysql-test/t/having.test:
  Added a test case for bug #29911.
2007-07-20 22:56:19 -07:00
unknown
e587830c50 Merge sin.intern.azundris.com:/home/tnurnberg/27198/40-27198
into  sin.intern.azundris.com:/home/tnurnberg/27198/41-27198


sql/mysql_priv.h:
  Bug #27198: Error returns from time() are ignored
  
  manual merge
sql/sql_class.h:
  Bug #27198: Error returns from time() are ignored
  
  manual merge
2007-07-16 22:38:50 +02:00
unknown
a7e5f73abb Bug#27198: Error returns from time() are ignored
gettimeofday() can fail and presumably, so can time().
Keep an eye on it.

Since we have no data on this at all so far, we just
retry on failure (and log the event), assuming that
this is just an intermittant failure. This might of
course hang the threat until we succeed. Once we know
more about these failures, an appropriate more clever
scheme may be picked (only try so many times per thread,
etc., if that fails, return last "good" time() we got or
some such).  Using sql_print_information() to log as this
probably only occurs in high load scenarios where the debug-
trace likely is disabled (or might interfere with testing
the effect).  No test-case as this is a non-deterministic
issue.


sql/mysql_priv.h:
  Bug#27198: Error returns from time() are ignored
  
  move declarations for log.cc to before inclusion of
  sql_class.h as we now use sql_print_information() in
  there.
sql/sql_class.h:
  Bug#27198: Error returns from time() are ignored
  
  gettimeofday() can fail and presumably, so can time().
  Keep an eye on it.
2007-07-13 17:50:58 +02:00
unknown
ee7519a5d5 Merge sita.local:/Users/tsmith/m/bk/41
into  sita.local:/Users/tsmith/m/bk/maint/41
2007-07-09 01:21:22 -06:00
unknown
1b827e0399 Merge maint1.mysql.com:/data/localhome/tsmith/bk/41
into  maint1.mysql.com:/data/localhome/tsmith/bk/maint/41
2007-07-04 21:22:35 +02:00
unknown
19a5d20ce3 sql_class.cc:
Windows compilation error fix.


sql/sql_class.cc:
  Windows compilation error fix.
2007-07-03 21:05:17 +05:00
unknown
166d3c9186 Fixed bug #29294.
The `SELECT 'r' INTO OUTFILE ... FIELDS ENCLOSED BY 'r' ' statement
encoded the 'r' string to a 4 byte string of value x'725c7272'
(sequence of 4 characters: r\rr).
The LOAD DATA statement decoded this string to a 1 byte string of
value x'0d' (ASCII Carriage Return character) instead of the original
'r' character.
The same error also happened with the FIELDS ENCLOSED BY clause
followed by special characters: 'n', 't', 'r', 'b', '0', 'Z' and 'N'.

NOTE 1: This is a result of the undocumented feature: the LOAD DATA INFILE
recognises 2-byte input sequences like \n, \t, \r and \Z in addition
to documented 2-byte sequences: \0 and \N. This feature should be
documented (here backspace character is a default ESCAPED BY character,
in the real-life example it may be any ESCAPED BY character).

NOTE 2, changed behaviour:
Now the `SELECT INTO OUTFILE' statement with the `FIELDS ENCLOSED BY'
clause followed by one of: 'n', 't', 'r', 'b', '0', 'Z' or 'N' characters
encodes this special character itself by doubling it ('r' --> 'rr'),
not by prepending it with an escape character.


sql/sql_class.h:
  Fixed bug #29294.
  The ESCAPE_CHARS macro constant is defined to enumerate
  symbolic names of espace-sequences like  '\n', '\t' etc.
  The select_export::is_ambiguous_field_sep field has been added
  to distinguish special values of the field_sep field from
  another values (see ESCAPE_CHARS).
sql/sql_class.cc:
  Fixed bug #29294.
  The select_export::send_data method has been modified to
  encode special values of the field_sep field by
  doubling of those values instead of prepending them with a
  value of the escape_char field.
  Example: The SELECT 'r' INTO OUTFILE FIELDS ENCLOSED BY 'r'
  now produces the 'rr' output string instead of x'5c72'
  (i.e. instead of sequence of 2 bytes: \ and r).
sql/sql_load.cc:
  Fixed bug #29294.
  Added commentary for the READ_INFO::unescape method.
mysql-test/t/loaddata.test:
  Updated test case for bug #29294.
mysql-test/r/loaddata.result:
  Updated test case for bug #29294.
2007-07-03 19:37:46 +05:00
unknown
7fbf6303d2 Fixed bug #29251.
Sometimes special 0 ENUM values was ALTERed to normal
empty string ENUM values.

Special 0 ENUM value has the same string representation
as normal ENUM value defined as '' (empty string).
The do_field_string function was used to convert
ENUM data at an ALTER TABLE request, but this
function doesn't care about numerical "indices" of
ENUM values, i.e. do_field_string doesn't distinguish
a special 0 value from an empty string value.

A new copy function called do_field_enum has been added to
copy special 0 ENUM values without conversion to an empty
string.


sql/field_conv.cc:
  Fixed bug #29251.
  The Copy_field::get_copy_func method has been modified to
  return a pointer to the do_field_enum function if a conversion
  between two columns of incompatible enum types is required.
  The do_field_enum function has been added for the correct
  conversion of special 0 enum values.
mysql-test/t/type_enum.test:
  Updated test case for bug #29251.
mysql-test/r/type_enum.result:
  Updated test case for bug #29251.
2007-06-27 03:41:50 +05:00
unknown
58419e9e18 Merge maint1.mysql.com:/data/localhome/tsmith/bk/41
into  maint1.mysql.com:/data/localhome/tsmith/bk/maint/41
2007-06-26 23:56:56 +02:00
unknown
be684dc0ee Merge gleb.loc:/home/uchum/work/bk/4.1
into  gleb.loc:/home/uchum/work/bk/4.1-opt
2007-06-25 14:08:53 +05:00
unknown
c1cf6e612d Bug #29117 (init_file test crashes with embedded server)
we use net->vio in my_net_local_init, but in the my_net_init
implementation we set it after the call, so work with unspecified
net->vio value


sql/net_serv.cc:
  Bug #29117 (init_file test crashes with embedded server)
  
  as we started using net->vio in my_net_local_init, we should set
  it before the call
2007-06-19 11:13:11 +05:00
unknown
bf39809145 Merge maint1.mysql.com:/data/localhome/tsmith/bk/41
into  maint1.mysql.com:/data/localhome/tsmith/bk/maint/41


configure.in:
  Auto merged
2007-06-18 22:10:54 +02:00
unknown
059b70d428 Merge trift2.:/MySQL/M41/clone-4.1
into  trift2.:/MySQL/M41/push-4.1
2007-06-18 19:16:12 +02:00
unknown
4a56e7ccbf Merge trift2.:/MySQL/M41/mysql-4.1
into  trift2.:/MySQL/M41/push-4.1
2007-06-18 11:25:26 +02:00
unknown
82f757ff0f Merge chilla.local:/home/mydev/mysql-4.1-amain
into  chilla.local:/home/mydev/mysql-4.1-axmrg
2007-06-15 16:24:43 +02:00
unknown
e4c320bfea Merge trift2.:/MySQL/M41/mysql-4.1
into  trift2.:/MySQL/M41/push-4.1
2007-06-14 21:27:33 +02:00
unknown
95d439d375 Merge bk@192.168.21.1:mysql-4.1
into  mysql.com:/d2/hf/mrg/mysql-4.1-opt
2007-06-14 16:35:46 +05:00
unknown
9cbd0ae4b3 sql/item_func.cc
Improved check for thread identity in the "embedded" case,
    provided by Monty.
    
    This finishes the fixes for bug#27078.


sql/item_func.cc:
  Improved check for thread identity in the "embedded" case,
  provided by Monty.
  
  This finishes the fixes for bug#27078.
2007-06-13 13:33:00 +02:00
unknown
3a364d5172 Bug#28984: crasher on connect with out of range password length in \
protocol

Fixed duplicated code, same as last commit.

One could send a malformed packet that caused the server to SEGV.  In 
recent versions of the password protocol, the client tells the server 
what length the ciphertext is (almost always 20).  If that length was
large enough to overflow a signed char, then the number would jump to 
very large after being casted to unsigned int.

Instead, cast the *passwd char to uchar.


sql/sql_parse.cc:
  Additional location of signed-char casted to uint.
2007-06-12 08:47:36 -04:00
unknown
7da98b93e1 Merge chilla.local:/home/mydev/mysql-4.1-amain
into  chilla.local:/home/mydev/mysql-4.1-axmrg
2007-06-11 16:24:29 +02:00
unknown
606927f78f Merge bk-internal.mysql.com:/home/bk/mysql-4.1-maint
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-4.1-maint
2007-06-08 16:52:40 -04:00
unknown
5fbb42ecbe Merge zippy.cornsilk.net:/home/cmiller/work/mysql/41gca
into  zippy.cornsilk.net:/home/cmiller/work/mysql/mysql-4.1-release
2007-06-08 16:28:48 -04:00
unknown
c1585aea56 Bug #28984: crasher on connect with out of range password length in \
protocol

One could send a malformed packet that caused the server to SEGV.  In 
recent versions of the password protocol, the client tells the server 
what length the ciphertext is (almost always 20).  If that length was
large enough to overflow a signed char, then the number would jump to 
very large after being casted to unsigned int.

Instead, cast the *passwd char to uchar. 



sql/sql_parse.cc:
  Cast *passwd to get rid of the sign, so that sign extension doesn't
  cause the sequence 125, 126, 127, 4294967169, 4294967170.
2007-06-08 16:10:53 -04:00
unknown
593afb6a73 Bug#28553 mysqld crash in "purge master log before(select time from information_schema)"
forbid the use of subselect in PURGE LOGS BEFORE command


mysql-test/r/subselect.result:
  test result
mysql-test/t/subselect.test:
  test case
sql/sql_yacc.yy:
  forbid the use of subselect in PURGE LOGS BEFORE command
2007-06-06 18:29:15 +05:00
unknown
93b101243d BUG#28574 - repair table causes queries to fail with various
corruption errors: 126,134,145

When one thread attempts to lock two (or more) tables and another
thread executes statement that aborts these locks (e.g. REPAIR
TABLE) we may get a table object with wrong lock type in a table
cache.

For example if SELECT FROM t1,t2 was aborted, subsequent INSERT
INTO t1 may be executed under read lock.

As a result we may get various table corruptions and even a server
crash.

This is fixed by resetting lock type in case lock was aborted by
another thread.

I failed to create reasonable test case for this bug.


sql/lock.cc:
  If thr_multi_lock was aborted by another thread, it unlocks tables
  that were locked before one that was aborted. Lock type for tables
  that were after a table that was aborted preserved. Thus we need
  to reset lock data in case thr_multi_lock was aborted.
2007-06-01 13:50:13 +05:00
unknown
e65fdda8b1 Makefile.am, configure.in:
Added --with-mysqld-libs configure flag


configure.in:
  Added --with-mysqld-libs configure flag
sql/Makefile.am:
  Added --with-mysqld-libs configure flag
2007-05-30 22:11:53 +02:00
unknown
e5b2adeac1 Merge mysql.com:/home/svoj/devel/bk/mysql-4.1
into  mysql.com:/home/svoj/devel/mysql/merge/mysql-4.1-engines
2007-05-23 12:38:34 +05:00
unknown
ea263c4a4d Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/41
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/41
2007-05-21 20:49:24 +02:00
unknown
25090a6da6 Merge bk@192.168.21.1:mysql-4.1
into  mysql.com:/d2/hf/mrg/mysql-4.1-opt
2007-05-18 20:01:49 +05:00
unknown
fde76b7e54 Merge siva.hindu.god:/home/tsmith/m/bk/41
into  siva.hindu.god:/home/tsmith/m/bk/maint/41
2007-05-17 14:16:33 -06:00
unknown
c3c64f1a0a Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  vajra.(none):/opt/local/work/mysql-4.1-runtime
2007-05-15 13:39:24 +04:00
unknown
8762539d47 Fixed bug #28272: crash that occurs when running an EXPLAIN command
for a query over an empty table right after its creation. 
The crash is the result of an attempt made by JOIN::optimize to evaluate
the WHERE condition when no records have been actually read.
The added test case can reproduce the crash only with InnoDB tables and
only with 5.0.x.
 


mysql-test/r/innodb_mysql.result:
  Added a test case for bug #28272.
mysql-test/t/innodb_mysql.test:
  Added a test case for bug #28272.
sql/sql_select.cc:
  Fixed bug #28272: crash that occurs when running an EXPLAIN command
  for a query over an empty table right after its creation. 
  The crash is the result of an attempt made by JOIN::optimize to evaluate
  the WHERE condition when no records have been actually read.
  Such attempts could be observed only with EXPLAIN commands.
  Now at the optimization phase the WHERE condition is never evaluated if 
  there is no record previously read from the table.
2007-05-14 23:55:18 -07:00
unknown
fca58c9556 Fixed bug #27937: crash for the the second execution of a prepared
statement from a UNION query with ORDER BY an expression containing
RAND().
The crash happened because the global order by list in the union query
was not re-initialized for execution.
(Local order by lists were re-initialized though).



mysql-test/r/ps.result:
  Added a test case for bug #27937.
mysql-test/t/ps.test:
  Added a test case for bug #27937.
sql/sql_union.cc:
  Fixed bug #27937: crash for the the second execution of a prepared
  statement from a UNION query with ORDER BY an expression containing
  RAND().
  The crash happened because the global order by list in the union query
  was not re-initialized for execution.
  (Local order by lists were re-initialized though).
  Added re-initialization of the global order by list in the function
  st_select_lex_unit::init_prepare_fake_select_lex.
2007-05-14 16:41:09 -07:00
unknown
ed9474993d Bug #27792 query cache returns wrong result, with certain system variables
- Queries in the query cache are identified by the individual 
   characters in the query statement, the current database and 
   the current environment expressed as a set of system variable
   flags.
 - Since the set of environment flags didn't properly describe the
   current environment unexpected results were returned from the 
   query cache.
 - Query cache is now cleared when the variable ft_boolean_syntax is 
   updated.
 - An identification flag for the variable default_week_format is 
   added to the query cache record.
 
Thanks to Martin Friebe who has supplied significant parts of this patch.


mysql-test/r/query_cache.result:
  Added test case
mysql-test/t/query_cache.test:
  Added test case
sql/mysql_priv.h:
  - Added missing flags to reflect the significant local environment
    settings of the cached query.
sql/set_var.cc:
  - Added query cache flush when system variable ft_boolean_syntax is
    updated since this also invalidates all cached result sets using this
    variable.
sql/sql_cache.cc:
  - Added another local system variable as an identification flag
    for cached queries.
2007-05-08 09:09:25 +02:00
unknown
4d263c4994 Bug #27173: "Enabling keys got errno ..." does not say which table
Warnings may show up in the error log that complain about a table, yet
don't tell us which table.

Add the database and table names to the message.


sql/ha_myisam.cc:
  Add the database and table names to the warning message.
2007-05-04 13:17:07 -04:00
unknown
353b6f26b1 Bug #27531: the 4.1 fix.
When checking for applicability of join cache
we must disable its usage only if there is no
temp table in use.
When a temp table is used we can use join
cache (and it will not make the result-set 
unordered) to fill the temp table. The filesort() 
operation is then applied to the data in the temp 
table and hence is not affected by join cache
usage.
Fixed by narrowing the condition for disabling 
join cache to exclude the case where temp table
is used.


mysql-test/r/join.result:
  Bug #27531: test case
mysql-test/t/join.test:
  Bug #27531: test case
sql/sql_select.cc:
  Bug #27531: 
  Disable join cache only if not using temp table
2007-05-04 16:43:29 +03:00
unknown
1a0e3a2858 Bug#23656: Wrong conversion result of a DATETIME to integer using CAST function.
The generic string to int conversion was used by the Item_func_signed and
the Item_func_unsigned classes to convert DATE/DATETIME values to the
SIGNED/UNSIGNED type. But this conversion produces wrong results for such
values.

Now if the item which result has to be converted can return its result as
longlong then the item->val_int() method is used to allow the item to carry
out the conversion itself and return the correct result.
This condition is checked in the Item_func_signed::val_int() and the
Item_func_unsigned::val_int() functions.


mysql-test/t/cast.test:
  Added a test case for the bug#23656: Wrong conversion result of a DATETIME to integer using CAST function.
mysql-test/r/cast.result:
  Added a test case for the bug#23656: Wrong conversion result of a DATETIME to integer using CAST function.
sql/item_func.cc:
  Bug#23656: Wrong conversion result of a DATETIME to integer using CAST function.
  Now if the item which result has to be converted can return its result as
  longlong then the item->val_int() method is used to allow the item to carry
  out the conversion itself and return the correct result.
  This condition is checked in the Item_func_signed::val_int() and the
  Item_func_unsigned::val_int() functions.
2007-05-04 00:53:37 +04:00
unknown
dd34042ec1 Fixed bug #24856: the result set of a ROLLUP query with DISTINCT could lack
some rollup rows (rows with NULLs for grouping attributes) if GROUP BY
list contained constant expressions.

This happened because the results of constant expressions were not put
in the temporary table used for duplicate elimination. In fact a constant
item from the GROUP BY list of a ROLLUP query can be replaced for an
Item_null_result object when a rollup row is produced . 

Now the JOIN::rollup_init function wraps any constant item referenced in
the GROYP BY list of a ROLLUP query into an Item_func object of a special
class that is never detected as constant item. This ensures creation of
fields for such  constant items in temporary tables and guarantees right
results when the result of the rollup operation first has to be written
into a temporary table, e.g. in the cases when duplicate elimination is
required.  


mysql-test/r/olap.result:
  Added a test case for bug #24856.
mysql-test/t/olap.test:
  Added a test case for bug #24856.
sql/item_func.h:
  Fixed bug #24856: the result set of a ROLLUP query with DISTINCT could lack
  some rollup rows (rows with NULLs for grouping attributes) if GROUP BY
  list contained constant expressions.
  
  Itroduced class Item_func_rollup_const derived from Item_func. The object of
  this class are never detected as constant items.
  We use them for wrapping constant items from the GROUP BY list of any ROLLUP
  query. This wrapping allows us to ensure writing constant items into temporary
  tables whenever the result of the ROLLUP operation has to be written into a
  temporary table, e.g. when ROLLUP is used together with DISTINCT in the SELECT
  list.
sql/sql_select.cc:
  Fixed bug #24856: the result set of a ROLLUP query with DISTINCT could lack
  some rollup rows (rows with NULLs for grouping attributes) if GROUP BY
  list contained constant expressions.
  
  Now the JOIN::rollup_init function wraps any constant item referenced in
  the GROYP BY list of a ROLLUP query into an Item_func object of a special
  class that is never detected as constant item. This ensures creation of
  fields for such  constant items in temporary tables and guarantees right
  results when the result of the rollup operation first has to be written
  into a temporary table, e.g. in the cases when duplicate elimination is
  required.
2007-04-29 16:04:43 -07:00
unknown
0cd6377f28 Merge bk@192.168.21.1:mysql-4.1
into  mysql.com:/d2/hf/mrg/mysql-4.1-opt
2007-04-29 18:39:45 +05:00
unknown
e822507364 Patch to eliminate compilation errors under VC after bug #13191 fix. 2007-04-29 11:56:23 +05:00
unknown
2503382629 Merge gshchepa.loc:/home/uchum/work/bk-trees/mysql-4.1-opt
into  gshchepa.loc:/home/uchum/work/bk-trees/mysql-4.1-opt-13191
2007-04-29 05:31:53 +05:00
unknown
98c0da4ed5 Fixed bug #13191.
INSERT...ON DUPLICATE KEY UPDATE may cause error 1032: 
"Can't find record in ..." if we are inserting into
InnoDB table unique index of partial key with
underlying UTF-8 string field.

This error occurs because INSERT...ON DUPLICATE uses a wrong
procedure to copy string fields of multi-byte character sets
for index search.


mysql-test/t/innodb_mysql.test:
  Added test case for bug #13191.
mysql-test/r/innodb_mysql.result:
  Added test case for bug #13191.
sql/field.h:
  Fixed bug #13191.
  Field_string::get_key_image() virtual function was overloaded
  to implement copying of variable length character (UTF-8) fields.
  Field::get_key_image() function prototype has been changed to
  return byte size of copied data.
sql/field.cc:
  Fixed bug #13191.
  Field_string::get_key_image() virtual function was overloaded
  to implement copying of variable length character (UTF-8) fields.
  Field::get_key_image() function prototype has been changed to
  return byte size of copied data.
sql/key.cc:
  Fixed bug #13191.
  INSERT...ON DUPLICATE KEY UPDATE may cause error 1032: 
  "Can't find record in ...".
  This error occurs because INSERT...ON DUPLICATE uses
  a wrong procedure to copy field parts for index search.
  key_copy() function has been fixed.
2007-04-29 04:16:17 +05:00