Commit graph

14357 commits

Author SHA1 Message Date
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
igor@rurik.mysql.com
dd839667c7 Post-review changes. 2006-05-03 21:35:27 -07:00
igor@rurik.mysql.com
3dc06cb3fa Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-0
2006-05-03 19:38:37 -07: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
2f7ac18f22 Merge bk@192.168.21.1:mysql-5.0
into mysql.com:/home/hf/work/mysql-5.0.mrg
2006-05-04 02:17:17 +05:00
pekka@mysql.com
ec42119233 Merge pnousiainen@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/space/pekka/ndb/version/my50
2006-05-03 23:17:16 +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
kroki@mysql.com
96f0aa3cfb Bug#15463: EXPLAIN SELECT..INTO hangs the client (QB, command line)
There were two distict bugs: parse error was returned for valid
statement and that error wasn't reported to the client.

The fix ensures that EXPLAIN SELECT..INTO is accepted by parser and any
other parse error will be reported to the client.
2006-05-03 18:02:43 +04:00
holyfoot@deer.(none)
81e625ac4a merging fix 2006-05-03 17:43:32 +05:00
holyfoot@mysql.com
7ee205f67a merging 2006-05-03 16:42:39 +05:00
holyfoot@mysql.com
9de68b8122 merging 2006-05-03 16:33:42 +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
igor@rurik.mysql.com
ae4eb6b50f Fixed bug #14292: performance degradation for a benchmark query.
This performance degradation was due to the fact that some
cost evaluation code added into 4.1 in the function find_best was
not merged into the code of the function best_access_path added
together with other code for greedy optimizer.
Added a parameter to the function print_plan. The parameter contains
accumulated cost for a given partial join.
 
The patch does not include a special test case since this performance
degradation is hard to reproduse with a simple example.

TODO: make the function find_best use the function best_access_path
in order to remove duplication of code which might result in incomplete
merges in the future.
2006-05-02 18:31:20 -07:00
dlenev@mysql.com
c40f8557dc Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/mysql-5.0-bg11081
2006-05-02 17:07:23 +04:00
msvensson@neptunus.(none)
de65bc1eb5 Merge bk-internal:/home/bk/mysql-5.0-maint
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-05-02 09:30:30 +02: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
cmiller@zippy.(none)
1205ae8276 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  zippy.(none):/home/cmiller/work/mysql/mysql-5.0__bug17667
2006-05-01 22:50:36 -04:00
cmiller@zippy.(none)
85ffd9640e SECURITY FIX
Bug#17667: An attacker has the opportunity to bypass query logging.

This adds a new, local-only printf format specifier to our *printf functions
that allows us to print known-size buffers that must not be interpreted as 
NUL-terminated "strings."

It uses this format-specifier to print to the log, thus fixing this 
problem.
2006-05-01 22:10:50 -04:00
jimw@mysql.com
189241b03e Merge mysql.com:/home/jimw/my/mysql-5.0-18607
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2006-05-01 09:12:36 -07:00
cmiller@zippy.(none)
6af3f88f07 Merge zippy.(none):/home/cmiller/work/mysql/merge/tmp_merge
into  zippy.(none):/home/cmiller/work/mysql/merge/mysql-5.0
2006-05-01 09:46:00 -04: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
6e5cf86f4d Merge lsmy3.wdf.sap.corp:/data/users/gkodinov/mysql-4.1-B18492
into  lsmy3.wdf.sap.corp:/data/users/gkodinov/mysql-5.0-B18492
2006-04-28 12:06:54 +02:00
msvensson@shellback.(none)
53b842866e Fix small bug in udf_example.cc, it was processing one char too much and thus returning junk
Add more DBUG_PRINT's in udf_handler::val_str
Enable udf.test
2006-04-28 11:37:20 +02: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
msvensson@neptunus.(none)
cccc2c4b6a Merge bk-internal:/home/bk/mysql-5.0-maint
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-04-28 08:33:42 +02:00
msvensson@shellback.(none)
e5004d1312 Merge shellback.(none):/home/msvensson/mysql/mysql-5.0
into  shellback.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-04-27 17:35:29 +02:00
paul@polar.kitebird.com
46ee4ea0df Merge polar.kitebird.com:/src/extern/MySQL/bk/mysql-4.1
into  polar.kitebird.com:/src/extern/MySQL/bk/mysql-5.0
2006-04-27 07:53:15 -05: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
kroki@mysql.com
9318ac9ae1 Bug#16372: Server crashes when test 'conc_sys' is running
Concurrent read and update of privilege structures (like simultaneous
run of SHOW GRANTS and ADD USER) could result in server crash.

Ensure that proper locking of ACL structures is done.

No test case is provided because this bug can't be reproduced
deterministically.
2006-04-27 14:54:36 +04:00
tomas@poseidon.ndb.mysql.com
a18e5b88f8 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  poseidon.ndb.mysql.com:/home/tomas/mysql-5.0
2006-04-27 08:37:45 +02:00
jimw@mysql.com
f8bfecdf2f Merge bk-internal:/home/bk/mysql-5.0
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2006-04-26 15:29:32 -07:00
tomas@poseidon.ndb.mysql.com
5c31b5d6c5 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  poseidon.ndb.mysql.com:/home/tomas/mysql-5.0
2006-04-26 23:10:36 +02:00
msvensson@neptunus.(none)
31db4898c3 Merge neptunus.(none):/home/msvensson/mysql/bug17208/my50-bug17208
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0-maint
2006-04-26 22:24:25 +02:00
jimw@mysql.com
ca2b14e7b4 Merge mysql.com:/home/jimw/my/mysql-5.0-12792
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2006-04-26 11:39:48 -07:00
evgen@moonbone.local
611d83b5b0 Merge 2006-04-26 22:35:40 +04:00
jimw@mysql.com
74ca82c857 Merge mysql.com:/home/jimw/my/mysql-5.0-16195
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2006-04-26 11:34:45 -07:00
jimw@mysql.com
960c5621eb Bug #17849: sql_big_selects not shown in SHOW VARIABLES output
This patch simply adds sql_big_selects to the list of variables
  output by SHOW VARIABLES.
2006-04-26 09:21:53 -07:00
brian@zim.(none)
11ec75e367 Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.0
into  zim.(none):/home/brian/mysql/mysql-5.0
2006-04-26 09:20:58 -07:00
elliot@mysql.com
d96fbd738d The fix for bug#17248 accidentally removed the sync_binlog variable.
This patch restores sync_binlog.
2006-04-26 11:55:26 -04:00
tomas@poseidon.ndb.mysql.com
edba345e56 Bug #19202 Incorrect errorhandling in select count(*) wrt temporary error
- added retry handling of temporary transaction errors
2006-04-26 16:57:44 +02:00
bell@sanja.is.com.ua
0e331dfb92 fixed error message text 2006-04-26 17:57:41 +03:00
serg@sergbook.mysql.com
ed3f3fa0c7 after merge 2006-04-25 22:39:59 -07:00
serg@sergbook.mysql.com
ab2820e80f Merge sergbook.mysql.com:/usr/home/serg/Abk/mysql-4.1
into sergbook.mysql.com:/usr/home/serg/Abk/mysql-5.0
2006-04-25 21:32:30 -07:00
serg@sergbook.mysql.com
54c97e6150 after merge fix 2006-04-25 17:12:06 -07:00
sergefp@mysql.com
078ec307ae Fix compile failure on Win32 2006-04-26 01:21:33 +04:00
serg@sergbook.mysql.com
c97d923cfd merged 2006-04-25 14:06:04 -07:00
serg@sergbook.mysql.com
3144d5eb48 buffer overflow and information exposure bugs fixed
(reported by Stefano Di Paola)
2006-04-25 13:37:33 -07:00
sergefp@mysql.com
867dffa8a4 Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/psergey/mysql-5.0-bug15827-r2
2006-04-26 00:30:54 +04:00
sergefp@mysql.com
1d4acfb668 BUG#15872: Don't run the range analyzer on "t1.keypart NOT IN (const1, ..., )", as that consumes
too much memory. Instead, either create the equvalent SEL_TREE manually, or create only two ranges that
strictly include the area to scan
(Note: just to re-iterate: increasing NOT_IN_IGNORE_THRESHOLD will make optimization run slower for big 
IN-lists, but the server will not run out of memory. O(N^2) memory use has been eliminated)
2006-04-25 23:33:31 +04:00
evgen@moonbone.local
69b90fb2a8 Merge epotemkin@lsmy3:/data/users/bk/mysql-5.0-opt-bugs
into moonbone.local:/work/18739-bug-5.0-mysql
2006-04-25 17:45:31 +04:00
mskold@mysql.com
051e6ac994 Merge mskold@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/usr/local/home/marty/MySQL/mysql-5.0
2006-04-25 12:46:40 +02:00
mskold@mysql.com
435c1028fc Fixed memleak detected by valgrind 2006-04-25 12:40:31 +02:00
ramil@mysql.com
815da9ccee Fix for bug #7643: ALTER TABLE fails for CSV, EXAMPLE, ARCHIVE engines 2006-04-25 15:27:28 +05:00
ramil@mysql.com
8cdd68a830 Fix for bug #18501: Server crashes with monthname(). 2006-04-25 14:34:19 +05:00
konstantin@mysql.com
f912a26b4a A fix and a test case for Bug#19308 "REPAIR/OPTIMIZE/ANALYZE
supported in SP but not in PS": just enable them in prepared
statements, the supporting functionality was implemented when
they were enabled in stored procedures.
2006-04-25 04:27:23 +04:00
knielsen@mysql.com
854cbe88b6 Merge mysql.com:/usr/local/mysql/mysql-4.1
into  mysql.com:/usr/local/mysql/mysql-5.0-mtr-fix
2006-04-24 23:51:47 +02:00
dlenev@mysql.com
0fd2c5b53e Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mysql.com:/home/dlenev/mysql-5.0-bg11081
2006-04-24 19:00:37 +04:00
dlenev@mysql.com
2033f7ba45 Fix for bug#11081 "Using a CONVERT_TZ function in a stored function or
trigger fails".

In cases when CONVERT_TZ() function was used in trigger or stored function
(or in stored procedure which was called from trigger or stored function)
error about non existing '.' table was reported.

Statements that use CONVERT_TZ() function should have time zone related
tables in their table list. tz_init_table_list() function which is used
to produce part of table list containing those tables didn't set
TABLE_LIST::db_length/table_name_length members properly. As result time
zone tables needed for CONVERT_TZ() function were incorrectly handled by
prelocking algorithm and "Table '.' doesn't exist' error was emitted.
This fix changes tz_init_table_list() in such way that it properly inits
TABLE_LIST::table_name_length/db_length members and thus produces table list
which can be handled by prelocking algorithm correctly.
2006-04-24 18:57:00 +04:00
kroki@mysql.com
c77336c260 Bug#16501: IS_USED_LOCK does not appear to work
Update User_level_lock::thread_id on acquiring an existing lock,
and reset it on lock release.
2006-04-24 18:06:43 +04:00
evgen@moonbone.local
1a6dc770e3 Manually merged 2006-04-24 17:52:15 +04:00
ramil@production.mysql.com
f7394c26f5 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  production.mysql.com:/usersnfs/rkalimullin/4.1.b17896
2006-04-24 08:01:10 +02:00
aelkin@mysql.com
a8368fde52 Merge mysql.com:/net/nb/home/elkin/MySQL/FIXES/5.0-bug17263-temp_drop
into  mysql.com:/usr_rh9/home/elkin.rh9/MySQL/Merge/5.0
2006-04-23 20:06:30 +03:00
aelkin@mysql.com
b56d36dd30 Bug#17263 temporary tables and replication
The fix refines the algorithm of generating DROPs for binlog. 
Temp tables with common pseudo_thread_id are clustered into one query. 
Consequently one replication event per pseudo_thread_id is generated.
2006-04-23 19:59:43 +03:00
aelkin@mysql.com
19f134e40b Bug#17263: incorrect DROP query in temporary tables replication
accounting non-ai32 in tmpkeyval. This changeset is supposed to be specifically for 4.1.
Another changeset is going to push into 5.
2006-04-23 19:42:26 +03:00
brian@zim.(none)
2e97a80d19 Merge baker@bk-internal.mysql.com:/home/bk/mysql-5.0
into  zim.(none):/home/brian/mysql/mysql-5.0
2006-04-23 08:44:54 -07:00
aelkin@mysql.com
28fe756a3d manual merge use local 2006-04-23 12:32:41 +03:00
aelkin@mysql.com
b2b725dba0 Merge mysql.com:/usr_rh9/home/elkin.rh9/MySQL/BARE/4.1
into  mysql.com:/usr_rh9/home/elkin.rh9/MySQL/Merge/5.0
2006-04-23 12:32:40 +03:00
aelkin@mysql.com
c5219d0d67 Merge mysql.com:/usr_rh9/home/elkin.rh9/MySQL/BARE/4.1
into  mysql.com:/usr_rh9/home/elkin.rh9/MySQL/Merge/5.0
2006-04-23 12:32:39 +03:00
konstantin@mysql.com
8301e6f625 Merge mysql.com:/opt/local/work/mysql-5.0-root
into  mysql.com:/opt/local/work/mysql-5.0-runtime-merge
2006-04-23 13:32:38 +04:00
aelkin@mysql.com
a4ff312037 Bug#17263 temporary tables and replication
Backporting a changeset made for 5.0. Comments from there:

  The fix refines the algorithm of generating DROPs for binlog.
  Temp tables with common pseudo_thread_id are clustered into one query.
  Consequently one replication event per pseudo_thread_id is generated.
2006-04-23 12:18:57 +03:00
dlenev@mysql.com
5e7076ce95 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mysql.com:/home/dlenev/mysql-5.0-bg15153-2
2006-04-22 11:56:15 +04:00
dlenev@mysql.com
c77d5a0ed1 Fix for bug#15153 "CONVERT_TZ() is not allowed in all places in VIEWs".
Error was emitted when one tried to select information from view which used
merge algorithm and which also had CONVERT_TZ() function in its select list.

This bug was caused by wrong assumption that global table list for view
which is handled using merge algorithm begins from tables belonging to
the main select of this view. Nowadays the above assumption is not true only
when one uses convert_tz() function in view's select list, but in future
other cases may be added (for example we may support merging of views
with subqueries in select list one day). Relying on this false assumption
led to the usage of wrong table list for field lookups and therefor errors. 

With this fix we explicitly use pointer to the beginning of main select's
table list.
2006-04-22 11:54:25 +04:00
jimw@mysql.com
99b2d44c9c Bug #18607: LOAD DATA FROM MASTER fails because of INFORMATION_SCHEMA database
Simply exclude INFORMATION_SCHEMA from LOAD DATA FROM MASTER just like
  we exclude the `mysql` database.

  There's no test for this, because it requires an unfiltered 'LOAD DATA
  FROM MASTER' which is too likely to cause chaos (such as when running
  the test suite against an external server).
2006-04-21 18:26:39 -07:00
igor@rurik.mysql.com
510ab81362 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-4.1
into  rurik.mysql.com:/home/igor/mysql-4.1
2006-04-21 08:22:03 -07:00
igor@rurik.mysql.com
639e875032 Post merge fixes 2006-04-21 08:19:38 -07:00
kroki@mysql.com
4bd62e5848 Merge mysql.com:/home/tomash/src/mysql_ab/mysql-5.0
into  mysql.com:/home/tomash/src/mysql_ab/mysql-5.0-bug6951
2006-04-21 19:02:05 +04:00
kroki@mysql.com
b0c1e49a11 Bug#15728: LAST_INSERT_ID function inside a stored function returns 0
Do not reset value of LAST_INSERT_ID() in sub-statement.
2006-04-21 18:55:04 +04:00
pem@mysql.com
8532fa29f4 Post-push fix for BUG#18344: DROP DATABASE does not drop associated routines
Fixed windows compile error in sql/sp.cc (missing cast to byte*)
2006-04-21 14:30:44 +02:00
ramil@production.mysql.com
aed861fd86 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  production.mysql.com:/usersnfs/rkalimullin/4.1.b18643
2006-04-21 13:56:40 +02:00
pem@mysql.com
8c5ae25ff5 Merge mysql.com:/extern/mysql/bk/mysql-5.0-runtime
into  mysql.com:/extern/mysql/5.0/bug18344/mysql-5.0-runtime
2006-04-21 10:22:06 +02:00
igor@rurik.mysql.com
37ac782206 Merge rurik.mysql.com:/home/igor/dev/mysql-4.1-0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-0
2006-04-21 00:36:20 -07:00
ramil@mysql.com
b9fc8e1f69 Bug #17896: MIN of CASE WHEN returns non-minimum value!
- after review fixes
2006-04-21 11:48:00 +05:00
igor@rurik.mysql.com
fd3e924164 Merge rurik.mysql.com:/home/igor/mysql-4.1
into  rurik.mysql.com:/home/igor/dev/mysql-4.1-0
2006-04-20 22:34:37 -07:00
igor@rurik.mysql.com
fc7514151f Fixed bug #18767.
The bug caused wrong result sets for union constructs of the form
(SELECT ... ORDER BY order_list1 [LIMIT n]) ORDER BY order_list2.
For such queries order lists were concatenated and limit clause was
completely neglected.
2006-04-20 22:15:38 -07:00
jimw@mysql.com
ec00b92f48 Bug #12792: @@system_time_zone is not SELECTable
Bug #15684: @@version_* are not all SELECTable

  Added the appropriate information as read-only system variables, and
  also removed some special-case handling of @@version along the way.

  @@version_bdb was added, but isn't included in the test because it
  depends on the presence of BDB.
2006-04-20 21:56:53 -07:00
jimw@mysql.com
4d392fb9f4 Bug #16195: SHOW VARIABLES doesn't report correctly sql_warnings and sql_notes values
SQL_WARNINGS and SQL_NOTES were being displayed with SHOW_BOOL, but they
  are system variables that need SHOW_SYS to be used.
2006-04-20 20:41:12 -07:00
brian@zim.(none)
f48b10f340 Dean noticed that constant flush calls caused the archive stream file to flush empty buffers. This patch removes that behavior. 2006-04-20 18:23:04 -07:00
evgen@moonbone.local
663fee9c05 Fixed bug#18739: non-standard HAVING extension was allowed in strict ANSI sql mode.
The SQL standard doesn't allow to use in HAVING clause fields that are not 
present in GROUP BY clause and not under any aggregate function in the HAVING
clause. However, mysql allows using such fields. This extension assume that 
the non-grouping fields will have the same group-wise values. Otherwise, the 
result will be unpredictable. This extension allowed in strict 
MODE_ONLY_FULL_GROUP_BY sql mode results in misunderstanding of HAVING 
capabilities.

The new error message ER_NON_GROUPING_FIELD_USED message is added. It says
"non-grouping field '%-.64s' is used in %-.64s clause". This message is
supposed to be used for reporting errors when some field is not found in the
GROUP BY clause but have to be present there. Use cases for this message are 
this bug and when a field is present in a SELECT item list not under any 
aggregate function and there is GROUP BY clause present which doesn't mention 
that field. It renders the ER_WRONG_FIELD_WITH_GROUP error message obsolete as
being more descriptive.
The resolve_ref_in_select_and_group() function now reports the 
ER_NON_GROUPING_FIELD_FOUND error if the strict mode is set and the field for 
HAVING clause is found in the SELECT item list only.
2006-04-21 01:52:59 +04:00
tnurnberg@mysql.com
d91e49d5d8 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  mysql.com:/home/mysql-5.0-maint
2006-04-20 16:17:36 +02:00
pem@mysql.com
2dc3026c08 Merge mysql.com:/extern/mysql/bk/mysql-5.0-runtime
into  mysql.com:/extern/mysql/5.0/bug18949/mysql-5.0-runtime
2006-04-20 16:00:33 +02:00
igor@rurik.mysql.com
692da27388 Post merge fix 2006-04-20 00:42:12 -07:00
igor@rurik.mysql.com
7b0373a557 Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-0
2006-04-19 18:27:18 -07:00
igor@rurik.mysql.com
27cc6f4bc3 Merge rurik.mysql.com:/home/igor/dev/mysql-4.1-2
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-0
2006-04-19 18:08:15 -07:00
tnurnberg@mysql.com
cd5af2ba70 Bug#18964 "return 0 instead of DBUG_RETURN(0) in sql_base.cc::open_table()"
fixlet corrects return to DBUG_RETURN to restore the balance.
2006-04-20 01:02:33 +02:00
tnurnberg@mysql.com
f08eb57b26 debugging a BK issue 2006-04-20 00:55:30 +02:00
jimw@mysql.com
b57eb9e17c Merge mysql.com:/home/jimw/my/mysql-5.0-17043
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2006-04-19 14:18:35 -07:00
tnurnberg@mysql.com
d42d01b9ea Bug#18964 "return 0 instead of DBUG_RETURN(0) in sql_base.cc::open_table()"
fixlet corrects return to DBUG_RETURN to restore the balance.
2006-04-19 22:56:48 +02:00
svoj@april.(none)
806cd41529 Bug#18544 - LOCK TABLES timeout causes MyISAM table corruption
After a locking error the open table(s) were not fully
cleaned up for reuse. But they were put into the open table
cache even before the lock was tried. The next statement
reused the table(s) with a wrong lock type set up. This
tricked MyISAM into believing that it don't need to update
the table statistics. Hence CHECK TABLE reported a mismatch
of record count and table size.

Fortunately nothing worse has been detected yet. The effect
of the test case was that the insert worked on a read locked
table. (!)

I added a new function that clears the lock type from all
tables that were prepared for a lock. I call this function
when a lock failes.

No test case. One test would add 50 seconds to the
test suite. Another test requires file mode modifications.
I added a test script to the bug report. It contains three
cases for failing locks. All could reproduce a table
corruption. All are fixed by this patch.

This bug was not lock timeout specific.
2006-04-19 22:54:25 +05:00
dlenev@mysql.com
19e558a09d Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mysql.com:/home/dlenev/mysql-5.0-bg16021
2006-04-19 19:35:32 +04:00
kroki@mysql.com
c51fb60b0b Bug#6951: Triggers/Traditional: SET @ result wrong
While executing a trigger, we have to set thd->abort_on_warning to the value
it had at trigger creation time.
2006-04-19 14:27:59 +04:00
msvensson@neptunus.(none)
210af244b2 Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/bug18564/my50-bug18564
2006-04-18 17:07:35 +02:00
pem@mysql.com
9eb230f9bd Fixed BUG#18344: DROP DATABASE does not drop associated routines
We must use the db key length in sp_drop_db_routines (and not the
  number of characters), or long db names will be truncated in the key.
2006-04-18 16:01:01 +02:00
pem@mysql.com
868ffcca86 Merge mysql.com:/extern/mysql/bk/mysql-5.0-runtime
into  mysql.com:/extern/mysql/5.0/bug18787/mysql-5.0-runtime
2006-04-18 11:20:18 +02:00
pem@mysql.com
504bbe4917 Post-review fix for BUG#18787. Renamed a local variable in
Item_func_sp::tmp_table_field() to something more descriptive.
2006-04-18 11:16:39 +02:00
pem@mysql.com
a6fbde9db7 Fixed BUG#18949: Test case sp-goto is disabled
Removed sp-goto.test, sp-goto.result and all (disabled) GOTO code.
  Also removed some related code that's not needed any more (no possible
  unresolved label references any more, so no need to check for them).
  NB: Keeping the ER_SP_GOTO_IN_HNDLR in errmsg.txt; it might become useful
      in the future, and removing it (and thus re-enumerating error codes)
      might upset things. (Anything referring to explicit error codes.)
2006-04-18 11:07:34 +02:00
msvensson@neptunus.(none)
030de4f912 Merge 192.168.0.20:mysql/bug13310/my50-bug13310
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0
2006-04-18 10:55:57 +02:00
msvensson@shellback.(none)
13062cbad6 BUG#13310 incorrect user parsing by SP
- Strip surrounding ''s from username when a new user connects. There
   is no user 'a@', it should be a@
2006-04-18 10:46:17 +02:00
bar@mysql.com
a9e3092102 item_timefunc.cc:
5.0 additional fix for b#18691
  Handle DECIMAL the same with INT and REAL.
2006-04-17 15:36:25 +05:00
bar@mysql.com
3fef2ba6aa Merge mysql.com:/usr/home/bar/mysql-4.1.b18691
into  mysql.com:/usr/home/bar/mysql-5.0
2006-04-17 15:01:55 +05:00
svoj@april.(none)
8a7adb196d Merge april.(none):/home/svoj/devel/mysql/BUG17917/mysql-4.1
into  april.(none):/home/svoj/devel/mysql/BUG17917/mysql-5.0
2006-04-15 16:08:03 +05:00
evgen@moonbone.local
bc1f457194 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1
into moonbone.local:/work/14169-bug-4.1-mysql
2006-04-14 17:25:58 +04:00
bar@mysql.com
941e529c59 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/bar/mysql-4.1.b18691
2006-04-14 13:30:47 +05:00
bell@sanja.is.com.ua
5c7955bd54 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-5.0
2006-04-14 02:02:28 +03:00
konstantin@mysql.com
b5863b3987 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/opt/local/work/mysql-5.0-runtime-merge
2006-04-14 02:38:41 +04:00
bell@sanja.is.com.ua
8136b25811 Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-5.0
2006-04-14 00:17:50 +03:00
bell@sanja.is.com.ua
efb8b990e4 The check for recursive view definitions added. (BUG#14308) 2006-04-13 23:12:26 +03:00
konstantin@mysql.com
6f51b4199f Merge mysql.com:/opt/local/work/mysql-5.0-root
into  mysql.com:/opt/local/work/mysql-5.0-runtime-merge
2006-04-14 00:07:04 +04:00
aelkin@dl145j.mysql.com
b6992dd4c5 Merge aelkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  dl145j.mysql.com:/tmp/andrei/5.0-bug18715_drop_view_slave
2006-04-13 20:55:51 +02:00
bell@sanja.is.com.ua
014914cbcf Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-5.0
2006-04-13 16:01:08 +03:00
bell@sanja.is.com.ua
cb81389aef Merge sanja.is.com.ua:/home/bell/mysql/bk/mysql-4.1
into  sanja.is.com.ua:/home/bell/mysql/bk/work-5.0
2006-04-13 15:07:50 +03:00
grog@mysql.com
da6210ee61 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/MySQL/5.0-Bug-17248a
2006-04-13 21:37:49 +09:30
sergefp@mysql.com
34b2ed5f7f Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/psergey/mysql-5.0-csc9139
2006-04-13 16:07:48 +04:00
sergefp@mysql.com
1d3a0c0ec8 BUG#19021, Crash in ROR-index_merge optimizer:
get_best_covering_ror_intersect() was copying ror_scans starting from the 
end of the array and not from its beginning.
2006-04-13 16:05:32 +04:00
ramil@mysql.com
2398882097 Fix for bug #18643: crazy UNCOMPRESS(). 2006-04-13 16:19:21 +05:00
konstantin@mysql.com
b915f054cf Fix a typo in the help message. 2006-04-13 14:06:46 +04:00
grog@mysql.com[grog]
3eb783813f foo2 2006-04-13 17:22:56 +09:30
grog@mysql.com[grog]
b2cd3a963a foo1 2006-04-13 17:20:33 +09:30
bar@mysql.com
45293fc346 Bug#18691: Converting number to UNICODE string returns invalid result.
Conversion from int and real numbers to UCS2 didn't work fine: 
CONVERT(100, CHAR(50) UNICODE)
CONVERT(103.9, CHAR(50) UNICODE)

The problem appeared because numbers have binary charset, so,
simple charset recast binary->ucs2 was performed
instead of real conversion.

Fixed to make numbers pretend to be non-binary.
2006-04-13 10:55:48 +05:00
igor@rurik.mysql.com
316eeff690 Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-0
2006-04-12 16:14:20 -07:00
konstantin@mysql.com
c49e6f8869 Post-merge fixes. Add a new error message for max_prepared_stmt_count
limit.
2006-04-13 01:46:44 +04:00
evgen@moonbone.local
ac54aa2aee Fixed bug#14169: type of group_concat() result changed to blob if tmp_table was
used

In a simple queries a result of the GROUP_CONCAT() function was always of 
varchar type.
But if length of GROUP_CONCAT() result is greater than 512 chars and temporary
table is used during select then the result is converted to blob, due to
policy to not to store fields longer than 512 chars in tmp table as varchar
fields.

In order to provide consistent behaviour, result of GROUP_CONCAT() now
will always be converted to blob if it is longer than 512 chars.
Item_func_group_concat::field_type() is modified accordingly.
2006-04-12 23:05:38 +04:00
holyfoot@deer.(none)
c2acfc5b7c bug #15860 (SPATIAL keys in INNODB) 2006-04-12 22:05:23 +05:00
kroki@mysql.com
c8e22ff70b Bug#16461: connection_id() does not work properly inside trigger
CONNECTION_ID() was implemented as a constant Item, i.e. an instance of
Item_static_int_func class holding value computed at creation time.
Since Items are created on parsing, and trigger statements are parsed
on table open, the first connection to open a particular table would
effectively set its own CONNECTION_ID() inside trigger statements for
that table.

Re-implement CONNECTION_ID() as a class derived from Item_int_func, and
compute connection_id on every call to fix_fields().
2006-04-12 19:31:00 +04:00
konstantin@mysql.com
75792fc0dc Merge mysql.com:/opt/local/work/mysql-4.1-16365
into  mysql.com:/opt/local/work/mysql-5.0-merge
2006-04-12 18:30:54 +04:00
msvensson@neptunus.(none)
9cdd78078e Bug#18564 Test failure due to test not checking preconditions
- Add variable "have_dynamic_loading" and use it to check if the udf test should be run.
2006-04-12 15:13:16 +02:00
msvensson@neptunus.(none)
e5712d8413 Merge neptunus.(none):/home/msvensson/mysql/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/bug17208/my50-bug17208
2006-04-12 12:52:34 +02:00
aelkin@mysql.com
a219eb292e #BUG18715 create view with replicate*ignore-table
Fixed in parser. rpl_view gained no changes but rpl_view-slave.opt.
2006-04-12 12:50:12 +03:00
igor@rurik.mysql.com
abc16b5b00 Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-0
2006-04-11 11:46:28 -07:00
ramil@mysql.com
62b85c1388 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/usr/home/ram/work/5.0.b14360
2006-04-11 23:46:27 +05:00
aivanov@mysql.com
cb011af0b0 Merge aivanov@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/alexi/bugs/mysql-5.0-merge
2006-04-11 22:46:26 +04:00
igor@rurik.mysql.com
dfd8f0211c Fixed bug #18618.
If the second or the third argument of a BETWEEN predicate was
a constant expression, like '2005.09.01' - INTERVAL 6 MONTH,
while the other two arguments were fields then the predicate 
was evaluated incorrectly and the query returned a wrong
result set.
The bug was introduced in 5.0.17 when in the fix for 12612.
2006-04-11 10:03:37 -07:00
ingo@mysql.com
750af5a848 Merge mysql.com:/home/mydev/mysql-4.0
into  mysql.com:/home/mydev/mysql-4.0-bug5390
2006-04-11 18:55:24 +02:00
ingo@mysql.com
2ef6034165 Merge mysql.com:/home/mydev/mysql-4.1
into  mysql.com:/home/mydev/mysql-4.1-bug5390
2006-04-11 15:18:16 +02:00
ramil@mysql.com
094c4290ca Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/usr/home/ram/work/5.0.b14360
2006-04-11 18:14:34 +05:00
ramil@mysql.com
1e29244200 Fix for bug #14360: Date Between Interval Broken. 2006-04-11 16:13:57 +05:00
ingo@mysql.com
fff2bc4d46 Merge mysql.com:/home/mydev/mysql-5.0
into  mysql.com:/home/mydev/mysql-5.0-bug5390
2006-04-11 12:41:26 +02:00
pem@mysql.com
57107fc975 Fixed BUG#18787: Server crashed when calling a stored procedure containing
a misnamed function
  ... in the presence of a continue handler. The problem was that with a
  handler, it continued to execute as if function existed and had set a
  useful return value (which it hadn't).
  The fix is to set a null return value and do an error return when a function
  wasn't found.
2006-04-11 12:17:57 +02:00
ramil@mysql.com
a2cd8beb96 Merge mysql.com:/usr/home/ram/work/mysql-4.0
into  mysql.com:/usr/home/ram/work/mysql-4.1
2006-04-11 13:53:44 +05:00
msvensson@neptunus.(none)
abf41982f8 Add surrounding braces, move invalidate dictionary_cace to after declaration of variable "table_list" 2006-04-11 09:46:03 +02:00
msvensson@neptunus.(none)
875154606e Merge bk-internal:/home/bk/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0
2006-04-11 09:09:21 +02:00
ingo@mysql.com
22431de4e0 Merge mysql.com:/home/mydev/mysql-5.0
into  mysql.com:/home/mydev/mysql-5.0-bug5390
2006-04-11 08:46:48 +02:00
ramil@mysql.com
4791ce7942 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.0
into  mysql.com:/usr/home/ram/work/mysql-4.0
2006-04-11 10:46:21 +05:00
jimw@mysql.com
0647a26ade Merge bk-internal:/home/bk/mysql-5.0
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2006-04-10 16:17:46 -07:00
jimw@mysql.com
a159a55c2c Merge bk-internal:/home/bk/mysql-5.0
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2006-04-10 14:30:00 -07:00
igor@rurik.mysql.com
406b29b6e0 Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-0
2006-04-10 13:04:25 -07:00
jimw@mysql.com
fec9005e87 Merge mysql.com:/home/jimw/my/mysql-5.0-13601
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2006-04-10 11:23:30 -07:00
ingo@mysql.com
1c0f675377 Merge mysql.com:/home/mydev/mysql-5.0
into  mysql.com:/home/mydev/mysql-5.0-bug5390
2006-04-10 17:58:21 +02:00
aivanov@mysql.com
bb94bb30d0 Fixed BUG#15868: InnoDB hangs under 200 threads making INSERTs: 'thread thrashing'.
Applied changes due Heikki Tuuri.
2006-04-10 19:47:41 +04:00
aivanov@mysql.com
61c7e4bac5 Merge aivanov@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/alexi/bugs/mysql-5.0-15758
2006-04-09 20:14:29 +04:00
lars@mysql.com
ab71e2ac99 Merge mysql.com:/users/lthalmann/bk/mysql-5.0-release-bug18116
into  mysql.com:/users/lthalmann/bk/mysql-5.0
2006-04-09 10:40:52 +02:00
igor@rurik.mysql.com
17141582d4 Fixed bug #16069.
The function agg_cmp_type in item_cmpfunc.cc neglected the fact that 
the first argument in a BETWEEN/IN predicate could be a field of a view.
As a result in the case when the retrieved table was hidden by a view 
over it and the arguments in the BETWEEN/IN predicates are of 
the date/time type the function did not perform conversion of 
the constant arguments to the same format as the first field argument.
If formats of the arguments differed it caused wrong a evaluation of
the predicates.
2006-04-08 11:42:09 -07:00
aelkin@dl145j.mysql.com
61377e953d Merge aelkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  dl145j.mysql.com:/tmp/5.0.21-bug17284-temp_table
2006-04-07 22:42:55 +02:00
aivanov@mysql.com
612266ec90 Fixed BUG#15758: "Holding adaptive search latch in
innobase_query_caching_of_table_permitted()".
 Applied the patch due to Heikki Tuuri.
 Also removed superfluous #ifdefs.
2006-04-07 23:58:17 +04:00
konstantin@mysql.com
a81ea4a830 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/opt/local/work/mysql-4.1-16365
2006-04-07 23:50:45 +04:00
konstantin@mysql.com
518993312c A fix and a test case for Bug#16365 "Prepared Statements: DoS with
too many open statements". The patch adds a new global variable
@@max_prepared_stmt_count. This variable limits the total number
of prepared statements in the server. The default value of
@@max_prepared_stmt_count is 16382. 16382 small statements
(a select against 3 tables with GROUP, ORDER and LIMIT) consume 
100MB of RAM. Once this limit has been reached, the server will 
refuse to prepare a new statement and return ER_UNKNOWN_ERROR 
(unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup
and can accept any value from 0 to 1 million. In case
the new value of the limit is less than the current
statement count, no new statements can be added, while the old
still can be used. Additionally, the current count of prepared 
statements is now available through a global read-only variable 
@@prepared_stmt_count.
2006-04-07 23:37:06 +04:00
konstantin@mysql.com
15b591561f A fix and a test case for Bug#16248 "WHERE (col1,col2) IN ((?,?))
gives wrong results". Implement previously missing 
Item_row::cleanup. The bug is not repeatable in 5.0, probably 
due to a coincidence: the problem is present in 5.0 as well.
2006-04-07 22:26:25 +04:00
aelkin@mysql.com
bfbd922eb8 Merge aelkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/usr_rh9/home/elkin.rh9/MySQL/FIXES/5.0.21-bug17284-temp_table
2006-04-07 21:21:23 +03:00
aelkin@mysql.com
d881fb36b9 Bug#17284 erroneous temp table cleanup on slave.
Idea of the fix is for master to send FD event with `created' as 0
     to reconnecting slave (upon slave_net_timeout, no master crash) to avoid destroying temp tables.
     In a case of a connect by slave to the master after its crash temp tables have been already
     cleaned up so that slave can not keep `orphan' temp tables.
2006-04-07 20:44:37 +03:00
igor@rurik.mysql.com
f053b7c9d0 Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0
into  rurik.mysql.com:/home/igor/mysql-5.0
2006-04-07 10:19:09 -07:00
pem@mysql.com
739ee02cf6 Merge mysql.com:/extern/mysql/bk/mysql-5.0-runtime
into  mysql.com:/extern/mysql/5.0/generic/mysql-5.0-runtime
2006-04-07 16:55:49 +02:00
pem@mysql.com
bf548fb916 Renaming sp_pcontext members and methods; less cryptic and more consistent.
Also added comments, and fixing some coding style (mostly in comments too).
There are no functional changes, so no tests or documentation needed.
(This was originally part of a bugfix, but it was decided to not include this
 in that patch; instead it's done separately.)
2006-04-07 16:53:15 +02:00
kroki@mysql.com
6222ca41a5 Bug#15933: max_used_connections is wrong after FLUSH STATUS if connections are cached
After FLUSH STATUS max_used_connections was reset to 0, and haven't
been updated while cached threads were reused, until the moment a new
thread was created.

The first suggested fix from original bug report was implemented:

  a) On flushing the status, set max_used_connections to
  threads_connected, not to 0.

  b) Check if it is necessary to increment max_used_connections when
  taking a thread from the cache as well as when creating new threads
2006-04-07 15:30:40 +04:00
msvensson@neptunus.(none)
c2f1259834 Merge neptunus.(none):/home/msvensson/mysql/bug13228/my50-bug13228_minimal
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0
2006-04-07 11:46:22 +02:00
hartmut@mysql.com
7ed2c6207a fix for wrong QUARTER calculation in EXTRACT() (Bug #18100) 2006-04-07 11:15:15 +02:00
msvensson@neptunus.(none)
a7f1936552 Merge bk-internal:/home/bk/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0
2006-04-07 11:04:46 +02: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
igor@rurik.mysql.com
9bd0b97824 Fixed bug #15917: unexpected complain for a NIST test case.
The problem was due to the fact that with --lower-case-table-names set to 1 
the function find_field_in_group did not convert the prefix 'HU' in
HU.PROJ.CITY into lower case when looking for it in the group list. Yet the
names in the group list were extended by the database name in lower case.
2006-04-06 15:29:15 -07:00
sergefp@mysql.com
f962fa5b91 Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/psergey/mysql-5.0-bug18237-review
2006-04-06 21:42:33 +04:00
sergefp@mysql.com
be0ebd9e0a Remove redundant code in opt_sum_query() 2006-04-06 21:42:03 +04:00
svoj@april.(none)
85ff7bec70 Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.0
into  april.(none):/home/svoj/devel/mysql/BUG14945/mysql-5.0
2006-04-06 15:25:39 +05:00
svoj@april.(none)
209682e051 Fix for bug#14945 "Truncate table doesn't reset the auto_increment
counter".

When TRUNCATE TABLE was called within an stored procedure the
auto_increment counter was not reset to 0 even if straight
TRUNCATE for this table did this.

This fix makes TRUNCATE in stored procedures to be handled exactly
in the same way as straight TRUNCATE. We achieve this by rolling
back the fix for bug 8850, which is no longer needed since stored
procedures don't require prelocked mode anymore (and TRUNCATE is
not allowed in stored functions or triggers).
2006-04-06 15:19:01 +05:00
igor@rurik.mysql.com
e732d0536f Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-0
2006-04-05 14:06:34 -07:00
ingo@mysql.com
c864ac15a5 BUG#5390 - problems with merge tables
Additional fix for INSERT DELAYED with subselect.
Originally detected in 5.1, but 5.0 could also be affected.
The user thread creates a dummy table object,
which is not included in the lock. The 'real' table is
opened and locked by the 'delayed' system thread.
The dummy object is now marked as not locked and this is
tested in mysql_lock_have_duplicate().
2006-04-05 14:39:20 +02:00
ingo@mysql.com
ac52c977aa Merge mysql.com:/home/mydev/mysql-5.0
into  mysql.com:/home/mydev/mysql-5.0-bug5390
2006-04-05 11:38:16 +02:00
evgen@sunlight.local
d07240599d Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0
into sunlight.local:/local_work/16281-bug-5.0-mysql
2006-04-05 13:30:51 +04:00
evgen@sunlight.local
b9949ed9c7 Fixed bug #16281: Multi-table update broken in 5.0 on tables imported from 4.1
Mutli-table uses temporary table to store new values for fields. With the
new values the rowid of the record to be updated is stored in a Field_string
field. Table to be updated is set as source table of the rowid field.
But when the temporary table creates the tmp field for the rowid field it
converts it to a varstring field because the table to be updated was created by
the v4.1. Due to this the stored rowids were broken and no records for 
update were found.

The flag can_alter_field_type is added to Field_string class. When it is set to
0 the field won't be converted to varstring. The Field_string::type() function 
now always returns MYSQL_TYPE_STRING if can_alter_field_type is set to 0.
The multi_update::initialize_tables() function now sets can_alter_field_type
flag to 0 for the rowid fields denying conversion of the field to a varstring
field.
2006-04-05 13:29:04 +04:00
msvensson@neptunus.(none)
f1a2c7b14f use "unsigned long" type just as in function declaration and add surrounding parentheses. 2006-04-05 11:20:12 +02:00
jimw@mysql.com
1a59580dcd Bug #13601: Wrong int type for bit
The wrong value was being reported as the field_length for BIT
  fields, resulting in confusion for at least Connector/J. The
  field_length is now always the number of bits in the field, as
  it should be.
2006-04-04 17:54:58 -07:00
aivanov@mysql.com
5ae25ea5f7 Fixed BUG#13683: INSERT DELAYED into a view creates an infinite loop.
The bug was caused by wrong behaviour of mysql_insert() which in case
 of INSERT DELAYED into a view exited with thd->net.report_error == 0.
 This blocked error reporting to the client which started waiting
 infinitely for response to the query.
2006-04-05 01:09:07 +04:00
igor@rurik.mysql.com
f485125968 Fixed bug #18237.
The code in opt_sum_query that prevented the COUNT/MIN/MAX 
optimization from being applied to outer joins  was not adjusted 
after introducing nested joins. As a result if an outer join
contained a reference to a view as an inner table the code of
opt_sum_query missed the presence of an on expressions and
erroneously applied the mentioned optimization.
2006-04-04 12:55:02 -07:00
bar@mysql.com
562386b9a9 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/usr/home/bar/mysql-5.0
2006-04-04 15:42:32 +05:00
igor@rurik.mysql.com
c4e61aa478 Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-0
2006-04-03 21:10:23 -07:00
igor@rurik.mysql.com
26b2c5d7bd Merge ibabaev@bk-internal.mysql.com:/home/bk/mysql-5.0
into  rurik.mysql.com:/home/igor/mysql-5.0
2006-04-03 21:07:27 -07:00
igor@rurik.mysql.com
788463869a Post review changes for the fix of bug #16504. 2006-04-03 21:02:40 -07:00
bar@mysql.com
26100744eb Merge mysql.com:/usr/home/bar/mysql-4.1.12076
into  mysql.com:/usr/home/bar/mysql-5.0
2006-04-03 17:24:14 +05:00