Commit graph

14039 commits

Author SHA1 Message Date
kostja@vajra.(none)
0162745cff Merge bk-internal.mysql.com:/home/bk/mysql-5.1
into  vajra.(none):/opt/local/work/mysql-5.1-runtime
2007-05-24 19:34:14 +04:00
dlenev@mockturtle.local
661aaec64f Merge mockturtle.local:/home/dlenev/src/mysql-5.0-like
into  mockturtle.local:/home/dlenev/src/mysql-5.1-like-2
2007-05-23 15:55:36 +04:00
dlenev@mockturtle.local
8e8f4c05cc 5.1 version of fix for:
Bug #23667 "CREATE TABLE LIKE is not isolated from alteration
              by other connections"
  Bug #18950 "CREATE TABLE LIKE does not obtain LOCK_open"
As well as:
  Bug #25578 "CREATE TABLE LIKE does not require any privileges
              on source table".

The first and the second bugs resulted in various errors and wrong
binary log order when one tried to execute concurrently CREATE TABLE LIKE
statement and DDL statements on source table or DML/DDL statements on its
target table.

The problem was caused by incomplete protection/table-locking against
concurrent statements implemented in mysql_create_like_table() routine.
We solve it by simply implementing such protection in proper way.
Most of actual work for 5.1 was already done by fix for bug 20662 and
preliminary patch changing locking in ALTER TABLE.

The third bug allowed user who didn't have any privileges on table create
its copy and therefore circumvent privilege check for SHOW CREATE TABLE.

This patch solves this problem by adding privilege check, which was missing.

Finally it also removes some duplicated code from mysql_create_like_table()
and thus fixes bug #26869 "TABLE_LIST::table_name_length inconsistent with
TABLE_LIST::table_name".
2007-05-23 15:26:16 +04:00
dlenev@mockturtle.local
c07b3670d7 5.0 version of fix for:
Bug #23667 "CREATE TABLE LIKE is not isolated from alteration
             by other connections"
 Bug #18950 "CREATE TABLE LIKE does not obtain LOCK_open"
As well as:
 Bug #25578 "CREATE TABLE LIKE does not require any privileges
             on source table".

The first and the second bugs resulted in various errors and wrong
binary log order when one tried to execute concurrently CREATE TABLE LIKE
statement and DDL statements on source table or DML/DDL statements on its
target table.

The problem was caused by incomplete protection/table-locking against
concurrent statements implemented in mysql_create_like_table() routine.
We solve it by simply implementing such protection in proper way (see
comment for sql_table.cc for details).

The third bug allowed user who didn't have any privileges on table create
its copy and therefore circumvent privilege check for SHOW CREATE TABLE.

This patch solves this problem by adding privilege check, which was missing.

Finally it also removes some duplicated code from mysql_create_like_table().

Note that, altough tests covering concurrency-related aspects of CREATE TABLE
LIKE behaviour will only be introduced in 5.1, they were run manually for
this patch as well.
2007-05-23 15:22:13 +04:00
svoj@june.mysql.com
442969fd16 Merge mysql.com:/home/svoj/devel/bk/mysql-5.1
into  mysql.com:/home/svoj/devel/mysql/merge/mysql-5.1-engines
2007-05-23 12:41:30 +05:00
tomas@whalegate.ndb.mysql.com
a4934466c0 Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-single-user
2007-05-22 23:21:32 +02:00
tsmith@quadxeon.mysql.com
672237f5b5 Merge quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/51
into  quadxeon.mysql.com:/benchmarks/ext3/TOSAVE/tsmith/bk/maint/51
2007-05-21 20:51:31 +02:00
svoj@mysql.com/june.mysql.com
fbb5c31aa9 BUG#25659 - memory leak via "plugins" test
- Added suppressions for dlopen to make plugin test pass.
- Do not pass empty string to mysqld, since my_getopt is
  not capable to handle it.
- Re-enabled trailing UNINSTALL PLUGIN statement of plugin.test.

The memory leak described in the bug report happens in libdl, not
in mysqld. On some valgrind installations this error is suppressed
by default, no idea why it isn't suppressed on pb-valgrind.

<observation>
If library remains open after thread has finished, and is closed by
another thread, we get memory leak. But in case library is opened and
closed by the same thread no leak occurs.
</observation>
2007-05-21 17:48:29 +05:00
svoj@june.mysql.com
404ee9d579 Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG28341/mysql-5.1-engines
2007-05-21 14:33:54 +05:00
tomas@whalegate.ndb.mysql.com
ffe2982b99 Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.1
into  whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-single-user
2007-05-21 09:01:06 +02:00
svoj@mysql.com/june.mysql.com
fbf65c86ea BUG#25659 - memory leak via "plugins" test
Re-enabled plugin test to check if it still leaks memory.
2007-05-21 11:48:05 +05:00
svoj@mysql.com/june.mysql.com
725d728f0e Addition to fix for
BUG#28341 - Security issue still in library loading

Added required option files to rpl_udf test.
2007-05-21 11:34:39 +05:00
msvensson@pilot.blaudden
45c202a3a3 Merge pilot.blaudden:/home/msvensson/mysql/bug28401/my50-bug28401
into  pilot.blaudden:/home/msvensson/mysql/bug28401/my51-bug28401
2007-05-19 18:15:40 +02:00
msvensson@pilot.blaudden
bc69d072f3 Bug #28401 mysql_upgrade Failed with STRICT_ALL_TABLES, ANSI_QUOTES and NO_ZERO_DATE
- The SQL commands used by mysql_upgrade are written to be run
    with sql_mode set to '' - thus the scripts should change sql_mode
    for the session to make sure the SQL is legal.
2007-05-19 18:15:08 +02:00
dlenev@mockturtle.local
43894d62f1 Merge bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  mockturtle.local:/home/dlenev/src/mysql-5.1-alter
2007-05-19 10:58:01 +04:00
dlenev@mockturtle.local
b0dfdc2b83 Patch changing how ALTER TABLE implementation handles table locking
and invalidation in the most general case (non-temporary table and
not simple RENAME or ENABLE/DISABLE KEYS or partitioning command).

See comment for sql/sql_table.cc for more information.

These changes are prerequisite for 5.1 version of fix for bug #23667
"CREATE TABLE LIKE is not isolated from alteration by other connections"
2007-05-19 10:49:56 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
e04000ec21 merging 2007-05-18 23:21:34 +05:00
holyfoot/hf@hfmain.(none)
44331376e7 Merge mysql.com:/d2/hf/mrg/mysql-5.0-opt
into  mysql.com:/d2/hf/mrg/mysql-5.1-opt
2007-05-18 22:12:06 +05:00
serg@sergbook.mysql.com
c7a4547361 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  sergbook.mysql.com:/usr/home/serg/Abk/mysql-5.0
2007-05-18 18:22:38 +02:00
serg@sergbook.mysql.com
11e5fa8f71 added cleanup to some tests 2007-05-18 17:48:44 +02:00
holyfoot/hf@hfmain.(none)
783c7071bf Merge bk@192.168.21.1:mysql-5.1
into  mysql.com:/d2/hf/mrg/mysql-5.1-opt
2007-05-18 20:04:01 +05:00
holyfoot/hf@hfmain.(none)
85d5dfedf6 Merge mysql.com:/d2/hf/mrg/mysql-5.0-opt
into  mysql.com:/d2/hf/mrg/mysql-5.1-opt
2007-05-18 20:00:49 +05:00
thek@adventure.(none)
783b1738c7 Merge adventure.(none):/home/thek/Development/cpp/bug26277/my51-bug26277
into  adventure.(none):/home/thek/Development/cpp/mysql-5.1-runtime
2007-05-18 14:29:24 +02:00
svoj@mysql.com/june.mysql.com
e3f7947da0 BUG#28341 - Security issue still in library loading
UDF can be created from any library in any part of the server
LD_LIBRARY_PATH.

Allow to load udfs only from plugin_dir.
On windows, refuse to open udf in case it's path contains a slash.

No good test case for this bug because of imperfect error message
that includes error code and error string when it fails to dlopen a
library.
2007-05-18 16:23:46 +05:00
msvensson@pilot.blaudden
cdef920866 Merge bk-internal:/home/bk/mysql-5.1-maint
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-new-maint
2007-05-18 13:01:05 +02:00
msvensson@pilot.blaudden
cea8860583 Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-new-maint
2007-05-18 12:58:05 +02:00
msvensson@pilot.blaudden
c3f407a07a Merge pilot.blaudden:/home/msvensson/mysql/mysql-4.1-maint
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
2007-05-18 12:56:52 +02:00
msvensson@pilot.blaudden
e05aa94353 WL#2247 mysqltest: add option for sorting results
- Final touchups
2007-05-18 12:50:23 +02:00
thek@adventure.(none)
637f85ca21 Bug#26277 User variable returns one type in SELECT @v and other for CREATE as SELECT @v
- Adding variable m_cached_result_type to keep the variable type consistent
  during the execution of a statement.
- Before each result set is returned to the client the description of each
  column is sent as meta data.
  Previously the result type for a column could change if the hash variable
  entry changed between statements. This caused the result set of the query
  to alternate column types in certain cases which is not supported by MySQL
  client-server protocol. Example:
  Previously this sequence:
    SET @a:=1;
    SELECT @a:="text", @a;
  would return "text", "text";
 
  After the change the SELECT returns "text", 0
  The reson for this is that previously the result set from 'SELECT @a;'
  would always be of the type STRING, whereas now the type of the variable
  is taken from the last SET statement. However, 'SELECT @a:="text"' will
  return type of STRING since the right side of the assignment is used.
2007-05-18 12:44:03 +02:00
evgen@moonbone.local
835189cb85 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  moonbone.local:/mnt/gentoo64/work/28261-bug-5.0-opt-mysql
2007-05-18 13:39:34 +04:00
kostja@vajra.(none)
943601fb0e Merge vajra.(none):/opt/local/work/mysql-5.0-runtime
into  vajra.(none):/opt/local/work/mysql-5.1-runtime
2007-05-18 12:33:12 +04:00
kostja@vajra.(none)
1016aa36ec Bug #27907 "Misleading error message when opening/locking tables"
Adjust the check that defines the error message to be returned.
2007-05-18 12:29:06 +04:00
igor@olga.mysql.com
2189c571b2 Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug28337
2007-05-17 16:06:57 -07:00
tsmith@siva.hindu.god
4a4590cd49 Merge siva.hindu.god:/home/tsmith/m/bk/51
into  siva.hindu.god:/home/tsmith/m/bk/maint/51
2007-05-17 14:21:35 -06:00
evgen@moonbone.local
0e3c4f6729 Bug#28261: Wrong DATETIME comparison result when the GET_USER_VAR function
is involved.

The Arg_comparator::compare_datetime() comparator caches its arguments if
they are constants i.e. const_item() returns true. The
Item_func_get_user_var::const_item() returns true or false based on
the current query_id and the query_id where the variable was created.
Thus even if a query can change its value its const_item() still will return
true. All this leads to a wrong comparison result when an object of the
Item_func_get_user_var class is involved.

Now the Arg_comparator::can_compare_as_dates() and the
get_datetime_value() functions never cache result of the GET_USER_VAR()
function (the Item_func_get_user_var class).
2007-05-17 23:09:45 +04:00
igor@olga.mysql.com
8c34ae268c Fixed bug #28337: wrong results for grouping queries with correlated
subqueries in WHERE conditions.
This bug was introduced by the patch for bug 27321.
2007-05-16 23:42:10 -07:00
holyfoot/hf@mysql.com/hfmain.(none)
4ac1e98630 Merge abotchkov@bk-internal.mysql.com:/home/bk/mysql-5.0-opt
into  mysql.com:/home/hf/work/8663/my50-8663
2007-05-17 00:10:39 +05:00
holyfoot/hf@mysql.com/hfmain.(none)
28eddbe12b Merge bk@192.168.21.1:mysql-5.0-opt
into  mysql.com:/home/hf/work/8663/my50-8663
2007-05-17 00:09:43 +05:00
holyfoot/hf@hfmain.(none)
cd4fbe116e Merge mysql.com:/home/hf/work/8663/my50-8663
into  mysql.com:/home/hf/work/8663/my51-8663
2007-05-16 23:01:21 +05:00
msvensson@pilot.blaudden
d5676f2feb WL#2247 mysqltest: add option for sorting results
- Change from "query_sorted <query>" to "sorted_results"
2007-05-16 17:19:36 +02:00
thek@adventure.(none)
6d6674e71f Merge kpettersson@bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  adventure.(none):/home/thek/Development/cpp/mysql-5.0-runtime
2007-05-16 14:54:47 +02:00
thek@adventure.(none)
06ce477223 Merge kpettersson@bk-internal.mysql.com:/home/bk/mysql-5.1-runtime
into  adventure.(none):/home/thek/Development/cpp/mysql-5.1-runtime
2007-05-16 14:51:01 +02:00
thek@adventure.(none)
0e82ce84c9 Merge adventure.(none):/home/thek/Development/cpp/bug27415/my50-bug27415
into  adventure.(none):/home/thek/Development/cpp/bug27415/my51-bug27415
2007-05-16 14:48:31 +02:00
thek@adventure.(none)
ed43ceb178 Bug#27415 Text Variables in stored procedures
- Problem was reported as a SP variable using itself as 
   right value inside SUBSTR caused corruption of data. 
 - This bug could not be verified in either 5.0bk or 5.1bk
 - Added test case to prevent future regressions.
2007-05-16 14:25:38 +02:00
kostja@vajra.(none)
35ad681618 An attempt to fix event_bugs.test failure on Debian
(Bug#26338 "events_bugs.test fail on Debian")
2007-05-16 16:01:14 +04:00
msvensson@pilot.blaudden
623d936038 Merge pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.1-new-maint
2007-05-16 12:50:24 +02:00
mhansson/martin@linux-st28.site
364014e455 Merge mhansson@bk-internal:/home/bk/mysql-5.0-opt
into  linux-st28.site:/home/martin/mysql/src/5.0o-bug27573
2007-05-16 12:22:20 +03:00
msvensson@pilot.blaudden
a65d12a830 Backport of TIME->MYSQL_TIME / Y2K fixset
Made year 2000 handling more uniform
Removed year 2000 handling out from calc_days()
The above removes some bugs in date/datetimes with year between 0 and 200
Now we get a note when we insert a datetime value into a date column
For default values to CREATE, don't give errors for warning level NOTE
Fixed some compiler failures
Added library ws2_32 for windows compilation (needed if we want to compile with IOCP support)
Removed duplicate typedef TIME and replaced it with MYSQL_TIME

Better (more complete) fix for: Bug#21103 "DATE column not compared as DATE"
Fixed properly Bug#18997 "DATE_ADD and DATE_SUB perform year2K autoconversion magic on 4-digit year value"
Fixed Bug#23093 "Implicit conversion of 9912101 to date does not match cast(9912101 as date)"
2007-05-16 10:44:59 +02:00
kostja@vajra.(none)
e1218d0e75 Merge vajra.(none):/opt/local/work/mysql-5.0-21483
into  vajra.(none):/opt/local/work/mysql-5.1-21483
2007-05-16 10:21:39 +04:00
kostja@vajra.(none)
f10effe402 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  vajra.(none):/opt/local/work/mysql-5.0-21483
2007-05-16 09:52:01 +04:00