Commit graph

17937 commits

Author SHA1 Message Date
tsmith@ramayana.hindu.god
fa257c031c Applied innodb-5.0-ss2223 snapshot
Fixes:

Bug #32083: server crashes on show status when InnoDB is not initialized
  innodb_export_status(): Check that InnoDB has been initialized
  before invoking srv_export_innodb_status().  (Bug #32083)
  This bug does not exist in MySQL/InnoDB 5.1.
2008-01-23 18:20:04 -07:00
malff@lambda.hsd1.co.comcast.net.
1eecc24a21 Merge malff@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.0-33618
2008-01-23 14:04:46 -07:00
malff@lambda.hsd1.co.comcast.net.
c3ad0cac75 Bug#33618 (Crash in sp_rcontext)
Bug 33983 (Stored Procedures: wrong end <label> syntax is accepted)

The server used to crash when REPEAT or another control instruction
was used in conjunction with labels and a LEAVE instruction.

The crash was caused by a missing "pop" of handlers or cursors in the
code representing the stored program. When executing the code in a loop,
this missing "pop" would result in a stack overflow, corrupting memory.

Code generation has been fixed to produce the missing h_pop/c_pop
instructions.

Also, the logic checking that labels at the beginning and the end of a
statement are matched was incorrect, causing Bug 33983.
End labels, when used, must match the label used at the beginning of a block.
2008-01-23 13:26:41 -07:00
tomas@whalegate.ndb.mysql.com
b422aed975 Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb-merge
2008-01-23 15:07:18 +01:00
tsmith@ramayana.hindu.god
8287a4f27b Merge ramayana.hindu.god:/home/tsmith/m/bk/50
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/50
2008-01-22 15:44:18 -07:00
mhansson@lamia.dupka
e3e370dd9d Merge mhansson@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  lamia.dupka:/home/mhansson/my50-bug33143-again-pushee
2008-01-18 22:45:14 +02:00
sergefp@mysql.com
d56ac2f37b BUG#33794 "MySQL crashes executing specific query":
The problem occurred when one had a subquery that had an equality X=Y where 
Y referred to a named select list expression from the parent select. MySQL 
crashed when trying to use the X=Y equality for ref-based access. 

Fixed by allowing non-Item_field items in the described case.
2008-01-18 22:50:36 +03:00
mhansson/martin@linux-st28.site
7207d3ce21 Merge mhansson@bk-internal:/home/bk/mysql-5.0-opt
into  linux-st28.site:/home/martin/mysql/src/bug33143/my50-bug33143-again-pushee
2008-01-17 18:15:53 +01:00
mhansson/martin@linux-st28.site
effe27e350 Bug#33143: Incorrect ORDER BY for ROUND()/TRUNCATE() result
The ROUND(X, D) function would change the Item::decimals field during
execution to achieve the effect of a dynamic number of decimal digits.
This caused a series of bugs:
Bug #30617:Round() function not working under some circumstances in InnoDB
Bug #33402:ROUND with decimal and non-constant cannot round to 0 decimal places
Bug #30889:filesort and order by with float/numeric crashes server
Fixed by never changing the number of shown digits for DECIMAL when
used with a nonconstant number of decimal digits.
2008-01-14 16:16:36 +01:00
mhansson@lamia.dupka
8eb74b1f5f Merge mhansson@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  lamia.dupka:/home/mhansson/my50-bug31797-pushee
2008-01-12 18:59:05 +02:00
mhansson/martin@linux-st28.site
e24109c6d1 Merge mhansson@bk-internal:/home/bk/mysql-5.0-opt
into  linux-st28.site:/home/martin/mysql/src/bug31797/my50-bug31797-pushee
2008-01-11 19:00:26 +01:00
mhansson/martin@linux-st28.site
199a167246 Bug#31797: error while parsing subqueries -- WHERE is parsed as HAVING
The name resolution for correlated subqueries and HAVING clauses
failed to distinguish which of two was being performed when there 
was a reference to an outer aliased field.
Fixed by adding the condition that HAVING clause name resulotion
is being performed.
2008-01-11 18:50:54 +01:00
evgen@moonbone.local
baaf300d4c Bug#29477: Not all fields of the target table were checked to have a default
value when inserting into a view.

The mysql_prepare_insert function checks all fields of the target table that
directly or indirectly (through a view) are specified in the INSERT
statement to have a default value. This check can be skipped if the INSERT
statement doesn't mention any insert fields. In case of a view this allows
fields that aren't mentioned in the view to bypass the check.

Now fields of the target table are always checked to have a default value
when insert goes into a view.
2008-01-11 20:10:54 +03:00
kaa@kaamos.(none)
f8ade5e91b Merge kaamos.(none):/data/src/mysql-5.0
into  kaamos.(none):/data/src/opt/mysql-5.0-opt
2008-01-10 20:43:05 +03:00
evgen@moonbone.local
830b8f0e30 filesort.cc:
Bug#33675: Usage of an uninitialized memory by filesort in a subquery caused
  server crash.
  Free smaller buffer before allocating bigger one.
2008-01-10 18:54:34 +03:00
gni@dev3-221.dev.cn.tlan
0b1d727be7 Merge dev3-221.dev.cn.tlan:/home/ngb/mysql/mysql-5.0/mysql-5.0-ndb
into  dev3-221.dev.cn.tlan:/home/ngb/mysql/mysql-5.0/mysql-5.0-ndb-bj
2008-01-10 20:04:21 +08:00
evgen@moonbone.local
165dfa3eba Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/work/33675-bug-5.0-opt-mysql
2008-01-09 23:19:46 +03:00
gkodinov/kgeorge@magare.gmz
5a01be841a Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B33133-5.0-opt
2008-01-09 16:52:11 +02:00
gkodinov/kgeorge@macbook.gmz
2fc45f017d Bug #33133: Views are not transparent
When resolving references we need to take into consideration
the view "fields" and allow qualified access to them.
Fixed by extending the reference resolution to process view
fields correctly.
2008-01-09 16:49:13 +02:00
gni@dev3-221.dev.cn.tlan
37a64e5cbf Merge gni@bk-internal.mysql.com:/home/bk/mysql-5.0-ndb-bj
into  dev3-221.dev.cn.tlan:/home/ngb/mysql/mysql-5.0/bug29851
2008-01-09 11:17:50 +08:00
evgen@moonbone.local
ce111a0d73 Bug#33675: Usage of an uninitialized memory by filesort in a subquery caused
server crash.

The filesort implementation has an optimization for subquery execution which
consists of reusing previously allocated buffers. In particular the call to
the read_buffpek_from_file function might be skipped when a big enough buffer
for buffer descriptors (buffpeks) is already allocated. Beside allocating
memory for buffpeks this function fills allocated buffer with data read from
disk. Skipping it might led to using an arbitrary memory as fields' data and
finally to a crash.

Now the read_buffpek_from_file function is always called. It allocates
new buffer only when necessary, but always fill it with correct data.
2008-01-09 00:40:41 +03:00
gkodinov/kgeorge@magare.gmz
7fe932ed82 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B33256-5.0-opt
2008-01-07 18:55:05 +02:00
hezx@mail.hezx.com
87abfe06e3 Replace one overlooked return with DBUG_RETURN in function log_loaded_block 2008-01-06 20:16:28 +08:00
tsmith@ramayana.hindu.god
e122756433 Merge ramayana.hindu.god:/home/tsmith/m/bk/50
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/50
2008-01-04 19:59:01 -07:00
sven@riska.(none)
72676b226b Merge ssandberg@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  riska.(none):/home/sven/bk/b26395-autocommit-xa/5.0-rpl
2008-01-02 14:23:14 +01:00
hezx@mail.hezx.com
d501c40629 Merge mail.hezx.com:/media/sda3/work/mysql/bkwork/bug#28908/5.0
into  mail.hezx.com:/media/sda3/work/mysql/bkwork/bug#28908/mysql-5.0-rpl
2007-12-24 11:08:39 +08:00
aelkin/elkin@koti.dsl.inet.fi
7801f29041 Merge aelkin@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  koti.dsl.inet.fi:/home/elkin/MySQL/TEAM/FIXES/5.0/bug33435-load_data_read_buffer_size
2007-12-21 22:37:10 +02:00
aelkin/elkin@koti.dsl.inet.fi
0ca3250e59 BUG#30435 loading large LOAD DATA INFILE breaks slave with
read_buffer_size set on master
BUG#33413 show binlog events fails if binlog has event size of close
          to max_allowed_packet


The size of Append_block replication event was determined solely by
read_buffer_size whereas the rest of replication code deals with
max_allowed_packet.
When the former parameter was set to larger than the latter there were
two artifacts: the master could not read events from binlog;
show master events did not show.

Fixed with 
- fragmenting the used io-cached buffer into pieces each size of less
  than max_allowed_packet (bug#30435)
- incrementing show-binlog-events handling thread's max_allowed_packet
  with the max estimated for the replication header size
2007-12-21 22:34:43 +02:00
sven@riska.(none)
25d53f907c BUG#26395: if crash during autocommit update to transactional table on master, slave fails
Now, every transaction (including autocommit transactions) start with
a BEGIN and end with a COMMIT/ROLLBACK in the binlog.
Added a test case, and updated lots of test case result files.
2007-12-21 20:30:23 +01:00
aelkin/elkin@koti.dsl.inet.fi
3624851643 Merge aelkin@bk-internal.mysql.com:/home/bk/mysql-5.0-rpl
into  koti.dsl.inet.fi:/home/elkin/MySQL/TEAM/FIXES/5.0/bug31359-future_gpos
2007-12-21 15:44:06 +02:00
joerg@trift2.
bf1ba3d416 Merge trift2.:/MySQL/M50/clone-5.0
into  trift2.:/MySQL/M50/merge-5.0
2007-12-21 12:48:14 +01:00
gkodinov/kgeorge@macbook.gmz
e4efb4a521 Bug #33256: CREATE ... SELECT creates obsolete table
w/ Field_date instead of Field_newdate
  
Field_date was still used in temp table creation.
Fixed by using Field_newdate consistently throughout the server
except when reading tables defined with older MySQL version.
No test suite is possible because both Field_date and Field_newdate
return the same values in all the metadata calls.
2007-12-21 12:44:24 +02:00
serg@janus.mylan
baf53c8524 cast corrected 2007-12-21 11:28:34 +01:00
hezx@mail.hezx.com
2b4bc3e93c Merge mail.hezx.com:/media/sda3/work/mysql/bkroot/mysql-5.0-rpl
into  mail.hezx.com:/media/sda3/work/mysql/bkwork/bug#28908/5.0
2007-12-21 17:52:25 +08:00
serg@janus.mylan
97754ffae7 warning on windows 2007-12-21 10:31:47 +01:00
aelkin/elkin@koti.dsl.inet.fi
1032038579 Bug #31359 change_master sets group_master_log_pos twice,
ignores future_group_master_log_p

There was a redundant assignement. However, that's the only artifact.
Wrt to future_group_master_log_position, there is no issue.
The counter is supposed to be set at Log_event::exec_event().
It's used only by Innodb for recovery purposes.
2007-12-21 10:13:54 +02:00
mats@capulet.kindahl.net
1666ecf070 Merge capulet.kindahl.net:/home/mats/devel/b12691-mysql-5.0-rpl
into  capulet.kindahl.net:/home/mats/devel/fix-mysql-5.0-rpl
2007-12-21 07:52:07 +01:00
hezx@mail.hezx.com
329d1a7bf7 BUG#28908 Replication: set global server_id is not setting the session server_id
When set the server-id dynamically, the server_id member of current thread is not updated.

Update the server_id member of current thread after updated the global variable value.
2007-12-21 11:02:48 +08:00
mats@capulet.kindahl.net
f1c32705f1 BUG#12691 (Exec_master_log_pos corrupted with SQL_SLAVE_SKIP_COUNTER):
Complementary patch since LOAD DATA INFILE was not covered in
the previous patch.

This patch adds a check so that the slave skip counter is not
decreased to zero if seeing a BEGIN_LOAD_QUERY_EVENT,
APPEND_BLOCK_EVENT, or CREATE_FILE_EVENT since these cannot
end a group. The group is terminated by an EXECUTE_LOAD_QUERY_
EVENT or DELETE_FILE_EVENT.
2007-12-20 16:07:54 +01:00
tnurnberg@white.intern.koehntopp.de
22d1a50d5c Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/misc/mysql/31990/50-31990
2007-12-20 13:42:50 +01:00
mhansson/martin@linux-st28.site
284d8c71ee Merge mhansson@bk-internal:/home/bk/mysql-5.0-opt
into  linux-st28.site:/home/martin/mysql/src/bug32848/my50-bug32848
2007-12-20 11:24:42 +01:00
mhansson/martin@linux-st28.site
6f6e18809a Bug#32848: Data type conversion bug in union subselects in MySQL 5.0.38
Warnings elimination
2007-12-20 10:58:21 +01:00
tnurnberg@white.intern.koehntopp.de
d1637b2ec4 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/misc/mysql/31990/50-31990
2007-12-20 08:35:52 +01:00
serg@janus.mylan
4a5eb6bd17 correct invalid values in SET GLOBAL var=DEFAULT
bug#33382
2007-12-19 21:31:04 +01:00
mhansson/martin@linux-st28.site
0004b99b58 Merge mhansson@bk-internal:/home/bk/mysql-5.0-opt
into  linux-st28.site:/home/martin/mysql/src/bug32848/my50-bug32848
2007-12-19 15:59:05 +01:00
mkindahl@dl145h.mysql.com
a9daa2cd86 Merge dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl
into  dl145h.mysql.com:/data0/mkindahl/mysql-5.0-rpl-merge
2007-12-19 14:49:04 +01:00
tnurnberg@white.intern.koehntopp.de
1d84609890 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/misc/mysql/32770/50-32770
2007-12-17 09:56:40 +01:00
tnurnberg@white.intern.koehntopp.de
f7aa719268 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/misc/mysql/31752_/50-31752_
2007-12-17 09:45:36 +01:00
tnurnberg@mysql.com/white.intern.koehntopp.de
b2f867155f Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  mysql.com:/misc/mysql/31752_/41-31752_
2007-12-17 09:42:55 +01:00
tnurnberg@mysql.com/white.intern.koehntopp.de
e131a41281 Merge mysql.com:/misc/mysql/31752_/41-31752_
into  mysql.com:/misc/mysql/31752_/50-31752_
2007-12-17 09:13:38 +01:00
tnurnberg@white.intern.koehntopp.de
2ab88382ef Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/misc/mysql/32770/50-32770
2007-12-17 07:54:32 +01:00
mhansson/martin@linux-st28.site
ca5f50788e Merge mhansson@bk-internal:/home/bk/mysql-5.0-opt
into  linux-st28.site:/home/martin/mysql/src/bug32798-united/my50-bug32798-united-push
2007-12-15 16:45:21 +01:00
kostja@bodhi.(none)
4bb503568d Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.(none):/opt/local/work/mysql-5.0-runtime
2007-12-15 17:00:18 +03:00
hezx@hezx.(none)
c2f00cc3f9 BUG#32205 Replaying statements from mysqlbinlog fails with a syntax error, replicates fine
The reason of this bug is that when mysqlbinlog dumps a query, the query is written to
output with a delimeter appended right after it, if the query string ends with a '--'
comment, then the delimeter would be considered as part of the comment, if there are any
statements after this query, then it will cause a syntax error.

Start a newline before appending delimiter after a query string
2007-12-15 19:50:23 +08:00
mhansson/martin@linux-st28.site
59314ee35b Merge mhansson@bk-internal:/home/bk/mysql-5.0-opt
into  linux-st28.site:/home/martin/mysql/src/bug32858/my50-bug32858-push
2007-12-15 12:07:33 +01:00
mhansson/martin@linux-st28.site
bcfdd27481 Merge mhansson@bk-internal:/home/bk/mysql-5.0-opt
into  linux-st28.site:/home/martin/mysql/src/bug32798-united/my50-bug32798-united-push
2007-12-15 12:02:33 +01:00
igor@olga.mysql.com
43582593c3 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug27848
2007-12-14 18:17:52 -08:00
igor@olga.mysql.com
f25e30ebed Fixed bug #27848.
In a union without braces, the order by at the end is applied to the 
overall union. It therefore should not interfere with the individual
select parts of the union.

Fixed by changing our parser rules appropriately.
2007-12-14 13:42:46 -08:00
kent/mysqldev@mysql.com/production.mysql.com
fb8cceb06e sp_head.cc:
Corrected typo
2007-12-14 21:38:58 +01:00
kent/mysqldev@mysql.com/production.mysql.com
7ca11181ac sp_head.cc:
Made sp_head::operator delete() match prototype, added throw()
mysql_test_run.c, mysqld_safe.c:
  Include "mysql_version.h" to get MYSQL_PORT defined
2007-12-14 18:23:11 +01:00
anozdrin/alik@station.
61b903f896 Merge station.:/mnt/raid/alik/MySQL/devel/5.0
into  station.:/mnt/raid/alik/MySQL/devel/5.0-rt
2007-12-14 15:57:36 +03:00
mhansson/martin@linux-st28.site
cdeecc5154 Bug#32798: DISTINCT in GROUP_CONCAT clause fails when ordering by a column
with null values

For queries containing GROUP_CONCAT(DISTINCT fields ORDER BY fields), there 
was a limitation that the DISTINCT fields had to be the same as ORDER BY 
fields, owing to the fact that one single sorted tree was used for keeping 
track of tuples, ordering and uniqueness. Fixed by introducing a second 
structure to handle uniqueness so that the original structure has only to 
order the result.
2007-12-14 12:24:20 +01:00
tomas@whalegate.ndb.mysql.com
70902cdd86 Merge tulin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb-merge
2007-12-14 06:53:55 +01:00
gluh@mysql.com/eagle.(none)
8be07b88df additional fix 2007-12-13 23:46:29 +04:00
gluh@mysql.com/eagle.(none)
2627f775be valgrind error fix 2007-12-13 21:13:08 +04:00
tomas@whalegate.ndb.mysql.com
f84b45244d Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb-merge
2007-12-13 14:25:16 +01:00
gluh@eagle.(none)
e039595029 Merge mysql.com:/home/gluh/MySQL/Merge/5.0
into  mysql.com:/home/gluh/MySQL/Merge/5.0-opt
2007-12-13 14:52:49 +04:00
sergefp@foxhole.(none)
9f4f6acc53 Merge spetrunia@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/psergey/mysql-5.0-bug32198
2007-12-13 13:39:37 +03:00
sergefp@mysql.com
dd0854db54 BUG#32198: Comparison of DATE with DATETIME still not using indexes correctly
- Make conditions like "date_col $CMP$ 'datetime-const'" range-sargable
2007-12-13 13:38:22 +03:00
gluh@mysql.com/eagle.(none)
4e50bb0ebe Merge mysql.com:/home/gluh/MySQL/Merge/4.1
into  mysql.com:/home/gluh/MySQL/Merge/4.1-opt
2007-12-13 14:38:01 +04:00
mhansson/martin@linux-st28.site
33c4431d39 Bug #32858: Erro: "Incorrect usage of UNION and INTO" does not take
subselects into account

It is forbidden to use the SELECT INTO construction inside UNION statements
unless on the last SELECT of the union. The parser records whether it 
has seen INTO or not when parsing a UNION statement. But if the INTO was
legally used in an outer query, an error is thrown if UNION is seen in a
subquery. Fixed in 5.0 by remembering the nesting level of INTO tokens and 
mitigate the error unless it collides with the UNION.
2007-12-13 11:19:05 +01:00
anozdrin/alik@station.
7d9dd21cd9 Merge station.:/mnt/raid/alik/MySQL/devel/5.0
into  station.:/mnt/raid/alik/MySQL/devel/5.0-rt
2007-12-13 12:01:04 +03:00
kostja@bodhi.(none)
4c83efbb95 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  bodhi.(none):/opt/local/work/mysql-5.0-runtime
2007-12-12 06:00:10 +03:00
mhansson/martin@linux-st28.site
867a786549 Bug#32848: Data type conversion bug in union subselects in MySQL 5.0.38
There were two problems when inferring the correct field types resulting from
UNION queries.
- If the type is NULL for all corresponding fields in the UNION, the resulting 
  type would be NULL, while the type is BINARY(0) if there is just a single 
  SELECT NULL.
- If one SELECT in the UNION uses a subselect, a temporary table is created
  to represent the subselect, and the result type defaults to a STRING type,
  hiding the fact that the type was unknown(just a NULL value).
Fixed by remembering whenever a field was created from a NULL value and pass
type NULL to the type coercion if that is the case, and creating a string field
as result of UNION only if the type would otherwise be NULL.
2007-12-11 20:15:03 +01:00
istruewing@stella.local
ba2d58ae5e Merge stella.local:/home2/mydev/mysql-5.0-amain
into  stella.local:/home2/mydev/mysql-5.0-axmrg
2007-12-11 17:09:43 +01:00
hezx@hezx.(none)
a85e8a3f21 Merge hezx.(none):/media/hda5/work/mysql/bkroot/mysql-5.0-rpl
into  hezx.(none):/media/hda5/work/mysql/bkwork/bug#30998/5.0
2007-12-11 17:34:37 +08:00
tnurnberg@mysql.com/white.intern.koehntopp.de
3f0f275030 Bug#31990: MINUTE() and SECOND() return bogus results when used on a DATE
HOUR(), MINUTE(), ... returned spurious results when used on a DATE-cast.
This happened because DATE-cast object did not overload get_time() method
in superclass Item. The default method was inappropriate here and
misinterpreted the data.

Patch adds missing method; get_time() on DATE-casts now returns SQL-NULL
on NULL input, 0 otherwise. This coincides with the way DATE-columns
behave.

Also fixes similar bug in Date-Field now.
2007-12-11 10:12:05 +01:00
thek@adventure.(none)
0f1665da3c Merge adventure.(none):/home/thek/Development/cpp/bug27440/my50-bug27440
into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime
2007-12-10 12:19:48 +01:00
tomas@whalegate.ndb.mysql.com
ddbb4d425c Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb-merge
2007-12-10 10:31:51 +01:00
tnurnberg@mysql.com/white.intern.koehntopp.de
8651aeb2c4 Bug#32770: LAST_DAY() returns a DATE, but somehow internally keeps track of the TIME.
LAST_DAY() says it returns a DATE, not a DATETIME, but didn't zero the time fields.
Adapted from a patch kindly supplied by Claudio Cherubino.
2007-12-10 09:17:18 +01:00
igor@olga.mysql.com
0e3e5cf40d Forced compilers to remove the warning appeared after the patch
with a fix for bug 32694.
2007-12-09 11:53:07 -08:00
igor@olga.mysql.com
f781e154e3 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug27545
2007-12-08 16:22:45 -08:00
igor@olga.mysql.com
be5485ce6d Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug32815
2007-12-08 14:47:56 -08:00
timour/tkatchaounov@lapi.mysql.com
9be915e743 Fix for BUG#32694 "NOT NULL table field in a subquery produces invalid results"
The problem was that when convert_constant_item is called for subqueries,
this happens when we already started executing the top-level query, and
the field argument of convert_constant_item pointed to a valid table row.
In turn convert_constant_item used the field buffer to compute the value
of its item argument. This copied the item's value into the field,
and made equalities with outer references always true.
  
The fix saves/restores the original field's value when it belongs to an
outer table.
2007-12-08 23:05:00 +02:00
igor@olga.mysql.com
c04d3727dc Fixed bug #27545.
Both arguments of the function NAME_CONST must be constant expressions.
This constraint is checked in the Item_name_const::fix_fields method. 
Yet if the argument of the function was not a constant expression no
error message was reported. As a result the client hanged waiting for a
response.
Now the function Item_name_const::fix_fields reports an error message
when any of the additional context conditions imposed on the function
NAME_CONST is not satisfied.
2007-12-07 23:36:58 -08:00
igor@olga.mysql.com
c394dbe14a Fixed bug #32815.
The index (key_part_1, key_part-2) was erroneously considered as compatible
with the required ordering in the function test_test_if_order_by_key when 
a query with an ORDER BY clause contained a condition of the form
  key_part_1=const OR key_part_1 IS NULL 
and the order list contained only key_part_2. This happened because the value
of the const_key_parts field in the KEYUSE structure was not formed correctly
for the keys that could be used for ref_or_null access. 
This was fixed in the code of the update_ref_and_keys function.
The problem could not manifest itself for MyISAM databases because the
implementation of the keys_to_use_for_scanning() handler function always
returns an empty bitmap for the MyISAM engine.
2007-12-07 17:14:59 -08:00
thek@adventure.(none)
392cc185b3 Bug #27440 read_only allows create and drop database
When read_only option was enabled, a user without SUPER privilege could
perform CREATE DATABASE and DROP DATABASE operations.

This patch adds a check to make sure this isn't possible. It also attempts to 
simplify the logic used to determine if relevant tables are updated,
making it more human readable.
2007-12-07 15:39:41 +01:00
mskold/marty@mysql.com/quadfish.(none)
4619caa5d5 Removed illegal cast 2007-12-07 14:03:54 +01:00
mskold/marty@mysql.com/quadfish.(none)
6047fb2e44 Removed illegal cast 2007-12-07 13:42:44 +01:00
tsmith@ramayana.hindu.god
8c5f194505 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/50
2007-12-07 03:51:23 -07:00
mskold/marty@mysql.com/quadfish.(none)
fc6f839b03 bug#21072 Duplicate key error in NDB references wrong key: Post-review fixes 2007-12-07 10:33:50 +01:00
tsmith@ramayana.hindu.god
b922c9646c Fix compiler warning about wrong integer size (probably harmless) 2007-12-06 16:11:26 -07:00
mskold/marty@mysql.com/quadfish.(none)
27c025061d bug#21072 Duplicate key error in NDB references wrong key: Return correct key for non-batching inserts 2007-12-06 17:15:21 +01:00
tnurnberg@mysql.com/white.intern.koehntopp.de
dddced964b Bug#31752: check strmake() bounds
post-fixes: prevent semi-related overflow, additional comments
2007-12-06 11:48:27 +01:00
tnurnberg@white.intern.koehntopp.de
987ec3f306 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/misc/mysql/31177/50-31177
2007-12-06 08:46:01 +01:00
tnurnberg@mysql.com/white.intern.koehntopp.de
b1e77cfc31 Bug#31177: Server variables can't be set to their current values
additional fixes for BDB and correct assignment of both signed
and unsigned 64-bit data to unsigned system variables
2007-12-06 01:28:01 +01:00
bar@mysql.com/bar.myoffice.izhnet.ru
25debb1db6 sql_string.cc:
Fixing a wrong comment.
2007-12-05 12:26:21 +04:00
tsmith@ramayana.hindu.god
10cab933b2 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-5.0
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/50
2007-12-04 20:58:21 -07:00
tsmith@ramayana.hindu.god
6453025165 Merge tsmith@bk-internal.mysql.com:/home/bk/mysql-4.1
into  ramayana.hindu.god:/home/tsmith/m/bk/maint/41
2007-12-04 19:16:22 -07:00
mhansson@dl145s.mysql.com
22b4b4db04 Merge mhansson@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  dl145s.mysql.com:/data0/mhansson/my50-bug30234
2007-12-04 11:32:11 +01:00
mhansson/martin@linux-st28.site
d2c6ed55ef Bug#30234: Unexpected behavior using DELETE with AS and USING
Anti-patch. This patch undoes the previously pushed patch. It is 
null-merged in versions 5.1 and above since there the original 
patch is still desired.
2007-12-03 10:08:58 +01:00
hezx@hezx.(none)
c267a923a3 Bug#30998 Drop View breaks replication if view does not exist
When executing drop view statement on the master, the statement is written
into bin-log without checking for possible errors, so the statement would 
always be bin-logged with error code cleared even if some error might occur, 
for example, some of the views being dropped does not exist. This would cause 
failure on the slave.

Writing bin-log after check for errors, if at least one view has been dropped
the query is bin-logged possible with an error.
2007-12-03 13:11:40 +08:00
kaa@polly.(none)
0e78354baa Merge polly.(none):/home/kaa/src/maint/bug26788/my50-bug26788
into  polly.(none):/home/kaa/src/maint/mysql-5.0-maint
2007-12-02 14:11:36 +03:00
kaa@polly.(none)
d905aade4f Windows-specific fixes in floating point tests. 2007-12-02 13:49:12 +03:00
tnurnberg@white.intern.koehntopp.de
55d6d04df0 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/misc/mysql/31177/50-31177
2007-12-02 01:48:43 +01:00
kaa@polly.(none)
2a52bb82e4 Merge polly.(none):/home/kaa/src/maint/bug26788/my50-bug26788
into  polly.(none):/home/kaa/src/maint/mysql-5.0-maint
2007-12-01 15:37:25 +03:00
kaa@polly.(none)
55acce7504 Fixed the floating point number tests on Windows. 2007-12-01 15:25:24 +03:00
tnurnberg@white.intern.koehntopp.de
3900e55aa8 Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/misc/mysql/32707/50-32707
2007-12-01 13:09:16 +01:00
tnurnberg@mysql.com/white.intern.koehntopp.de
d713527b0c Merge tnurnberg@bk-internal.mysql.com:/home/bk/mysql-4.1-opt
into  mysql.com:/misc/mysql/32707/41-32707
2007-12-01 13:07:27 +01:00
kaa@polly.(none)
0f0051e695 Merge polly.(none):/home/kaa/src/maint/bug26788/my50-bug26788
into  polly.(none):/home/kaa/src/maint/mysql-5.0-maint
2007-12-01 12:57:20 +03:00
kaa@polly.(none)
33125cd40e Fixed the build failure on Windows. It does not have trunc() defined in math.h, so we should not use it code. 2007-12-01 12:46:25 +03:00
holyfoot/hf@hfmain.(none)
0b3c91e1f1 Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/mrg/my50-mrg
2007-12-01 13:12:31 +04:00
kaa@polly.(none)
b994abb997 Merge polly.(none):/home/kaa/src/maint/bug26788/my50-bug26788
into  polly.(none):/home/kaa/src/maint/mysql-5.0-maint
2007-12-01 10:48:41 +03:00
kaa@polly.(none)
7fd9135bb8 Fix for bug #26788 "mysqld (debug) aborts when inserting specific
numbers into char fields" and bug #12860 "Difference in zero padding of
exponent between Unix and Windows"

Rewrote the code that determines what 'precision' argument should be
passed to sprintf() to fit the string representation of the input number
into the field.
We get finer control over conversion by pre-calculating the exponent, so
we are able to determine which conversion format, 'e' or 'f', will be
used by sprintf().
We also remove the leading zero from the exponent on Windows to make it
compatible with the sprintf() output on other platforms.
2007-12-01 10:05:59 +03:00
holyfoot/hf@hfmain.(none)
ad52a590cf Merge mysql.com:/home/hf/work/mrg/my41-mrg
into  mysql.com:/home/hf/work/mrg/my50-mrg
2007-11-30 22:29:34 +04:00
holyfoot/hf@hfmain.(none)
83e0fef847 Merge mysql.com:/home/hf/work/32624/my50-32624
into  mysql.com:/home/hf/work/mrg/my50-mrg
2007-11-30 22:28:23 +04:00
holyfoot/hf@hfmain.(none)
bea42da135 Merge mysql.com:/home/hf/work/32374/my50-32374
into  mysql.com:/home/hf/work/mrg/my50-mrg
2007-11-30 22:26:48 +04:00
kaa@polly.(none)
cf39abbbd6 Merge polly.(none):/home/kaa/src/opt/bug9481/my50-bug9481
into  polly.(none):/home/kaa/src/opt/mysql-5.0-opt
2007-11-30 18:45:35 +03:00
holyfoot/hf@mysql.com/hfmain.(none)
3f51ff6403 Bug #32374 crash with filesort when selecting from federated table and view.
filesort() uses file->estimate_rows_upper_bound() call to allocate
internal buffers. If this function returns a value smaller than
a number of row that will be returned later in find_all_keys(),
that can cause server crash.
Fixed by implementing ha_federated::estimate_rows_upper_bound() to
return maximum possible number of rows.
Present estimation for FEDERATED always returns 0 if the linked to the VIEW.
2007-11-30 17:08:00 +04:00
tnurnberg@white.intern.koehntopp.de
beee8954e1 Merge mysql.com:/misc/mysql/32707/41-32707
into  mysql.com:/misc/mysql/32707/50-32707
2007-11-30 12:44:28 +01:00
tnurnberg@mysql.com/white.intern.koehntopp.de
31d4e58ad4 Bug#31177: Server variables can't be set to their current values
Default values of variables were not subject to upper/lower bounds
and step, while setting variables was. Bounds and step are also
applied to defaults now; defaults are corrected quietly, values
given by the user are corrected, and a correction-warning is thrown
as needed. Lastly, very large values could wrap around, starting
from 0 again. They are bounded at the maximum value for the
respective data-type now if no lower maximum is specified in the
variable's definition.
2007-11-30 06:32:04 +01:00
holyfoot/hf@mysql.com/hfmain.(none)
b0d63e8dac Bug #29085 A small double precision number becomes zero.
Denormalized DOUBLE-s can't be properly handled by old MIPS processors.
So we need to enable specific mode for them so IRIX will do use
software round to handle such numbers.
2007-11-29 14:52:36 +04:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
7bc2d42752 Merge mysql.com:/home/ram/work/mysql-5.0-engines
into  mysql.com:/home/ram/work/b32559/b32559.5.0
2007-11-29 14:01:07 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
9786ccd0a0 Bug #32624 Error with multi queries in MySQL embedded server 5.1.22.
server status wasn't properly sent to the client after the error
by the embedded server. Wasn't noticed before as one usually stopped
retrieving results after he gets an error.
2007-11-29 10:37:07 +04:00
ramil/ram@ramil.myoffice.izhnet.ru
92d4ea79ef Merge mysql.com:/home/ram/work/mysql-5.0-engines
into  mysql.com:/home/ram/work/b32676/b32676.5.0
2007-11-29 08:24:52 +04:00
malff@lambda.hsd1.co.comcast.net.
7c4f906bf3 Merge lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.0-base
into  lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.0-rt-merge
2007-11-28 07:23:51 -07:00
davi@endora.local
7441f466e2 Merge mysql.com:/Users/davi/mysql/bugs/31479-5.0
into  mysql.com:/Users/davi/mysql/mysql-5.0-runtime
2007-11-28 10:49:30 -02:00
davi@mysql.com/endora.local
bd3f76d767 Bug#31479 Bad lock interaction if CREATE TABLE LIKE is killed
Kill of a CREATE TABLE source_table LIKE statement waiting for a
name-lock on the source table causes a bad lock interaction.

The mysql_create_like_table() has a bug that if the connection is
killed while waiting for the name-lock on the source table, it will
jump to the wrong error path and try to unlock the source table and
LOCK_open, but both weren't locked.

The solution is to simple return when the name lock request is killed,
it's safe to do so because no lock was acquired and no cleanup is needed.

Original bug report also contains description of other problems
related to this scenario but they either already fixed in 5.1 or
will be addressed separately (see bug report for details).
2007-11-28 10:18:01 -02:00
tnurnberg@mysql.com/white.intern.koehntopp.de
46ee271e8f Bug#32707: misdimensioned buffer in protocol layer
Miscalculation in protocol-layer: size buffer correctly so
even really long error messages cannot overflow our buffer.
2007-11-27 18:24:24 +01:00
gkodinov/kgeorge@magare.gmz
3bd26b47e6 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B30355-5.0-opt
2007-11-27 18:58:09 +02:00
istruewing@stella.local
c389535ae9 Merge stella.local:/home2/mydev/mysql-5.0-ateam
into  stella.local:/home2/mydev/mysql-5.0-axmrg
2007-11-27 17:34:03 +01:00
malff@lambda.hsd1.co.comcast.net.
352e59b37b Merge lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.0-base
into  lambda.hsd1.co.comcast.net.:/home/malff/TREE/mysql-5.0-rt-merge
2007-11-27 08:56:43 -07:00
gshchepa/uchum@gleb.loc
cbc91811df Merge gleb.loc:/work/bk/5.0-opt-32403
into  gleb.loc:/work/bk/5.0-opt
2007-11-27 19:28:27 +04:00
istruewing@stella.local
a39180c1f2 Merge stella.local:/home2/mydev/mysql-5.0-amain
into  stella.local:/home2/mydev/mysql-5.0-axmrg
2007-11-27 16:24:44 +01:00
gkodinov/kgeorge@magare.gmz
11d268ba47 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B30355-5.0-opt
2007-11-27 17:21:36 +02:00
gkodinov/kgeorge@magare.gmz
8c3d5135ba Bug #30355: Incorrect ordering of UDF results
There's currently no way of knowing the determinicity of an UDF.
And the optimizer and the sequence() UDFs were making wrong
assumptions about what the is_const member means.
Plus there was no implementation of update_system_tables()
causing the optimizer to overwrite the information returned by
the <udf>_init function.

Fixed by equating the assumptions about the semantics of 
is_const and providing a implementation of update_used_tables().
Added a TODO item for the UDF API change needed to make a better 
implementation.
2007-11-27 17:16:52 +02:00
gshchepa/uchum@gleb.loc
97ac0c273f Fixed bug #32403: query causes a crash due to stack and
memory corruptions.

The right pointer field of the SEL_ARG structure was not
initialized in the constructor and sometimes that led to
server crashes.

There is no testcase because the bug occurs only when
uninitialized memory has particular values, which can't be
re-created in the test suite.
2007-11-27 19:14:48 +04:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
14e74e82e8 Merge mysql.com:/home/ram/work/mysql-5.0-engines
into  mysql.com:/home/ram/work/b30495/b30495.5.0
2007-11-27 15:15:28 +04:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
ac034767c0 Fix for bug #32559: connection hangs on query with name_const
Problem: passing a non-constant name to the NAME_CONST function results in a crash.

Fix: check the NAME_CONST name argument; return fake item type if we got
non-constant argument(s).
2007-11-27 09:36:43 +04:00
kaa@polly.(none)
e854d43af9 Merge polly.(none):/home/kaa/src/opt/bug28837/my50-bug29131
into  polly.(none):/home/kaa/src/opt/mysql-5.0-opt
2007-11-26 19:35:08 +03:00
kaa@polly.(none)
8fdd9087f8 Fix for bug #28837: MyISAM storage engine error (134) doing delete with
self-join

When doing DELETE with self-join on a MyISAM or MERGE table, it could
happen that a record being retrieved in join_read_next_same() has
already been deleted by previous iterations. That caused the engine's
index_next_same() method to fail with HA_ERR_RECORD_DELETED error and
the whole DELETE query to be aborted with an error.

Fixed by suppressing the HA_ERR_RECORD_DELETED error in
hy_myisam::index_next_same() and ha_myisammrg::index_next_same(). Since
HA_ERR_RECORD_DELETED can only be returned by MyISAM, there is no point
in filtering this error in the SQL layer.
2007-11-26 18:58:54 +03:00
kaa@polly.(none)
24c9d86416 5.0 version of the fix for bug #9481: mysql_insert_id() returns 0 after
insert ... select.

The 5.0 manual page for mysql_insert_id() does not mention anything
about INSERT ... SELECT, though its current behavior is incosistent
with what the manual says about the plain INSERT.

Fixed by changing the AUTO_INCREMENT and mysql_insert_id() handling
logic in INSERT ... SELECT to be consistent with the INSERT behavior,
the manual, and the changes in 5.1 introduced by WL3146:


- mysql_insert_id() now returns the first automatically generated
AUTO_INCREMENT value that was successfully inserted by INSERT ... SELECT

-  if an INSERT ... SELECT statement is executed, and no automatically
generated value is successfully inserted, mysql_insert_id() now returns
the ID of the last inserted row.
2007-11-26 18:36:05 +03:00
thek@adventure.(none)
0ca073c610 Merge adventure.(none):/home/thek/Development/cpp/bug32436/my50-bug32436
into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime
2007-11-26 15:58:06 +01:00
thek@adventure.(none)
95bfde3d01 Bug #32436 KILL QUERY completely deadlocks mysqld
Sending several "KILL QUERY" statements to target a connection running
"SELECT SLEEP" could freeze the server.

The locking order in Item_func_sleep was wrong and this could lead to a
dead lock.

This patch solves the issue by resolving the locking order properly.
2007-11-26 15:44:05 +01:00
gkodinov/kgeorge@magare.gmz
30c9f9432a Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B32036-5.0-opt
2007-11-26 15:57:47 +02:00
gkodinov/kgeorge@magare.gmz
6008aa2187 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B32036-5.0-opt
2007-11-26 14:02:02 +02:00
gkodinov/kgeorge@magare.gmz
55afc5c201 Bug #32036: EXISTS within a WHERE clause with a UNION
crashes MySQL 5.122
There was a difference in how UNIONs are handled
on top level and when in sub-query.
Because the rules for sub-queries were syntactically
allowing cases that are not currently supported by
the server we had crashes (this bug) or wrong results
(bug 32051).
Fixed by making the syntax rules for UNIONs match the 
ones at top level.

These rules however do not support nesting UNIONs, e.g.
(SELECT a FROM t1 UNION ALL SELECT b FROM t2) 
 UNION
(SELECT c FROM t3 UNION ALL SELECT d FROM t4)
Supports for statements with nested UNIONs will be
added in a future version.
2007-11-26 13:36:24 +02:00
gkodinov/kgeorge@magare.gmz
7b1f0820b8 Merge gkodinov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  magare.gmz:/home/kgeorge/mysql/autopush/B32268-5.0-opt
2007-11-26 13:35:38 +02:00
ramil/ram@mysql.com/ramil.myoffice.izhnet.ru
5adf16e288 Fix for bug #32676: insert delayed crash with wrong column and function specified
Problem: using wrong local lock type value in the mysql_insert() results in a crash. 

Fix: use a proper value.
2007-11-26 13:29:26 +04:00
tnurnberg@mysql.com/white.intern.koehntopp.de
883338a949 Bug#31752: check strmake() bounds
strmake() called with wrong parameters:
5.0-specific fixes.
2007-11-26 09:13:23 +01:00