Commit graph

9729 commits

Author SHA1 Message Date
kroki/tomash@moonlight.intranet
c746c08af9 BUG#9678: Client library hangs after network communication failure
Socket timeouts in client library were used only on Windows.

The solution is to use socket timeouts in client library on all
systems were they are supported.

No test case is provided because it is impossible to simulate network
failure in current test suit.
2006-08-14 20:01:19 +04:00
ramil/ram@mysql.com/myoffice.izhnet.ru
bc1e69d453 Restore alphabetical order of the system variables. 2006-08-14 10:54:24 +05:00
tsmith/tim@siva.hindu.god
72d55f3878 Bug #20536: md5() with GROUP BY and UCS2 return different results on myisam/innodb
Make the encryption functions MD5(), SHA1() and ENCRYPT() return binary results.
    
Make MAKE_SET() and EXPORT_SET() use the correct character set for their default separator strings.
2006-08-11 17:09:19 -06:00
bar@mysql.com/bar.intranet.mysql.r18.ru
4a63a64f1e mysqld --collation-server=xxx --character-set-server=yyy
didn't work as expected: collation_server was set not to xxx,
but to the default collation of character set "yyy".
    
With different argument order it worked as expected:
mysqld --character-set-server=yyy --collation-server=yyy 
    
Fix:
initializate default_collation_name to 0
when processing --character-set-server
only if --collation-server has not been specified
in command line.
2006-08-11 13:19:44 +05:00
monty@mysql.com/narttu.mysql.fi
7d0b042ec5 Better bug fix for #14400 "Query joins wrong rows from table which is subject of "concurrent insert""
The previous bug fix didn't work when using partial keys.
Don't use GNUC min/max operations are they are depricated.
Fixed valgrind warning
2006-08-10 22:41:19 +03:00
stewart@willster.(none)
9d2e6b8d23 BUG#19914 SELECT COUNT(*) sometimes returns MAX_INT on cluster tables
allow handler::info to return an error code (that will be returned to the user)
2006-08-10 22:55:20 +08:00
gkodinov/kgeorge@macbook.gmz
9ff33b5d93 Bug #16792 query with subselect, join, and group not returning proper values
Treat queries with no FROM and aggregate functions as normal queries,
so the aggregate function get correctly calculated as if there is 1 row. 
This means that they will be considered to have one row, so COUNT(*) will return
1 instead of 0. Other aggregates will behave in compatible manner.
2006-08-10 16:45:02 +03:00
tnurnberg@salvation.intern.azundris.com
170392850d Bug#19844: time_format in Union truncates values
time_format() claimed %H and %k would return at most two digits
(hours 0-23), but this coincided neither with actual behaviour
nor with docs.  this is not visible in simple queries; forcing
a temp-table is probably the easiest way to see this.  adjusted
the return-length appropriately; the alternative would be to
adjust the docs to say that behaviour for > 99 hours is undefined.
---
Bug#19844: time_format in Union truncates values

time_format() claimed %H and %k would return at most two digits
(hours 0-23), but this coincided neither with actual behaviour
nor with docs.  this is not visible in simple queries; forcing
a temp-table is probably the easiest way to see this.  adjusted
the return-length appropriately; the alternative would be to
adjust the docs to say that behaviour for > 99 hours is undefined.
2006-08-10 15:37:24 +02:00
gkodinov/kgeorge@macbook.gmz
3183f73601 Bug #21180: Subselect with index for both WHERE and ORDER BY produces empty result
Reseting subqueries with "quick" access methods was incomplete.
 Partially backported the correct reseting of QUICK_SELECTs from 5.x.
2006-08-03 19:20:30 +03:00
svoj@may.pils.ru
34c83fba8d Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-4.1
into  may.pils.ru:/home/svoj/devel/mysql/BUG7391/mysql-4.1
2006-08-03 15:49:41 +05:00
msvensson@neptunus.(none)
5fc215e2e3 Bug#21419 test case lowercase_fs_off fails on Windows
- Backport patch from 5.0
2006-08-03 12:16:24 +02:00
svoj@may.pils.ru
395d3c3985 Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-4.1
into  may.pils.ru:/home/svoj/devel/mysql/BUG7391/mysql-4.1
2006-08-03 14:08:43 +05:00
svoj@may.pils.ru
67db270c71 BUG#7391 - Cross-database multi-table UPDATE uses active database
privileges

This problem is 4.1 specific. It doesn't affect 4.0 and was fixed
in 5.x before.

Having any mysql user who is allowed to issue multi table update
statement and any column/table grants, allows this user to update
any table on a server (mysql grant tables are not exception).

check_grant() accepts number of tables (in table list) to be checked
in 5-th param. While checking grants for multi table update, number
of tables must be 1. It must never be 0 (actually we have
DBUG_ASSERT(number > 0) in 5.x in grant_check() function).
2006-08-03 14:03:08 +05:00
tsmith/tim@siva.hindu.god
820f14b153 Merge bk-internal.mysql.com:/home/bk/mysql-4.1-maint
into  siva.hindu.god:/usr/home/tim/m/bk/done/b20402-41
2006-08-02 23:11:58 -06:00
cmiller@zippy.cornsilk.net
dd5eeaf676 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  zippy.cornsilk.net:/home/cmiller/work/mysql/m41-maint--07OBQ
2006-08-02 14:57:12 -04:00
evgen@moonbone.local
40a1fbdffb Merge moonbone.local:/work/tmp_merge-4.1
into  moonbone.local:/work/tmp_merge-4.1-opt-mysql
2006-08-02 16:10:52 +04:00
holyfoot/hf@mysql.com/deer.(none)
21f721c6f5 bug #13717 embedded library dumps warnings on STDERR directly
Here i just disabled STDERR warnings in embedded server
Later we should get more defined about logs in the embedded server
2006-08-01 15:18:21 +05:00
gkodinov/kgeorge@rakia.(none)
351554e121 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B20792-4.1-opt
2006-07-27 10:06:37 +03:00
tsmith/tim@siva.hindu.god
f5764cecde Bug #20402: DROP USER failure logged as ERROR rather than WARNING
slave.cc, sql_acl.cc:
- remove sql_print_error() for events that are not server errors
2006-07-26 16:33:26 -06:00
gkodinov/kgeorge@rakia.(none)
e2a082aa32 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B20792-4.1-opt
2006-07-26 19:55:33 +03:00
gkodinov/kgeorge@macbook.gmz
565d495997 * Bug #20792: Incorrect results from aggregate subquery
When processing aggregate functions all tables values are reset
to NULLs at the end of each group. 
When doing that if there are no rows found for a group
the const tables must not be reset as they are not recalculated 
by do_select()/sub_select() for each group.
2006-07-26 19:19:30 +03:00
gkodinov/kgeorge@rakia.(none)
49f8ec4c99 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B21019-4.1-opt
2006-07-26 18:49:26 +03:00
kroki/tomash@moonlight.intranet
4e845cccc4 BUG#21206: memory corruption when too many cursors are opened at once
Too many cursors (more than 1024) could lead to memory corruption.
This affects both, stored routines and C API cursors, and the
threshold is per-server, not per-connection.  Similarly, the
corruption could happen when the server was under heavy load
(executing more than 1024 simultaneous complex queries), and this is
the reason why this bug is fixed in 4.1, which doesn't support
cursors.

The corruption was caused by a bug in the temporary tables code, when
an attempt to create a table could lead to a write beyond allocated
space.  Note, that only internal tables were affected (the tables
created internally by the server to resolve the query), not tables
created with CREATE TEMPORARY TABLE.  Another pre-condition for the
bug is TRUE value of --temp-pool startup option, which, however, is a
default.

The cause of a bug was that random memory was overwritten in
bitmap_set_next() due to out-of-bound memory access.
2006-07-26 16:23:07 +04:00
gkodinov/kgeorge@macbook.gmz
6766cfcdf9 Bug #21019: First result of SELECT COUNT(*) different than consecutive runs
When optimizing conditions like 'a = <some_val> OR a IS NULL' so that they're
 united into a single condition on the key and checked together the server must 
 check which value is the NULL value in a correct way : not only using ->is_null 
 but also check if the expression doesn't depend on any tables referenced in the 
 current statement. 
 This additional check must be performed because that optimization takes place 
 before the actual execution of the statement, so if the field was initialized 
 to NULL from a previous statement the optimization would be applied incorrectly.
2006-07-26 13:32:28 +03:00
timour/timka@lamia.home
86ae2f3b06 Fix for BUG#20954: avg(keyval) retuns 0.38 but max(keyval) returns an empty set
The problem was in that opt_sum_query() replaced MIN/MAX functions
with the corresponding constant found in a key, but due to imprecise
representation of float numbers, when evaluating the where clause,
this comparison failed.

When MIN/MAX optimization detects that all tables can be removed,
also remove all conjuncts in a where clause that refer to these
tables. As a result of this fix, these conditions are not evaluated
twice, and in the case of float number comparisons we do not discard
result rows due to imprecise float representation.

As a side-effect this fix also corrects an unnoticed problem in
bug 12882.
2006-07-26 01:11:19 +03:00
joerg@trift2.
b7cf8cefe9 Merge trift2.:/M41/clone-4.1
into  trift2.:/M41/push-4.1
2006-07-24 19:18:30 +02:00
ramil/ram@mysql.com/myoffice.izhnet.ru
694d4999ef Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b16327
2006-07-23 14:17:01 +05:00
sergefp@mysql.com
bffd438de3 BUG#20975: Incorrect query result for NOT (subquery):
Add implementations of Item_func_{nop,not}_all::neg_transformer
2006-07-21 03:04:04 +04:00
igor@olga.mysql.com
f201828dd8 Fixed bug #17526: incorrect print method
for class Item_func_trim. 
For 4.1 it caused wrong output for EXPLAIN EXTENDED commands
if expressions with the TRIM function of two arguments were used.
For 5.0 it caused an error message when trying to select
from a view with the TRIM function of two arguments.
This unexpected error message was due to the fact that the
print method for the class Item_func_trim was inherited from
the class Item_func. Yet the TRIM function does not take a list
of its arguments. Rather it takes the arguments in the form:
  [{BOTH | LEADING | TRAILING} [remstr] FROM] str) |
  [remstr FROM] str
2006-07-19 12:36:55 -07:00
iggy@rolltop.ignatz42.dyndns.org
79483c22bb Merge rolltop.ignatz42.dyndns.org:/mnt/storeage/mysql-4.1-maint
into  rolltop.ignatz42.dyndns.org:/mnt/storeage/mysql-4.1-maint_bug16180
2006-07-19 13:09:11 -04:00
msvensson@neptunus.(none)
9a7d888aa3 Bug #21135 Crash in test "func_time"
- backport patch from 5.0
 - "table" can be NULL in temporary fields used for type conversion
2006-07-19 15:55:04 +02:00
evgen@moonbone.local
6dd8772bfc Merge moonbone.local:/home/evgen/bk-trees/mysql-4.1
into  moonbone.local:/work/tmp_merge-4.1-opt-mysql
2006-07-18 23:30:09 +04:00
evgen@moonbone.local
a8d230c672 Merge moonbone.local:/work/mysql-4.1
into  moonbone.local:/work/tmp_merge-4.1-opt-mysql
2006-07-18 21:30:26 +04:00
bar@mysql.com/bar.intranet.mysql.r18.ru
483d0e3b4a Backporting Kostja's changes made for 5.0 into 4.1.
Please use "ul" when merging this changeset to 5.0.
2006-07-18 15:53:12 +05:00
joerg@trift2.
c621d4e45c Changes to make "sql/sql_locale.cc" compile + link on Windows:
1) When initializing a boolean variable, do not use string representations '"false"' and '"true"' 
    but rather the boolean values 'false' and 'true'.
2) Add the module to the various Windows description files.
2006-07-17 20:40:41 +02:00
ramil/ram@mysql.com/myoffice.izhnet.ru
0d15e5e340 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b15195
2006-07-14 16:58:51 +05:00
ramil/ram@mysql.com/myoffice.izhnet.ru
b57efe738a --{skip-}merge option added which allows the user to disable merge engine and
to avoid the potential security problem.
(see bug #15195: Security Breach with MERGE table)
2006-07-14 16:26:58 +05:00
gkodinov/kgeorge@rakia.(none)
f04ea13511 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  rakia.(none):/home/kgeorge/mysql/autopush/B17212-4.1-opt
2006-07-14 12:49:14 +03:00
holyfoot/hf@mysql.com/deer.(none)
eddaafb12b Merge bk@192.168.21.1:mysql-4.1
into  mysql.com:/home/hf/work/mysql-4.1.16017
2006-07-13 22:32:18 +05:00
mkindahl@dl145k.mysql.com
0f070b0b32 Merge dl145k.mysql.com:/data0/mkindahl/bkroot/mysql-4.1
into  dl145k.mysql.com:/data0/mkindahl/bk/mysql-4.1-rpl
2006-07-12 10:04:40 +02:00
gkodinov/kgeorge@macbook.gmz
5079d5cf6a Bug #17212 results not sorted correctly by ORDER BY when using index
* don't use join cache when the incoming data set is already ordered
    for ORDER BY
    This choice must be made because join cache will effectively
    reverse the join order and the results will be sorted by the index
    of the table that uses join cache.
2006-07-12 10:57:38 +03:00
cmiller@maint1.mysql.com
f83ad34329 Merge cmiller@bk-internal.mysql.com:/home/bk/mysql-4.1
into  maint1.mysql.com:/data/localhome/cmiller/mysql-4.1
2006-07-12 05:34:56 +02:00
evgen@moonbone.local
363d14569e Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  moonbone.local:/work/16302-bug-4.1-opt-mysql
2006-07-12 06:12:59 +04:00
evgen@moonbone.local
5d4881b864 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  moonbone.local:/work/18503-bug-4.1-mysql
2006-07-12 02:52:29 +04:00
evgen@moonbone.local
8ffda481c9 Fixed bug#18503: Queries with a quantified subquery returning empty set
may return a wrong result.

An Item_sum_hybrid object has the was_values flag which indicates whether any
values were added to the sum function. By default it is set to true and reset
to false on any no_rows_in_result() call. This method is called only in
return_zero_rows() function. An ALL/ANY subquery can be optimized by MIN/MAX
optimization. The was_values flag is used to indicate whether the subquery
has returned at least one row. This bug occurs because return_zero_rows() is
called only when we know that the select will return zero rows before
starting any scans but often such information is not known.
In the reported case the return_zero_rows() function is not called and
the was_values flag is not reset to false and yet the subquery return no rows
Item_func_not_all and Item_func_nop_all functions return a wrong
comparison result.

The end_send_group() function now calls no_rows_in_result() for each item
in the fields_list if there is no rows were found for the (sub)query.
2006-07-12 01:52:18 +04:00
cmiller@zippy.(none)
f12bc24ac6 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  zippy.(none):/home/cmiller/work/mysql/m41-maint--07AB5
2006-07-11 14:25:42 -04:00
cmiller@zippy.(none)
22485908ce Bug#20729: Bad date_format() call makes mysql server crash
The problem is that the author used the wrong function to send a warning to the 
user about truncation of data.  push_warning() takes a constant string and 
push_warning_printf() takes a format and variable arguments to fill it.

Since the string we were complaining about contains percent characters, the 
printf() code interprets the "%Y" et c. that the user sends.  That's wrong, and
often causes a crash, especially if the date mentions seconds, "%s".

A alternate fix would be to use  push_warning_printf(..., "%s", warn_buff) .
2006-07-11 13:06:29 -04:00
evgen@moonbone.local
ff3ffe5c39 Merge moonbone.local:/work/allany-4.1-mysql
into  moonbone.local:/work/16302-bug-4.1-opt-mysql
2006-07-11 17:48:33 +04:00
evgen@moonbone.local
a65bf3bf90 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  moonbone.local:/home/evgen/bk-trees/mysql-4.1-opt
2006-07-11 17:35:36 +04:00
cmiller@zippy.(none)
faa575645f Merge zippy.(none):/home/cmiller/work/mysql/mysql-4.0__bug19006
into  zippy.(none):/home/cmiller/work/mysql/merge/mysql-4.1
2006-07-11 07:24:59 -04:00
evgen@moonbone.local
4235ab7e1c Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  moonbone.local:/work/allany-4.1-mysql
2006-07-11 00:36:14 +04:00
evgen@moonbone.local
d34189715e Fixed bug#16302: Quantified subquery without any tables gives wrong results
The ALL/ANY subqueries are the subject of MIN/MAX optimization. The matter
of this optimization is to embed MIN() or MAX() function into the subquery
in order to get only one row by which we can tell whether the expression
with ALL/ANY subquery is true or false.
But when it is applied to a subquery like 'select a_constant' the reported bug
occurs. As no tables are specified in the subquery the do_select() function 
isn't called for the optimized subquery and thus no values have been added 
to a MIN()/MAX() function and it returns NULL instead of a_constant.
This leads to a wrong query result.

For the subquery like 'select a_constant' there is no reason to apply
MIN/MAX optimization because the subquery anyway will return at most one row.
Thus the Item_maxmin_subselect class is more appropriate for handling such
subqueries.

The Item_in_subselect::single_value_transformer() function now checks
whether tables are specified for the subquery. If no then this subselect is
handled like a UNION using an Item_maxmin_subselect object.
2006-07-11 00:34:37 +04:00
gkodinov/kgeorge@macbook.gmz
893e92761f Merge rakia:mysql/4.1/B14553
into  macbook.gmz:/Users/kgeorge/mysql/work/B14553-4.1-opt
2006-07-10 16:27:04 +03:00
gkodinov/kgeorge@mysql.com/rakia.(none)
2c9f5cc706 BUG#14553: NULL in WHERE resets LAST_INSERT_ID
To make MySQL compatible with some ODBC applications, you can find
the AUTO_INCREMENT value for the last inserted row with the following query:
 SELECT * FROM tbl_name WHERE auto_col IS NULL.
This is done with a special code that replaces 'auto_col IS NULL' with
'auto_col = LAST_INSERT_ID'.
However this also resets the LAST_INSERT_ID to 0 as it uses it for a flag
so as to ensure that only the first SELECT ... WHERE auto_col IS NULL
after an INSERT has this special behaviour.
In order to avoid resetting the LAST_INSERT_ID a special flag is introduced
in the THD class. This flag is used to restrict the second and subsequent
SELECTs instead of LAST_INSERT_ID.
2006-07-10 16:27:03 +03:00
aelkin/elkin@dsl-hkigw8-feb1fb00-100.dhcp.inet.fi
fadbdf27c3 BUG#20919 temp tables closing fails when binlog is off
closing temp tables through end_thread
had a flaw in binlog-off branch of close_temporary_tables where
next table to close was reset via table->next
 for (table= thd->temporary_tables; table; table= table->next)
which was wrong since the current table instance got destoyed at
	close_temporary(table, 1);

The fix adapts binlog-on branch method to engage the loop's internal 'next' variable which holds table->next prior table's destoying.
2006-07-10 00:26:26 +03:00
ingo/mydev@chilla.local
23c2570a5e Merge chilla.local:/home/mydev/mysql-4.0
into  chilla.local:/home/mydev/mysql-4.0-bug14400
2006-07-08 21:16:13 +02:00
ingo/mydev@chilla.local
065cdb030a Merge chilla.local:/home/mydev/mysql-4.1-bug14400
into  chilla.local:/home/mydev/mysql-4.1-amerge
2006-07-08 19:25:01 +02:00
bar@mysql.com
2303077238 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/bar/mysql-4.1.b17647
2006-07-07 12:17:00 +05:00
konstantin@bodhi.netgear
0db71aaf98 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  bodhi.netgear:/opt/local/work/mysql-4.1-19399
2006-07-07 00:01:05 +04:00
konstantin@bodhi.netgear
8e735d2c11 A fix and a test case for Bug#19399 "res 'Lost Connection' when
dropping/creating tables".

The bug could lead to a crash when multi-delete statements were
prepared and used with temporary tables.

The bug was caused by lack of clean-up of multi-delete tables before
re-execution of a prepared statement. In a statement like
DELETE t1 FROM t1, t2 WHERE ... the first table list (t1) is
moved to lex->auxilliary_table_list and excluded from lex->query_tables
or select_lex->tables. Thus it was unaccessible to reinit_stmt_before_use
and not cleaned up before re-execution of a prepared statement.
2006-07-06 23:59:04 +04:00
iggy@rolltop.ignatz42.dyndns.org
646dd6e65c Merge rolltop.ignatz42.dyndns.org:/mnt/storeage/mysql-4.1-maint
into  rolltop.ignatz42.dyndns.org:/mnt/storeage/mysql-4.1_bug16180
2006-07-06 15:00:31 -04:00
igor@olga.mysql.com
6e1c8ad830 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  olga.mysql.com:/home/igor/mysql-4.1-opt
2006-07-06 11:38:48 -07:00
igor@olga.mysql.com
0e3d2dafd6 Fixed bug #18243.
The implementation of the method Item_func_reverse::val_str
for the REVERSE function modified the argument of the function.
This led to wrong results for expressions that contained
REVERSE(ref) if ref occurred somewhere else in the expressions.
2006-07-06 11:11:49 -07:00
ingo@mysql.com
40c103478d Merge mysql.com:/home/mydev/mysql-4.0-bug14400
into  mysql.com:/home/mydev/mysql-4.1-bug14400
2006-07-04 19:10:13 +02:00
bar@mysql.com
3855520138 WL#2928 Date Translation NRE
(implemented by by Josh Chamas)
2006-07-04 17:40:40 +05:00
sergefp@mysql.com
d581287b34 Better comments for void Item::top_level_item() 2006-07-04 13:28:30 +04:00
cmiller@zippy.(none)
5039184e83 Bug#19006: 4.0 valgrind problems (in test func_str)
On exactly-sized Strings, the String::c_ptr() function peeked beyond the
end of the buffer, possibly into unititialized space to see whether the 
buffer was NUL-terminated.

In a place that did peek improperly, we now use a c_ptr_safe() function, 
which doesn't peek where it shouldn't.
2006-07-01 14:31:52 -04:00
sergefp@mysql.com
61348cac0c Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/home/psergey/mysql-4.1-bug16168-push
2006-07-01 01:55:43 +04:00
monty@mysql.com
445dfdc3a7 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/home/my/mysql-4.1
2006-06-30 19:15:17 +03:00
monty@mysql.com
2bec1b86bb Reverted wrong bug fix (Bug#11228) 2006-06-30 18:29:27 +03:00
tomas@poseidon.ndb.mysql.com
e61bfafaa9 Merge poseidon.ndb.mysql.com:/home/tomas/mysql-4.1
into  poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-main
2006-06-30 16:26:33 +02:00
tomas@poseidon.ndb.mysql.com
9f542ef0f4 adopted ndb handler code for tables without primary key and with unique index
- added missing retrieval of hidden primary key
2006-06-30 16:25:07 +02:00
sergefp@mysql.com
611e20d8e1 BUG#16168: Wrong results from range optimizer, "Use_count: Wrong count for key ..." warnings:
- Added comments.
 - Make SEL_ARG::clone() set SEL_ARG::elements in the created copy.
2006-06-30 09:05:12 +04:00
monty@mysql.com
f25b4e0464 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/home/my/mysql-4.1
2006-06-30 04:27:19 +03:00
monty@mysql.com
a267b8f33c Don't read ~/.my.cnf in mysqldump.test 2006-06-30 04:10:27 +03:00
evgen@moonbone.local
83bc48f38e Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1
into moonbone.local:/work/merge-4.1
2006-06-30 01:12:16 +04:00
tomas@poseidon.ndb.mysql.com
747c17ffa3 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-main
2006-06-29 23:12:15 +02:00
tomas@poseidon.ndb.mysql.com
87460ec76a Bug #19202 Incorrect errorhandling in select count(*) wrt temporary error 2006-06-29 20:55:21 +02:00
gkodinov@mysql.com
9dbb09182b Merge mysql.com:/home/kgeorge/mysql/4.1/teamclean
into  mysql.com:/home/kgeorge/mysql/4.1/warnings
2006-06-29 10:36:08 +03:00
ingo@mysql.com
99ad23ec7c Bug#14400 - Query joins wrong rows from table which is subject of "concurrent insert"
It was possible that fetching a record by an exact key value 
(including the record pointer) could return a record with a 
different key value. This happened only if a concurrent insert 
added a record with the searched key value after the fetching 
statement locked the table for read.

The search succeded on the key value, but the record was
rejected as it was past the file length that was remembered
at start of the fetching statement. With other words it was 
rejected as being a concurrently inserted record.

The action to recover from this problem was to fetch the 
record that is pointed at by the next key of the index. 
This was repeated until a record below the file length was 
found.

I do now avoid this loop if an exact match was searched. 
If this match is beyond the file length, it is now treated 
as "key not found". There cannot be another key with the 
same record pointer.
2006-06-28 18:55:30 +02:00
gkodinov@mysql.com
96ceb6c234 gcc 4.1 linux warning fixes backported from 5.0. 2006-06-28 16:28:29 +03:00
iggy@mysql.com
2781050afc Bug#16180 Setting SQL_LOG_OFF without SUPER privilege is silently ignored 2006-06-27 20:10:49 -04:00
svoj@may.pils.ru
ffd8ed1716 BUG#1662 - ALTER TABLE LIKE ignores DATA/INDEX DIRECTPORY
Produce a warning if DATA/INDEX DIRECTORY is specified in
ALTER TABLE statement.

Ignoring of these options is documented in the symbolic links
section of the manual.
2006-06-27 22:22:43 +05:00
gkodinov@mysql.com
be3c4a154f Merge mysql.com:/home/kgeorge/mysql/4.1/teamclean
into  mysql.com:/home/kgeorge/mysql/4.1/B16458
2006-06-27 18:47:22 +03:00
kroki@mysql.com
49cc2904d2 Dec. 31st, 9999 is still a valid date, only starting with Jan 1st 10000 things become invalid (Bug #12356) 2006-06-27 19:33:59 +04:00
gkodinov@mysql.com
9ec681ef35 Bug #16458: Simple SELECT FOR UPDATE causes "Result Set not updatable" error
'SELECT DISTINCT a,b FROM t1' should not use temp table if there is unique 
index (or primary key) on a.
There are a number of other similar cases that can be calculated without the
use of a temp table : multi-part unique indexes, primary keys or using GROUP BY 
instead of DISTINCT.
When a GROUP BY/DISTINCT clause contains all key parts of a unique
index, then it is guaranteed that the fields of the clause will be
unique, therefore we can optimize away GROUP BY/DISTINCT altogether.
This optimization has two effects:
* there is no need to create a temporary table to compute the
   GROUP/DISTINCT operation (or the temporary table will be smaller if only GROUP 
   is removed and DISTINCT stays or if DISTINCT is removed and GROUP BY stays)
* this causes the statement in effect to become updatable in Connector/Java
because the result set columns will be direct reference to the primary key of 
the table (instead to the temporary table that it currently references). 

Implemented a check that will optimize away GROUP BY/DISTINCT for queries like 
the above.
Currently it will work only for single non-constant table in the FROM clause.
2006-06-27 17:40:19 +03:00
holyfoot@mysql.com
bb347299b1 Merge mysql.com:/home/hf/work/mysql-4.1.20318
into mysql.com:/home/hf/work/mysql-4.1.clean
2006-06-26 22:17:42 +05:00
holyfoot@mysql.com
5a96a1b090 Merge mysql.com:/home/hf/work/mysql-4.1.10166
into mysql.com:/home/hf/work/mysql-4.1.clean
2006-06-26 21:07:13 +05:00
bar@mysql.com
cfb08851f7 Bug#11228: DESC shows arbitrary column as "PRI"
An UNIQUE KEY consisting of NOT NULL columns
  was displayed as PRIMARY KEY in "DESC t1".
  According to the code, that was intentional
  behaviour for some reasons unknown to me.
  This code was written before bitkeeper time,
  so I cannot check who and why made this.
  After discussing on dev-public, a decision
  was made to remove this code
2006-06-23 13:19:30 +05:00
igor@rurik.mysql.com
8940231491 Fixed bug #20076.
Server crashed in some cases when a query required a MIN/MAX
agrregation for a 'ucs2' field. 
In these cases  the aggregation caused calls of the function
update_tmptable_sum_func that indirectly invoked 
the method Item_sum_hybrid::min_max_update_str_field() 
containing a call to strip_sp for a ucs2 character set.
The latter led directly to the crash as it used my_isspace
undefined for the ucs2 character set.
Actually the call of strip_sp is not needed at all in this
situation and has been removed by the fix.
2006-06-22 15:50:15 -07:00
holyfoot@deer.(none)
36cea7d4fe bug #10166 (Signed byte values cause data to be padded)
The AsBinary function returns VARCHAR data type with binary collation.
It can cause problem for clients that treat that kind of data as
different from BLOB type.
So now AsBinary returns BLOB.
2006-06-22 22:11:27 +05:00
evgen@moonbone.local
6439337bb1 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1
into moonbone.local:/work/tmp_merge-4.1-opt-mysql
2006-06-22 00:29:47 +04:00
evgen@moonbone.local
8d4a910a1f Fixed bug #14896.
This bug in Field_string::cmp resulted in a wrong comparison 
with keys in partial indexes over multi-byte character fields.
Given field a is declared as a varchar(16) collate utf8_unicode_ci
INDEX(a(4)) gives us an example of such an index.
  
Wrong key comparisons could lead to wrong result sets if 
the selected query execution plan used a range scan by 
a partial index over a utf8 character field.
This also caused wrong results in many other cases.
2006-06-22 00:29:04 +04:00
svoj@may.pils.ru
e560564cfa Merge april:devel/BitKeeper/mysql-4.1
into  may.pils.ru:/home/svoj/devel/mysql/BUG20357/mysql-4.1
2006-06-21 17:51:16 +05:00
svoj@may.pils.ru
8b98be2844 BUG#20357 - Got error 124 from storage engine using MIN and MAX
functions in queries

Using MAX()/MIN() on table with disabled indexes (by ALTER TABLE)
results in error 124 (wrong index) from storage engine.

The problem was that optimizer use disabled index to optimize
MAX()/MIN(). Normally it must skip disabled index and perform
table scan.

This patch skips disabled indexes for min/max optimization.
2006-06-21 17:30:59 +05:00
evgen@moonbone.local
ae6970e6bc select.result:
Added test case for bug#18759 Incorrect string to numeric conversion.  
select.test:
  Added test case for bug#18759 Incorrect string to numeric conversion.
item_cmpfunc.cc:
  Cleanup after fix for bug#18360 removal
2006-06-20 23:05:55 +04:00
evgen@moonbone.local
217faf569e Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into moonbone.local:/work/tmp_merge-4.1-opt-mysql
2006-06-20 02:04:36 +04:00
evgen@moonbone.local
609e0dbd99 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1
into moonbone.local:/work/tmp_merge-4.1-opt-mysql
2006-06-20 01:56:33 +04:00
evgen@moonbone.local
279c310b66 item_cmpfunc.cc, func_in.result, func_in.test:
Reverted fix for bug#18360
2006-06-20 00:50:09 +04:00
holyfoot@deer.(none)
d8d42948b2 bug #20318 (ctype_ucs2_def test fails with embedded)
there was two problems about charsets in embedded server
1. mysys/charset.c - defined there default_charset_info variable is
modified by both server and client code (particularly when
--default-charset option is handled)
In embedded server we get two codelines modifying one variable.
I created separate default_client_charset_info for client code

2. mysql->charset and mysql->options.charset initialization isn't
properly done for embedded server - necessary calls added
2006-06-19 22:11:01 +05:00
gkodinov@mysql.com
6777928eec Merge mysql.com:/home/kgeorge/mysql/4.1/teamclean
into  mysql.com:/home/kgeorge/mysql/4.1/B9676
2006-06-19 13:25:28 +03:00
gkodinov@mysql.com
c5ed7a87f4 * Bug #9676: INSERT INTO x SELECT .. FROM x LIMIT 1; slows down with big
tables
Currently in INSERT ... SELECT ... LIMIT ... the compiler uses a 
temporary table to store the results of SELECT ... LIMIT .. and then
uses that table as a source for INSERT. The problem is that in some cases
it actually skips the LIMIT clause in doing that and materializes the 
whole SELECT result set regardless of the LIMIT.
This fix is limiting the process of filling up the temp table with only 
that much rows that will be actually used by propagating the LIMIT value.
2006-06-19 13:22:42 +03:00
svoj@may.pils.ru
737e166403 Merge april:devel/BitKeeper/mysql-4.1
into  may.pils.ru:/home/svoj/devel/mysql/BUG18036/mysql-4.1
2006-06-19 14:13:44 +05:00
svoj@may.pils.ru
37cdb0fbf3 BUG#18036 - update of table joined to self reports table as crashed
Certain updates of table joined to self results in unexpected
behavior.

The problem was that record cache was mistakenly enabled for
self-joined table updates. Normally record cache must be disabled
for such updates.

Fixed wrong condition in code that determines whether to use
record cache for self-joined table updates.

Only MyISAM tables were affected.
2006-06-19 14:05:14 +05:00
evgen@moonbone.local
7f24667598 Manually merged 2006-06-17 02:11:12 +04:00
evgen@moonbone.local
b8b9738e0b item_strfunc.cc:
Fix for bug#16716 for --ps-protocol mode.
item_cmpfunc.cc:
  Fix for a memory allocation/freeing problem in agg_cmp_type() after fix
for bug#16377. Few language corrections.
2006-06-16 23:46:37 +04:00
evgen@moonbone.local
d22c082b87 Merge moonbone.local:/home/evgen/bk-trees/mysql-4.1-opt
into moonbone.local:/work/16377-4.1-after
2006-06-15 16:41:26 +04:00
evgen@moonbone.local
2877b5ef64 item_cmpfunc.h, cast.result:
Post fix for bug#16377
2006-06-15 16:39:18 +04:00
evgen@moonbone.local
b669852866 Merge moonbone.local:/work/15351-bug-4.1-mysql
into moonbone.local:/home/evgen/bk-trees/mysql-4.1-opt
2006-06-15 14:57:53 +04:00
ramil@mysql.com
26fa98a2cb Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b15558
2006-06-15 11:15:56 +05:00
evgen@moonbone.local
c9077f07e7 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into moonbone.local:/home/evgen/bk-trees/mysql-4.1-opt
2006-06-14 22:57:00 +04:00
tomas@poseidon.ndb.mysql.com
ea6ed5ffa7 Merge poseidon.ndb.mysql.com:/home/tomas/mysql-4.1
into  poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-main
2006-06-14 20:22:43 +02:00
tomas@poseidon.ndb.mysql.com
47271c6bb1 Bug #19493 NDB does not ignore duplicate keys when using LOAD DATA LOCAL
- correction of backport error
2006-06-14 20:22:03 +02:00
tomas@poseidon.ndb.mysql.com
220345d3c8 Merge poseidon.ndb.mysql.com:/home/tomas/mysql-4.1
into  poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-main
2006-06-14 20:18:01 +02:00
tomas@poseidon.ndb.mysql.com
2fcf737feb Bug #19493 NDB does not ignore duplicate keys when using LOAD DATA LOCAL
- make sure to disable bulk insert when check for duplicate key is needed
2006-06-14 20:16:32 +02:00
sergefp@mysql.com
6e5f578a46 Better comments in KEY_PART_INFO struct 2006-06-14 21:06:02 +04:00
tomas@poseidon.ndb.mysql.com
6e2be26052 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-main
2006-06-14 13:52:50 +02:00
tomas@poseidon.ndb.mysql.com
418a8e3a24 Merge poseidon.ndb.mysql.com:/home/tomas/mysql-4.1
into  poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-main
2006-06-14 13:51:08 +02:00
tomas@poseidon.ndb.mysql.com
7e2323ed7e Bug #18595 repeated create, insert, drop can cause MySQL table definition cache to
corrupt
  - add infinite retry on drop table temporary error
2006-06-14 12:54:28 +02:00
bar@mysql.com
a481a35237 Bug#8663 cant use bgint unsigned as input to cast
Problem: cast to unsigned limited result to 
max signed bigint 9223372036854775808,
instead of max unsigned bigint 18446744073709551615.

Fix: don't use args[0]->val_int() when casting from
a floating point number, use val() instead, with range checkings,
special to unsigned data type.

item_func.cc:
  Special handling of cast from REAL_RESULT
  to unsigned int: we cannot execute args[0]->val_int()
  because it cuts max allowed value to LONGLONG_INT,
  instead of ULONGLONG_INT required.
count_distinct3.test:
  Getting rid of "Data truncated; out of range ..." warnings.
cast.test, cast.result:
  Adding test case.
ps.result:
  Fixing that cast from 6570515219.6535 
  to unsigned didn't round to 6570515220,
  and returned 6570515219 instead.
2006-06-14 13:40:21 +05:00
evgen@moonbone.local
111dc92786 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into moonbone.local:/home/evgen/bk-trees/mysql-4.1-opt
2006-06-13 22:53:30 +04:00
evgen@moonbone.local
d4942a2635 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into moonbone.local:/work/16377-bug-4.1-opt-mysql
2006-06-13 19:10:27 +04:00
evgen@moonbone.local
67de8c46a5 Fixed bug#16377: result of DATE/TIME functions were compared as strings which
can lead to a wrong result.

All date/time functions has the STRING result type thus their results are
compared as strings. The string date representation allows a user to skip 
some of leading zeros. This can lead to wrong comparison result if a date/time 
function result is compared to such a string constant.

The idea behind this bug fix is to compare results of date/time functions
and data/time constants as ints, because that date/time representation is 
more exact. To achieve this the agg_cmp_type() is changed to take in the
account that a date/time field or an date/time item should be compared 
as ints.

This bug fix is partially back ported from 5.0.

The agg_cmp_type() function now accepts THD as one of parameters. 
In addition, it now checks if a date/time field/function is present in the
list. If so, it tries to coerce all constants to INT to make date/time
comparison return correct result. The field for the constant coercion is
taken from the Item_field or constructed from the Item_func. In latter case
the constructed field will be freed after conversion of all constant items.
Otherwise the result is same as before - aggregated with help of the
item_cmp_type() function.

From the Item_func_between::fix_length_and_dec() function removed the part
which was converting date/time constants to int if possible. Now this is 
done by the agg_cmp_type() function.

The new function result_as_longlong() is added to the Item class. 
It indicates that the item is a date/time item and result of it can be
compared as int. Such items are date/time fields/functions.

Correct val_int() methods are implemented for classes Item_date_typecast, 
Item_func_makedate, Item_time_typecast, Item_datetime_typecast. All these
classes are derived from Item_str_func and Item_str_func::val_int() converts
its string value to int without regard to the date/time type of these items.

Arg_comparator::set_compare_func() and Arg_comparator::set_cmp_func()
functions are changed to substitute result type of an item with the INT_RESULT
if the item is a date/time item and another item is a constant. This is done
to get a correct result of comparisons like date_time_function() = string_constant.
2006-06-13 19:09:24 +04:00
ramil@mysql.com
97562d74c9 Fix for bug #12728: Very strange behaviour of ELT 2006-06-13 16:01:54 +05:00
mskold@mysql.com
049c3e3f69 Merge mskold@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/home/marty/MySQL/mysql-4.1
2006-06-12 15:35:46 +02:00
evgen@moonbone.local
147961bc59 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into moonbone.local:/home/evgen/bk-trees/mysql-4.1-opt
2006-06-12 15:56:21 +04:00
evgen@moonbone.local
e831704a33 Merge moonbone.local:/work/16716-bug-4.1-mysql
into moonbone.local:/work/16716-bug-4.1-opt-mysql
2006-06-12 15:50:59 +04:00
mskold@mysql.com
030f63fdab Moved back comment to correct method 2006-06-12 09:27:04 +02:00
kent@mysql.com
3744b46a1d Merge bk-internal:/home/bk/mysql-4.1
into  mysql.com:/data0/mysqldev/my/mysql-4.1
2006-06-09 22:42:34 +02:00
mskold@mysql.com
597e1444aa Fix for Bug #18184 SELECT ... FOR UPDATE does not work..: implemented ha_ndblcuster::unlock_row() and explicitly lock all rows that are not being unlocked 2006-06-08 16:12:38 +02:00
ramil@mysql.com
fe01874613 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b6880
2006-06-07 14:40:33 +05:00
ramil@mysql.com
0bdae38efb Fix for bug #6880: LAST_INSERT_ID() within a statement 2006-06-07 14:01:10 +05:00
ramil@mysql.com
19e312af08 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b16546
2006-06-06 09:10:28 +05:00
igor@rurik.mysql.com
f1afd17821 Cleanup for the fix of bug 18206. 2006-06-02 19:15:32 -07:00
igor@rurik.mysql.com
d02f254eaa Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  rurik.mysql.com:/home/igor/mysql-4.1-opt
2006-06-02 14:16:22 -07:00
igor@rurik.mysql.com
37e049db01 Fixed bug #18206.
The bug report revealed two problems related to min/max optimization:
1. If the length of a constant key used in a SARGable condition for
for the MIN/MAX fields is greater than the length of the field an 
unwanted warning on key truncation is issued;
2. If MIN/MAX optimization is applied to a partial index, like INDEX(b(4))
than can lead to returning a wrong result set.
2006-06-02 14:14:57 -07:00
gkodinov@mysql.com
b519877c90 Bug #4981: 4.x and 5.x produce non-optimal execution path,
3.23 regression test failure

The member SEL_ARG::min_flag was not initialized, 
due to which the condition for no GEOM_FLAG in function 
key_or did not choose "Range checked for each record" as 
the correct access method.
2006-06-02 12:04:03 +03:00
mskold@mysql.com
39b50ce0d2 Bug #18864 TRUNCATE TABLE doesn't reset AUTO_INCREMENT value on ndb table 2006-06-02 07:26:45 +02:00
holyfoot@deer.(none)
bc35c50063 bug #16017 (memory leaks in embedded server)
There actually was 3 different problems -
hash_user_connections wasn't cleaned
one strdupped database name wasn't freed
and stmt->mem_root wasn't cleaned as it was
replased with mysql->field_alloc for result
For the last one - i made the library using stmt's
fields to store result if it's the case.
2006-06-01 17:06:42 +05:00
evgen@moonbone.local
de8a1b4f19 Merge moonbone.local:/work/18630-bug-4.1-mysql
into moonbone.local:/work/18360-bug-4.1-mysql-opt
2006-05-30 18:57:08 +04:00
mskold@mysql.com
f838e8a499 Merge mskold@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/home/marty/MySQL/mysql-4.1
2006-05-30 13:20:38 +02:00
igor@rurik.mysql.com
6051e0f959 Fixed bug #17873: confusing error message when IGNORE/USE/FORCE INDEX
refers to a column name.
2006-05-30 00:08:58 -07:00
evgen@moonbone.local
641f852de8 Fixed bug#18360: Incorrect type coercion in IN() results in false comparison
The IN() function uses agg_cmp_type() to aggregate all types of its arguments
to find out some common type for comparisons. In this particular case the 
char() and the int was aggregated to double because char() can contain values
like '1.5'. But all strings which do not start from a digit are converted to
0. thus 'a' and 'z' become equal. 
This behaviour is reasonable when all function arguments are constants. But 
when there is a field or an expression this can lead to false comparisons. In
this case it makes more sense to coerce constants to the type of the field
argument.

The agg_cmp_type() function now aggregates types of constant and non-constant
items separately. If some non-constant items will be found then their
aggregated type will be returned. Thus after the aggregation constants will be
coerced to the aggregated type.
2006-05-30 00:36:48 +04:00
evgen@moonbone.local
1f30bf5a33 Fixed bug#19225: unchecked error results in server crash
In multi-table delete a table for delete can't be used for selecting in
subselects. Appropriate error was raised but wasn't checked which leads to a
crash at the execution phase.

The mysql_execute_command() now checks for errors before executing select
for multi-delete.
2006-05-29 00:32:59 +04:00
evgen@moonbone.local
766b4a8c7f Fixed bug#15351: Wrong collation used for comparison of md5() and sha()
argument can lead to a wrong result.

md5() and sha() functions treat their arguments as case sensitive strings.
But when they are compared their arguments were compared as a case
insensitive strings which leads to two functions with different arguments
and thus different results to being identical. This can lead to a wrong
decision made in the range optimizer and thus lead to a wrong result set.

Item_func_md5::fix_length_and_dec() and Item_func_sha::fix_length_and_dec()
functions now set binary collation on their arguments.
2006-05-28 22:01:38 +04:00
igor@rurik.mysql.com
377b3e0306 Fixed bug #17873: confusing error message when IGNORE/USE/FORCE INDEX
refers to a column name.
Added a new error message ER_INDEX_DOES_NOT_EXIST.
2006-05-27 23:57:33 -07:00
kent@mysql.com
f5a443d283 Merge mysql.com:/data0/mysqldev/my/mysql-4.1.20-release
into  mysql.com:/data0/mysqldev/my/mysql-4.1
2006-05-26 18:31:25 +02:00
evgen@moonbone.local
40ea30253f Fixed bug#16716: subselect in concat() may lead to a wrong result.
The Item_func_concat::val_str() function tries to make as less re-allocations
as possible. This results in appending strings returned by 2nd and next
arguments to the string returned by 1st argument if the buffer for the first
argument has enough free space. A constant subselect is evaluated only once 
and its result is stored in an Item_cache_str. In the case when the first
argument of the concat() function is such a subselect Item_cache_str returns
the stored value and Item_func_concat::val_str() append values of other
arguments to it. But for the next row the value in the Item_cache_str isn't
restored because the subselect is a constant one and it isn't evaluated second
time. This results in appending string values of 2nd and next arguments to the 
result of the previous Item_func_concat::val_str() call.

The Item_func_concat::val_str() function now checks whether the first argument 
is a constant one and if so it doesn't append values of 2nd and next arguments
to the string value returned by it.
2006-05-26 01:24:14 +04:00
ramil@mysql.com
bbb991e597 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b16900
2006-05-25 16:05:55 +05:00
serg@mysql.com
44ec4456b8 Merge mysql.com:/data0/mysqldev/my/mysql-4.1.16a-release
into  mysql.com:/data0/mysqldev/my/mysql-4.1.20-release
2006-05-24 14:12:19 +02:00
kent@mysql.com
97674810b0 don't let bugfix for bug#8303 break the bugfix for bug#8378
revert the fix for bug#8303
correct the test for bug#8378
2006-05-24 00:55:53 +02:00
msvensson@neptunus.(none)
cb7958ce1b Merge neptunus.(none):/home/msvensson/mysql/my41-bug13711
into  neptunus.(none):/home/msvensson/mysql/mysql-4.1
2006-05-23 10:34:59 +02:00
msvensson@neptunus.(none)
0144b51445 Add comment for 'kill_server' function 2006-05-23 10:33:53 +02:00
msvensson@neptunus.(none)
e3a75df3ca Merge bk-internal:/home/bk/mysql-4.1
into  neptunus.(none):/home/msvensson/mysql/mysql-4.1
2006-05-19 13:11:49 +02:00
msvensson@neptunus.(none)
d04113db05 Merge neptunus.(none):/home/msvensson/mysql/my41-bug13711
into  neptunus.(none):/home/msvensson/mysql/mysql-4.1
2006-05-19 13:10:52 +02:00
msvensson@neptunus.(none)
b9a59fa014 Bug#15869 Cannot shutdown the server - it restarts
- A segfault occured when the function 'kill_server' called 
   'my_sigset' with signal number 0. 'my_sigset' is a macro which
   uses 'sigaction' to install the signal handler with an invalid
   signal number will on most platforms return EINVAL but yields
   a segfauilt on IRIX 6.5
 - The server crash was detected by mysqld_safe and it was restarted although
   a shutdown was requested. 
 - Semantics of kill_server(0) is not known, leaving it intact
2006-05-19 13:07:24 +02:00
ramil@mysql.com
c583de95f8 Fix for bug #15558: truncate doesn't clear table on archive storage engine tables. 2006-05-18 17:10:58 +05:00
ramil@mysql.com
7319ef4ef1 Fix for #16327: invalid TIMESTAMP values retrieved 2006-05-17 17:00:30 +05:00
tomas@poseidon.ndb.mysql.com
a5686c3138 Merge poseidon.ndb.mysql.com:/home/tomas/mysql-4.1
into  poseidon.ndb.mysql.com:/home/tomas/mysql-4.1-main
2006-05-16 12:32:36 +02:00
aivanov@mysql.com
9326f67dda Merge aivanov@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/home/alexi/innodb/mysql-4.1-ss29
2006-05-15 21:53:28 +04:00
tomas@poseidon.ndb.mysql.com
fe9934c9fe Bug #16875 Using stale MySQLD FRM files can cause restored cluster to fail
- invalidate ndb dict cache on cluster disconnect (ClusterMgr.cpp)
- add check for correct frm on external lock when table cache is found invalid
2006-05-15 16:23:59 +02:00
aivanov@mysql.com
9595317cfa Applied innodb-4.1-ss29 snapshot.
Fix BUG#19542 "InnoDB doesn't increase the Handler_read_prev counter.
2006-05-15 17:25:37 +04:00
aelkin@mysql.com
a0b4c8ed12 Merge mysql.com:/net/nb/home/elkin/MySQL/FIXES/4.1-bug19188_tmp_name
into  mysql.com:/usr_rh9/home/elkin.rh9/MySQL/Merge/4.1
2006-05-12 21:38:41 +03:00
aelkin@mysql.com
0cec36305b Merge mysql.com:/usr_rh9/home/elkin.rh9/MySQL/FIXES/4.1-bug14157-utf8_binlog
into  mysql.com:/usr_rh9/home/elkin.rh9/MySQL/Merge/4.1
2006-05-12 21:33:24 +03:00
aelkin@mysql.com
9b16a7b91a BUG#19188: incorrect temporary table name of DROP query in replication
A pattern to generate binlog for DROPped temp table in close_temporary_tables
  was buggy: could not deal with a grave-accent-in-name table.

  The fix exploits `append_identifier()' for quoting and duplicating accents.
2006-05-12 21:29:06 +03:00
mskold@mysql.com
4efdebeddf Merge mysql.com:/home/marty/MySQL/mysql-4.1_old
into  mysql.com:/home/marty/MySQL/mysql-4.1
2006-05-12 10:21:17 +02:00
tnurnberg@mysql.com
133a5d17f7 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/home/mysql-4.1-10418
2006-05-11 12:48:49 +02:00
ramil@mysql.com
cf0fc729f8 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b18501
2006-05-10 13:27:48 +05:00
aelkin@mysql.com
226d978ae8 BUG#14157: utf8 encoding in binlog without set character_set_client e.g DROP temporary
Binlog lacks encoding info about DROPped temporary table.

Idea of the fix is to switch temporary to system_charset_info when a temporary table
is DROPped for binlog. Since that is the server, that automatically, but not the client, who generates the query
the binlog should be updated on the server's encoding for the coming DROP.
The `write_binlog_with_system_charset()' is introduced to replace similar problematic places in the code.
2006-05-09 23:01:31 +03:00
tnurnberg@mysql.com
21f4e8aadb Bug#10418: LOAD_FILE does not behave like in manual if file does not exist
load_file() string-function should return NULL rather than throw an error if
the file doesn't exist, as per the manual.
2006-05-08 04:37:58 +02:00
igor@rurik.mysql.com
0928ae9bf4 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1
into  rurik.mysql.com:/home/igor/mysql-4.1
2006-05-07 11:25:33 -07:00
aelkin@mysql.com
7dcd1383a8 Merge mysql.com:/usr_rh9/home/elkin.rh9/MySQL/BARE/4.1
into  mysql.com:/usr_rh9/home/elkin.rh9/MySQL/FIXES/4.1-bug19136_unass_user_var
2006-05-07 11:43:27 +03:00
igor@rurik.mysql.com
7977a0c867 Fixed bug #14927.
A query with a group by and having clauses could return a wrong
result set if the having condition contained a constant conjunct 
evaluated to FALSE.
It happened because the pushdown condition for table with
grouping columns lost its constant conjuncts.
Pushdown conditions are always built by the function make_cond_for_table
that ignores constant conjuncts. This is apparently not correct when
constant false conjuncts are present.
2006-05-06 23:48:13 -07:00
sergefp@mysql.com
cef2f703bf Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-4.1
into mysql.com:/home/psergey/mysql-4.1-bug16798
2006-05-06 13:48:20 +04:00
sergefp@mysql.com
1b349cf85f BUG#16798: Inapplicable ref_or_null query plan and bad query result on random occasions
The bug was as follows: When merge_key_fields() encounters "t.key=X OR t.key=Y" it will 
try to join them into ref_or_null access via "t.key=X OR NULL". In order to make this 
inference it checks if Y<=>NULL, ignoring the fact that value of Y may be not yet known.

The fix is that the check if Y<=>NULL is made only if value of Y is known (i.e. it is a
constant).
TODO: When merging to 5.0, replace used_tables() with const_item() everywhere in merge_key_fields().
2006-05-06 13:15:00 +04:00
mskold@mysql.com
9f2ff929fe Bug#16997 Table rename that changes database does not rename indexes, recreate indexes in new database 2006-05-05 17:18:47 +02:00
aelkin@mysql.com
8c57924a6a Bug#19136: Crashing log-bin and uninitialized user variables in a derived table
The reason of the bug is in that `get_var_with_binlog' performs missed
assingment of
the variables as side-effect. Doing that it eventually calls
`free_underlaid_joins' to pass as an argument `thd->lex->select_lex' of the lex
which belongs to the user query, not 
to one which is emulated i.e SET @var1:=NULL.


`get_var_with_binlog' is refined to supply a temporary lex to sql_set_variables's stack.
2006-05-05 11:21:21 +03:00
kroki@mysql.com
d87e132379 Merge mysql.com:/home/tomash/src/mysql_ab/mysql-4.1
into  mysql.com:/home/tomash/src/mysql_ab/mysql-4.1-bug16372
2006-05-05 11:43:55 +04:00
kroki@mysql.com
009cf0b75e Merge mysql.com:/home/tomash/src/mysql_ab/mysql-4.1
into  mysql.com:/home/tomash/src/mysql_ab/mysql-4.1-bug16372
2006-05-05 11:35:49 +04:00
kroki@mysql.com
bc1b9eb04f Merge mysql.com:/home/tomash/src/mysql_ab/mysql-4.1
into  mysql.com:/home/tomash/src/mysql_ab/mysql-4.1-bug16501
2006-05-05 11:35:38 +04:00
jani@ua141d10.elisa.omakaista.fi
06d6b7472b Fixed Bug#11324:
TIME_FORMAT using "%l:%i" returns 36:00 with 24:00:00 in TIME column
2006-05-04 20:19:37 +03:00
jani@ua141d10.elisa.omakaista.fi
526e1a70e2 Fix for Bug#11326. 2006-05-04 19:31:10 +03:00
kroki@mysql.com
98949e7a66 Merge mysql.com:/home/tomash/src/mysql_ab/mysql-4.1
into  mysql.com:/home/tomash/src/mysql_ab/mysql-4.1-bug16372
2006-05-04 18:36:53 +04:00
kroki@mysql.com
1139d37545 Merge mysql.com:/home/tomash/src/mysql_ab/mysql-4.1
into  mysql.com:/home/tomash/src/mysql_ab/mysql-4.1-bug16501
2006-05-04 18:36:00 +04:00
kroki@mysql.com
018d9e17b9 Merge mysql.com:/home/tomash/src/mysql_ab/mysql-4.1
into  mysql.com:/home/tomash/src/mysql_ab/mysql-4.1-bug16372
2006-05-04 17:49:21 +04:00
jani@hundin.mysql.fi
d3467c0b4c Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-4.1
into  hundin.mysql.fi:/home/jani/mysql-4.1
2006-05-04 13:17:16 +03:00
kroki@mysql.com
74fd0beefa Merge mysql.com:/home/tomash/src/mysql_ab/mysql-4.1
into  mysql.com:/home/tomash/src/mysql_ab/mysql-4.1-bug16501
2006-05-04 11:25:48 +04:00
tnurnberg@mysql.com
a5f440f891 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/home/mysql-4.1-19025e
2006-05-04 09:06:27 +02:00
bar@mysql.com
51eec5cf9b Bugs#17647: Trouble with "create database"
Problem:
if a user was granted privileges on database "d1",
it also was able to act on "D1" (i.e. in upper case),
even on Unix with case sensitive file system.

Fix:
Initialize grant hash to use binary comparison
if lower_case_file_system is not set (on most unixes),
and case insensitive comparison otherwise (Windows, MacOSX).
2006-05-04 11:55:09 +05:00
tnurnberg@mysql.com
5becb110e0 Bug#19025 4.1 mysqldump doesn't correctly dump "auto_increment = [int]"
mysqldump / SHOW CREATE TABLE will show the NEXT available value for
the PK, rather than the *first* one that was available (that named in
the original CREATE TABLE ... AUTO_INCREMENT = ... statement).

This should produce correct and robust behaviour for the obvious use
cases -- when no data were inserted, then we'll produce a statement
featuring the same value the original CREATE TABLE had; if we dump
with values, INSERTing the values on the target machine should set the
correct next_ID anyway (and if not, we'll still have our AUTO_INCREMENT =
... to do that). Lastly, just the CREATE statement (with no data) for
a table that saw inserts would still result in a table that new values
could safely be inserted to).

There seems to be no robust way however to see whether the next_ID
field is > 1 because it was set to something else with CREATE TABLE
... AUTO_INCREMENT = ..., or because there is an AUTO_INCREMENT column
in  the table (but no initial value was set with AUTO_INCREMENT = ...)
and then one or more rows were INSERTed, counting up next_ID. This
means that in both cases, we'll generate an AUTO_INCREMENT =
... clause in SHOW CREATE TABLE / mysqldump.  As we also show info on,
say, charsets even if the user did not explicitly give that info in
their own CREATE TABLE, this shouldn't be an issue.

As per above, the next_ID will be affected by any INSERTs that have
taken place, though.  This /should/ result in correct and robust
behaviour, but it may look non-intuitive to some users if they CREATE
TABLE ... AUTO_INCREMENT = 1000 and later (after some INSERTs) have
SHOW CREATE TABLE give them a different value (say, CREATE TABLE
... AUTO_INCREMENT = 1006), so the docs should possibly feature a
caveat to that effect.

It's not very intuitive the way it works now (with the fix), but it's
*correct*.  We're not storing the original value anyway, if we wanted
that, we'd have to change on-disk representation?

If we do dump/load cycles with empty DBs, nothing will change.  This
changeset includes an additional test case that proves that tables
with rows will create the same next_ID for AUTO_INCREMENT = ... across
dump/restore cycles.

Confirmed by support as likely solution for client's problem.
2006-05-04 03:12:51 +02:00
holyfoot@mysql.com
e5a22d1bca Merge bk@192.168.21.1:mysql-4.1
into mysql.com:/home/hf/work/mysql-4.1.mrg
2006-05-04 00:03:58 +05:00
holyfoot@mysql.com
8667344572 Merge hf@192.168.21.28:work/mysql-4.1.16892
into mysql.com:/home/hf/work/mysql-4.1.mrg
2006-05-03 15:53:36 +05:00
holyfoot@mysql.com
0007484c26 Merge mysql.com:/home/hf/work/mysql-4.1.15225
into mysql.com:/home/hf/work/mysql-4.1.mrg
2006-05-03 15:51:19 +05:00
ramil@mysql.com
2d52881789 Fix for bug #16546: DATETIME+0 not always coerced the same way 2006-05-02 18:00:44 +05:00
ramil@mysql.com
b337e83db2 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b7643
2006-05-02 11:33:26 +05:00
jani@hundin.mysql.fi
c4280491e0 Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-4.1
into  hundin.mysql.fi:/home/jani/mysql-4.1
2006-04-30 16:20:26 +03:00
jani@a193-229-222-105.elisa-laajakaista.fi
a7a8143941 Fix for Bug#14515. 2006-04-30 16:01:34 +03:00
elliot@mysql.com
604b5836bb BUG#19145: mysqld crashes if you set the default value of an enum field to NULL
Now test for NULLness the pointers returned from objects created from the
default value. Pushing patch on behalf of cmiller.
2006-04-28 12:15:29 -04:00
gkodinov@lsmy3.wdf.sap.corp
ca79343359 BUG#18492: mysqld reports ER_ILLEGAL_REFERENCE in --ps-protocol
In the code that converts IN predicates to EXISTS predicates it is changing
the select list elements to constant 1. Example :
SELECT ... FROM ...  WHERE a IN (SELECT c FROM ...)
is transformed to :
SELECT ... FROM ... WHERE EXISTS (SELECT 1 FROM ...  HAVING a = c)
However there can be no FROM clause in the IN subquery and it may not be
a simple select : SELECT ... FROM ... WHERE a IN (SELECT f(..) AS
c UNION SELECT ...) This query is transformed to : SELECT ... FROM ...
WHERE EXISTS (SELECT 1 FROM (SELECT f(..) AS c UNION SELECT ...)
x HAVING a = c) In the above query c in the HAVING clause is made to be
an Item_null_helper (a subclass of Item_ref) pointing to the real
Item_field (which is not referenced anywhere else in the query anymore).
This is done because Item_ref_null_helper collects information whether
there are NULL values in the result.  This is OK for directly executed
statements, because the Item_field pointed by the Item_null_helper is
already fixed when the transformation is done.  But when executed as
a prepared statement all the Item instances are "un-fixed" before the
recompilation of the prepared statement. So when the Item_null_helper
gets fixed it discovers that the Item_field it points to is not fixed
and issues an error.  The remedy is to keep the original select list
references when there are no tables in the FROM clause. So the above
becomes : SELECT ... FROM ...  WHERE EXISTS (SELECT c FROM (SELECT f(..)
AS c UNION SELECT ...) x HAVING a = c) In this way c is referenced
directly in the select list as well as by reference in the HAVING
clause. So it gets correctly fixed even with prepared statements.  And
since the Item_null_helper subclass of Item_ref_null_helper is not used
anywhere else it's taken out.
2006-04-28 11:23:31 +02:00
paul@polar.kitebird.com
7162fa4a1a set_var.cc:
System variable was added out of lexical order.
2006-04-27 07:51:56 -05:00