The bug report has demonstrated the following two problems.
1. If an ORDER/GROUP BY list includes a constant expression being
optimized away and, at the same time, containing single-row
subselects that return more that one row, no error is reported.
Strictly speaking the standard allows to ignore error in this case.
Yet, now a corresponding fatal error is reported in this case.
2. If a query requires sorting by expressions containing single-row
subselects that, however, return more than one row, then the execution
of the query may cause a server crash.
To fix this some code has been added that blocks execution of a subselect
item in case of a fatal error in the method Item_subselect::exec.
mysql-test/r/subselect.result:
Added a test cases for bug #24653.
mysql-test/t/subselect.test:
Added a test cases for bug #24653.
sql/filesort.cc:
Fixed bug #24653.
Added a check for fatal error after reading the next row from the table
in the function find_all_keys.
sql/item.cc:
Fixed bug #24653.
Down-ported calculation of the attribute with_subselect of for Item objects.
sql/item.h:
Fixed bug #24653.
Down-ported calculation of the attribute with_subselect of for Item objects.
sql/item_cmpfunc.cc:
Fixed bug #24653.
Down-ported calculation of the attribute with_subselect of for Item objects.
sql/item_cmpfunc.h:
Fixed bug #24653.
Down-ported calculation of the attribute with_subselect of for Item objects.
sql/item_func.cc:
Fixed bug #24653.
Down-ported calculation of the attribute with_subselect of for Item objects.
sql/item_subselect.cc:
Fixed bug #24653.
Added a check for fatal error in the method Item_subselect::exec
to block evaluation of subselects in erroneous situations.
Down-ported calculation of the attribute with_subselect of for Item objects.
sql/sql_select.cc:
Fixed bug #24653.
Added a check to verify that any constant expression used
in ORDER BY and/or GROUP BY lists which is optimized away
does not contain subselects returning more than one row.
If it does a fatal error is reported.
Move get_thread_lib to mysys/my_pthread.c
Set 'thr_client_alarm' to signal number used by thr_alarm to give alarms
include/my_global.h:
Fixed to be same as in 5.1
include/my_pthread.h:
Move things around to be more in line with rest of code
include/thr_alarm.h:
extern of thr_client_alarm
mysys/default.c:
Fixed two wrong pointer incrementations.
mysys/my_pthread.c:
Cleanup: Use variable thr_client_alarm
mysys/my_thr_init.c:
Detect thread library at startup
mysys/thr_alarm.c:
Set thr_client_alarm depending on which thread library we are using
sql/mysqld.cc:
Move get_thread_lib to mysys/my_pthread.c
Fixed test. On 32-bit machines which compile without
-DBIG_TABLES, MAX_ROWS is truncated to a 32-bit value.
Using a value below 4G is portable.
mysql-test/r/myisam.result:
Bug#24607 - MyISAM pointer size determined incorrectly
Fixed test results.
The bug is actually a duplicate of the bug 14708.
Down-ported the fix for 14708 from 5.0.
Merged the test case for bug 14708 from 5.0.
mysql-test/r/fulltext_left_join.result:
Added a test case for bug #25637 (duplicate .of bug 14708).
Merged the test case for bug 14708 from 5.0.
mysql-test/t/fulltext_left_join.test:
Added a test case for bug #25637 (duplicate of bug 14708).
Merged the test case for bug 14708 from 5.0.
sql/item_func.cc:
Fixed bug #25637: LEFT JOIN with BOOLEAN FULLTEXT loses left table matches.
The bug is actually a duplicate of the bug 14708.
Down-ported the fix for 14708 from 5.0.
into kahlann.erinye.com:/home/df/mysql/build/mysql-4.1-build-work
BUILD/check-cpu:
Auto merged
mysql-test/mysql-test-run.pl:
Auto merged
mysql-test/t/myisam.test:
Auto merged
corrupted table
Accessing a table with corrupted column definition results in server
crash.
This is fixed by refusing to open such tables. Affects MyISAM only.
No test case, since it requires crashed table.
myisam/mi_open.c:
Refuse to open MyISAM table with summary columns length bigger than
length of the record.
Fixes:
- Bug #24299:
- Bug #25596:
innobase/dict/dict0dict.c:
Applied innodb-4.1-ss36 and innodb-4.1-ss38 snapshots
Revision r36:
innodb-4.1: Port r1030 from innodb/branches/5.0:
Replace isspace() with a wrapper ib_isspace(), because on
Win32 isspace(0xa0) appears to hold. (Bug #24299)
Revision r38:
ib_isspace(c): Check for c being the null character. (Bug #25596)
into a88-113-38-195.elisa-laajakaista.fi:/home/my/bk/mysql-4.1
include/thr_alarm.h:
Auto merged
mysys/my_pthread.c:
Auto merged
BUILD/SETUP.sh:
Merged from 4.0
configure.in:
Merged from 4.0
include/my_global.h:
Merged from 4.0
include/my_pthread.h:
Merged from 4.0
mysys/thr_alarm.c:
Merged from 4.0
sql/mysqld.cc:
Merged from 4.0
BUILD/SETUP.sh.rej:
Merged from 4.0
configure.in.rej:
Merged from 4.0
include/my_global.h.rej:
Merged from 4.0
include/my_pthread.h.rej:
Merged from 4.0
mysys/thr_alarm.c.rej:
Merged from 4.0
sql/mysqld.cc.rej:
Merged from 4.0
Fix to check library in use during runtime.
Fix for Bug#16995, "idle connections not being killed due to timeout when NPTL is used".
BUILD/SETUP.sh:
To avoid warnings during compilation.
configure.in:
Fixed configure so that it can correctly detect
between NPTL and Linuxthreads.
include/my_global.h:
Fix for Linuxthreads.
include/my_pthread.h:
Added defines for different libraries that can be detected.
Currently only 'other', 'nptl', and 'lt' (linuxthreads) are
being used.
changed sigset() and signal() to my_sigset() and my_signal()
include/thr_alarm.h:
Removed defines for Linuxthreads. This is now detected during
runtime and handled in the thr_alarm.c
mysys/my_pthread.c:
Runtime check for library.
mysys/thr_alarm.c:
Runtime checks for library and corresponding
signals.
sql/mysqld.cc:
Added function for detecting thread library in use
during start-up.
THR_KILL_SIGNAL removed, setting signals during runtime.
files. This helps stability of multiple parallel automated test runs,
avoiding the situation where one bad build fills up disk with 1000s of
core files, causing failures in other test runs.
WL#3681 (ALTER TABLE ORDER BY)
Before this fix, the ALTER TABLE statement implemented an ORDER BY option
with the following characteristics :
1) The order by clause accepts a list of criteria, with optional ASC or
DESC keywords
2) Each criteria can be a general expression, involving operators,
native functions, stored functions, user defined functions, subselects ...
With this fix :
1) has been left unchanged, since it's a de-facto existing feature,
that was already present in the code base and partially covered in the test
suite. Code coverage for ASC and DESC was missing and has been improved.
2) has been changed to limit the kind of criteria that are permissible:
now only a column name is valid.
mysql-test/r/alter_table.result:
Prevent ALTER TABLE ORDER BY clauses to use general expressions.
mysql-test/t/alter_table.test:
Prevent ALTER TABLE ORDER BY clauses to use general expressions.
sql/sql_yacc.yy:
Prevent ALTER TABLE ORDER BY clauses to use general expressions.
configure.in:
Added variables to support ndbclient library versioning.
Set version to 1.0.0 for 4.1
ndb/src/Makefile.am:
Making use of new variables. Adding support for versioned libraries.
mysql-test/r/ndb_types.result:
update results
mysql-test/t/ndb_types.test:
Sleep a bit longer, to ensure that timestamp changes between:
set @now = now();
and:
insert into/update t1
Test case failed (select timestamp>@now from t1 ==> 0, should be 1), and passed when run again. This should(?) avoid that fluke.
Clean up test file a bit while I'm here.
into siva.hindu.god:/home/tsmith/m/bk/mrg-jan17/41
innobase/buf/buf0buf.c:
Use local
innobase/buf/buf0flu.c:
Use local
innobase/buf/buf0lru.c:
Use local
innobase/include/buf0buf.h:
Use local
innobase/include/buf0buf.ic:
Use local
innobase/include/sync0arr.h:
Use local
innobase/include/sync0rw.h:
Use local
innobase/include/sync0rw.ic:
Use local
innobase/include/sync0sync.h:
Use local
innobase/os/os0sync.c:
Use local
innobase/sync/sync0arr.c:
Use local
innobase/sync/sync0rw.c:
Use local
innobase/sync/sync0sync.c:
Use local
hyphen in it (like ds-cpl).
convert illegal chars in cpu flags to '_' for variable assignment
BUILD/check-cpu:
convert illegal chars in cpu flags to '_' for variable assignment