Commit graph

36544 commits

Author SHA1 Message Date
dkatz@damien-katzs-computer.local
c21c22d85f Merge damien-katzs-computer.local:/Users/dkatz/mysql50
into  damien-katzs-computer.local:/Users/dkatz/50_div_zero
2007-05-17 16:07:44 -04: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
tsmith@siva.hindu.god
2703da69ff ps_6bdb.result:
Fix bad merge of test results
2007-05-17 12:55:59 -06:00
svoj@mysql.com/june.mysql.com
8a809def0a Merge mysql.com:/home/svoj/devel/mysql/BUG25712/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG25712/mysql-5.0-engines
2007-05-17 15:27:56 +05:00
svoj@mysql.com/june.mysql.com
f6a111dfef Addition to fix for
BUG#25712 - insert delayed and check table run together report crashed
            tables
Fixed wrongly applied patch.
2007-05-17 15:23:59 +05:00
svoj@mysql.com/june.mysql.com
cc9d6534e8 Merge mysql.com:/home/svoj/devel/mysql/BUG25712/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG25712/mysql-5.0-engines
2007-05-17 12:48:10 +05:00
svoj@mysql.com/june.mysql.com
4f11124c48 Addition to fix for
BUG#25712 - insert delayed and check table run together report
            crashed tables

Let MY_THREADSAFE have distinct value. Some functions call my_seek
passing MyFlags argument directly to it. This may cause unnecessary
locks, which may finally lead to a dead-lock (specifically see my_lock).
2007-05-17 12:43:52 +05: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
dkatz@damien-katzs-computer.local
41dac22271 Bug #27119 server crash with integer division by zero during filesort on huge result
Added checks to detect integer overflow and fixed other bugs on the error path.
2007-05-16 16:14:13 -04:00
svoj@mysql.com/april.(none)
bf473b1069 Merge mysql.com:/home/svoj/devel/mysql/BUG25712/mysql-4.1-engines
into  mysql.com:/home/svoj/devel/mysql/BUG25712/mysql-5.0-engines
2007-05-17 00:40:26 +05:00
joerg@trift2.
c90682326e Merge jbruehe@bk-internal.mysql.com:/home/bk/mysql-5.0-build
into  trift2.:/MySQL/M50/push-5.0
2007-05-16 21:24:54 +02:00
joerg@trift2.
a231b0574b Merge trift2.:/MySQL/M50/mysql-5.0
into  trift2.:/MySQL/M50/push-5.0
2007-05-16 21:23:15 +02: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
svoj@mysql.com/april.(none)
3ea2ee357b BUG#25712 - insert delayed and check table run together report crashed
tables

In case system doesn't have native pread/pwrite calls (e.g. Windows)
and there is CHECK TABLE runs concurrently with another statement that
reads from a table, the table may be reported as crashed.

This is fixed by locking file descriptor when my_seek is executed on
MyISAM index file and emulated pread/pwrite may be executed concurrently.

Affects MyISAM tables on platforms that do not have native
pread/pwrite calls (e.g. Windows).

No deterministic test case for this bug.
2007-05-16 23:42:32 +05:00
msvensson@pilot.blaudden
4998976d22 Bug#28473 Does mysql-test-run.pl handle LD_LIBRARY_PATH wrong ?
- Fix spelling error
2007-05-16 17:51:28 +02:00
df@pippilotta.erinye.com
5e541e98a2 Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-4.1-build
into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build
2007-05-16 17:27:30 +02:00
df@pippilotta.erinye.com
fbd59055ec Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-4.1-build-work
into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-4.1-build
2007-05-16 17:26:55 +02:00
df@pippilotta.erinye.com
3bff0c581c Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build-work
into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build
2007-05-16 17:26:18 +02: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
df@pippilotta.erinye.com
4e0af1afdc Merge bk-internal:/home/bk/mysql-5.0-runtime
into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build
2007-05-16 17:13:42 +02:00
df@pippilotta.erinye.com
a645ef0480 Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0
into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build
2007-05-16 17:07:34 +02:00
msvensson@pilot.blaudden
4fed3bd425 Merge pilot.blaudden:/home/msvensson/mysql/mysql-4.1-maint
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
2007-05-16 16:31:05 +02:00
msvensson@pilot.blaudden
8e9149ea11 Bug#28470 mysqltest scripts need to know protocol 2007-05-16 16:30:26 +02:00
df@pippilotta.erinye.com
2ea846c533 Merge pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build
into  pippilotta.erinye.com:/shared/home/df/mysql/build/mysql-5.0-build-work
2007-05-16 16:04:42 +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)
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
msvensson@pilot.blaudden
290b975043 Bug#21103: "DATE column not compared as DATE"
BDB results fixed (not p/o 5.1 fix)
2007-05-16 14:00:47 +02:00
msvensson@pilot.blaudden
3d723860c7 Merge pilot.blaudden:/home/msvensson/mysql/bk_fix/mysql-5.0-maint-patch4
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
2007-05-16 12:49:15 +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
msvensson@pilot.blaudden
ab61cfcb2c Merge pilot.blaudden:/home/msvensson/mysql/bk_fix/mysql-5.0-maint-patch3
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
2007-05-16 10:17:26 +02:00
msvensson@pilot.blaudden
19618b5375 Merge bk-internal:/home/bk/mysql-5.0-maint
into  pilot.blaudden:/home/msvensson/mysql/mysql-5.0-maint
2007-05-16 10:15:21 +02:00
msvensson@pilot.blaudden
e888128e88 Bug#28223: mysqldump --compact --routines restores from @OLD_SQL_MODE w/o ever setting it
- mysqldump generated output that set OLD_SQL_MODE twice, to different values
    (for triggers), or not at all (for routines) in some cases.
2007-05-16 10:14:29 +02:00
msvensson@pilot.blaudden
47d3829f0b Fix for bug #28240: "isinf()" cannot be used in C++ for lack of prototype
- Since isinf() portability across various platforms and
  compilers is a complicated question, we should not use
  it directly. Instead, the my_isinf() macro should be used,
  which is defined as an alias to the system-defined isinf()
  if it is safe to use, or a workaround implementation otherwise
2007-05-16 10:10:02 +02:00
kostja@vajra.(none)
bb2a43dd19 Fix a failing assert. 2007-05-16 11:49:15 +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
kostja@vajra.(none)
747842e10b A fix and a test case for
Bug#21483 "Server abort or deadlock on INSERT DELAYED with another
implicit insert"
Also fixes and adds test cases for bugs:
20497 "Trigger with INSERT DELAYED causes Error 1165"
21714 "Wrong NEW.value and server abort on INSERT DELAYED to a
table with a trigger".
Post-review fixes.

Problem:
In MySQL INSERT DELAYED is a way to pipe all inserts into a
given table through a dedicated thread. This is necessary for
simplistic storage engines like MyISAM, which do not have internal
concurrency control or threading and thus can not
achieve efficient INSERT throughput without support from SQL layer.
DELAYED INSERT works as follows:
For every distinct table, which can accept DELAYED inserts and has
pending data to insert, a dedicated thread is created to write data
to disk. All user connection threads that attempt to
delayed-insert into this table interact with the dedicated thread in
producer/consumer fashion: all records to-be inserted are pushed
into a queue of the dedicated thread, which fetches the records and 
writes them.
In this design, client connection threads never open or lock
the delayed insert table.
This functionality was introduced in version 3.23 and does not take 
into account existence of triggers, views, or pre-locking.
E.g. if INSERT DELAYED is called from a stored function, which,
in turn, is called from another stored function that uses the delayed
table, a deadlock can occur, because delayed locking by-passes
pre-locking. Besides:
 * the delayed thread works directly with the subject table through
   the storage engine API and does not invoke triggers
 * even if it was patched to invoke triggers, if triggers,
   in turn, used other tables, the delayed thread would
   have to open and lock involved tables (use pre-locking).
 * even if it was patched to use pre-locking, without deadlock
   detection the delayed thread could easily lock out user 
   connection threads in case when the same table is used both
   in a trigger and on the right side of the insert query: 
   the delayed thread would not release locks until all inserts 
   are complete, and user connection can not complete inserts 
   without having locks on the tables used on the right side of the
   query.

Solution:

These considerations suggest two general alternatives for the
future of INSERT DELAYED:
 * it is considered a full-fledged alternative to normal INSERT
 * it is regarded as an optimisation that is only relevant 
   for simplistic engines.
Since we missed our chance to provide complete support of new
features when 5.0 was in development, the first alternative
currently renders infeasible.
However, even the second alternative, which is to detect
new features and convert DELAYED insert into a normal insert, 
is not easy to implement.
The catch-22 is that we don't know if the subject table has triggers
or is a view before we open it, and we only open it in the
delayed thread. We don't know if the query involves pre-locking
until we have opened all tables, and we always first create
the delayed thread, and only then open the remaining tables.
This patch detects the problematic scenarios and converts
DELAYED INSERT to a normal INSERT using the following approach:
 * if the statement is executed under pre-locking (e.g. from
   within a stored function or trigger) or the right
   side may require pre-locking, we detect the situation
   before creating a delayed insert thread and convert the statement
   to a conventional INSERT.
  * if the subject table is a view or has triggers, we shutdown
   the delayed thread and convert the statement to a conventional
   INSERT.
2007-05-16 09:51:05 +04:00
holyfoot/hf@mysql.com/hfmain.(none)
bb089cea38 bug #8663 cant use bigint unsigned as input to cast
in the case of the overflow in the decimal->integer conversion
we didn't return the proper boundary value, but just the result
of the conversion we calculated on the moment of the error
2007-05-16 10:12:49 +05:00
igor@olga.mysql.com
8b829fb1ae Merge olga.mysql.com:/home/igor/mysql-5.0-opt
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug28272
2007-05-15 14:14:52 -07:00
evgen@moonbone.local
fbb2332628 Bug#28208: Wrong result of a non-const STRING function with a const DATETIME
function.

A wrong  condition was used to check that the
Arg_comparator::can_compare_as_dates() function calculated the value of the
string constant. When comparing a non-const STRING function with a constant
DATETIME function it leads to saving an arbitrary value as a cached value of
the DATETIME function.

Now the Arg_comparator::set_cmp_func() function initializes the const_value
variable to the impossible DATETIME value (-1) and this const_value is
cached only if it was changed by the Arg_comparator::can_compare_as_dates()
function.
2007-05-16 00:30:12 +04:00
igor@olga.mysql.com
fea67e6868 Merge olga.mysql.com:/home/igor/dev-opt/mysql-4.1-opt-bug28272
into  olga.mysql.com:/home/igor/dev-opt/mysql-5.0-opt-bug28272
2007-05-15 13:16:10 -07:00
iggy@amd64.(none)
1a2e798a70 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-maint
into  amd64.(none):/src/bug24732/my50-bug24732
2007-05-15 15:23:40 -04:00
joerg@trift2.
ae801bb0ae Fix bug#27833 "Bourne shell string comparison issue in scripts/make_win_bin_dist":
Several string comparisons could never yield true because they had an 'x' guard
added to the variable but not to the constant value. Fix that by guarding both sides.
2007-05-15 18:19:18 +02:00
msvensson@pilot.blaudden
a0b1e5406d Add triggers for detecting bad changesets to mysql-5.0 2007-05-15 17:04:31 +02:00
iggy@amd64.(none)
3f4138a519 Bug#24732 Executables do not include Vista manifests
- Manifest requires four part application version.
- mysqld does not need requireAdministrator rights 
to run.
2007-05-15 10:30:11 -04:00
msvensson@pilot.blaudden
da8a944dfb Bug#27344 Total failure to start the server
- Give some more protection against "too long socket name by setting the max
   length when to use a tmpdir for sockets to 70
2007-05-15 16:03:38 +02:00
mhansson/martin@linux-st28.site
5bc137ff17 Bug#27573: MIN() on an indexed column which is always NULL sets _other_ results
to NULL

For queries of the form SELECT MIN(key_part_k) FROM t1 
WHERE key_part_1 = const and ... and key_part_k-1 = const,
the opt_sum_query optimization tries to
use an index to substitute MIN/MAX functions with their values according
to the following rules:
1) Insert the minimum non-null values where the WHERE clause still matches, or
3) A row of nulls

However, the correct semantics requires that there is a third case 2)
such that a NULL value is substituted if there are only NULL values for 
key_part_k.

The patch modifies opt_sum_query() to handle this missing case.
2007-05-15 15:29:12 +03:00
tomas@whalegate.ndb.mysql.com
17944acee2 add error code to ndb require 2007-05-15 12:07:09 +02:00
tomas@whalegate.ndb.mysql.com
3083443262 improve error message on corrup schema file 2007-05-15 12:02:58 +02:00