Commit graph

17612 commits

Author SHA1 Message Date
Davi Arnaut
cc95555fbc Post-merge fix for Bug#36326 2009-01-15 11:38:49 -02:00
Davi Arnaut
cf5dd72ee0 Merge from 5.0-bugteam 2009-01-15 08:28:10 -02:00
Alexander Nozdrin
50a8cdc6c8 Pull from 5.0-bugteam 2009-01-15 13:10:20 +03:00
Alexander Nozdrin
6dd7ac74dd Merge backport of patch for Bug#31222 from 5.0 to 5.1 2009-01-15 12:56:05 +03:00
Alexander Nozdrin
333aa975ec Backport patch for Bug#31222 (com_% global status counters behave randomly
with mysql_change_user) to 5.0.
2009-01-15 12:36:34 +03:00
Ramil Kalimullin
2dba01b2fa bug#33094: Error in upgrading from 5.0 to 5.1 when table contains triggers
Post-fix test failure: fixed mysqlcheck.test on Windows platforms.
2009-01-15 00:54:25 +04:00
Ramil Kalimullin
347762946e Fix for
bug#33094: Error in upgrading from 5.0 to 5.1 when table contains
triggers
and
#41385: Crash when attempting to repair a #mysql50# upgraded table
with triggers.

Problem:
1. trigger code didn't assume a table name may have
a "#mysql50#" prefix, that may lead to a failing ASSERT().
2. "ALTER DATABASE ... UPGRADE DATA DIRECTORY NAME" failed
for databases with "#mysql50#" prefix if any trigger.
3. mysqlcheck --fix-table-name didn't use UTF8 as a default
character set that resulted in (parsing) errors for tables with
non-latin symbols in their names and definitions of triggers.

Fix:
1. properly handle table/database names with "#mysql50#" prefix.
2. handle --default-character-set mysqlcheck option;
if mysqlcheck is launched with --fix-table-name or --fix-db-name
set default character set to UTF8 if no --default-character-set
option given.

Note: if given --fix-table-name or --fix-db-name option,
without --default-character-set mysqlcheck option
default character set is UTF8.
2009-01-14 18:50:51 +04:00
Davi Arnaut
918a038165 Bug#36326: nested transaction and select
The problem is that the query cache stores packets containing
the server status of the time when the cached statement was run.
This might lead to a wrong transaction status in the client side
if a statement is cached during a transaction and is later served
outside a transaction context (and vice-versa).

The solution is to take into account the transaction status when
storing in and serving from the query cache.
2009-01-13 20:07:06 -02:00
Matthias Leich
33d2ae1512 Merge into actual tree 2009-01-13 16:42:37 +01:00
Matthias Leich
50ad9d1fca Merge of fix for bug
41776 type_date.test may fail if run around midnight.
into GCA tree.
2009-01-13 15:04:28 +01:00
Matthias Leich
f557d37762 Merge of fix for bug
41111 events_bugs fails sporadically on pushbuild
into GCA tree
2009-01-13 14:39:04 +01:00
Matthias Leich
d657438ea0 Fix for Bug#40377 sporadic pushbuild failure in log_state: result mismatch
+ add workaround for bug 38124
+ messages into the protocol when sessions are switched
+ replace error numbers by error names
+ reset of system variables to initial values per subtest
+ remove a file created by this test
+ minor improvements in structure and formatting
2009-01-13 14:09:24 +01:00
Georgi Kodinov
ba506ca6b7 merged 41453 to 5.1-bugteam 2009-01-12 17:52:46 +02:00
Davi Arnaut
a13eda38ae Post-merge fix for bug 37016: Update test case for row-based logging. 2009-01-12 10:48:33 -02:00
Tatiana A. Nurnberg
a7d03bf4ed Bug#31177: Server variables can't be set to their current values
Bounds-checks and blocksize corrections were applied to user-input,
but constants in the server were trusted implicitly. If these values
did not actually meet the requirements, the user could not set change
a variable, then set it back to the (wonky) factory default or maximum
by explicitly specifying it (SET <var>=<value> vs SET <var>=DEFAULT).

Now checks also apply to the server's presets. Wonky values and maxima
get corrected at startup. Consequently all non-offsetted values the user
sees are valid, and users can set the variable to that exact value if
they so desire.
2009-01-12 06:32:49 +01:00
Tatiana A. Nurnberg
2048bd7117 auto-merge 2009-01-09 23:06:07 +01:00
Tatiana A. Nurnberg
d58db1c2b0 auto-merge 2009-01-09 22:26:51 +01:00
Georgi Kodinov
18526afc07 merged 41437 to 5.1-bugteam 2009-01-09 19:51:52 +02:00
Tatiana A. Nurnberg
108f8d75a1 auto-merge 2009-01-09 16:48:02 +01:00
Matthias Leich
c6d81f8467 1. Fix for Bug#41111 events_bugs fails sporadically on pushbuild
2. Avoid bad effects of bug 41925 Warning 1366 Incorrect string value:
                                  ...  for column processlist.info
3. Add poll routines which ensure that subtests meet stable scenarios.
   This does not change the sense of the subtests.
2009-01-09 15:10:03 +01:00
Tatiana A. Nurnberg
1d15df432e auto-merge 2009-01-09 14:22:15 +01:00
Georgi Kodinov
53ba196e11 Bug #41543: Assertion `m_status == DA_ERROR' failed in Diagnostics_area::sql_errno
No need to mask the error code returned by getting the next row to end of file when
doing filesort.
2009-01-09 14:04:47 +02:00
Georgi Kodinov
7c3ae51647 Bug #41437: Value stored in 'case' lacks charset, causes segfault
When substituting system constant functions with a constant result
the server was not expecting that the function may return NULL.
Fixed by checking for NULL and returning Item_null (in the relevant
collation) if the result of the system constant function was NULL.
2009-01-09 13:50:18 +02:00
Davi Arnaut
577e390ece Bug#37016: TRUNCATE TABLE removes some rows but not all
The special TRUNCATE TABLE (DDL) transaction wasn't being properly
rolled back if a error occurred during row by row deletion. The
error can be caused by a foreign key restriction imposed by InnoDB
SE and would cause the server to erroneously issue a implicit
commit.

The solution is to rollback the transaction if a truncation via row
by row deletion fails, otherwise commit. All effects of a TRUNCATE 
ABLE operation are rolled back if a row by row deletion fails.
2009-01-09 08:20:32 -02:00
Davi Arnaut
8ce156a66f Auto-merge from upstream 5.1-bugteam 2009-01-08 16:28:30 -02:00
Tatiana A. Nurnberg
17bbe30cb0 Bug#41470: DATE_FORMAT() crashes the complete server with a valid date
Passing dubious "year zero" in non-zero date (not "0000-00-00") could
lead to negative value for year internally, while variable was unsigned.
This led to Really Bad Things further down the line.

Now doing calculations with signed type for year internally.
2009-01-08 10:25:31 +01:00
Mattias Jonsson
f1ab632391 merge 2009-01-07 23:28:49 +01:00
Davi Arnaut
dc5a0f4481 Bug#41348: INSERT INTO tbl SELECT * FROM temp_tbl overwrites
locking type of temp table

The problem is that INSERT INTO .. SELECT FROM .. and CREATE
TABLE .. SELECT FROM a temporary table could inadvertently
overwrite the locking type of the temporary table. The lock
type of temporary tables should be a write lock by default.

The solution is to reset the lock type of temporary tables
back to its default value after they are used in a statement.
2009-01-07 10:11:37 -02:00
Georgi Kodinov
645b4862c9 merged 5.0-bugteam -> 5.1-bugteam 2009-01-05 20:47:28 +02:00
Georgi Kodinov
e56284128f Reverted the fix for bug #25830 because of omissions and non-complete test
case.
2009-01-05 12:37:56 +02:00
Gleb Shchepa
33cbf93ced Bug #41363: crash of mysqld on windows with aggregate in case
Execution of queries containing the CASE function of
aggregate function like in "SELECT ... CASE ARGV(...) WHEN ..."
crashed the server.


The CASE function caches pointers to concrete comparison
functions for an each pair of types of CASE-WHERE clause
parameters, i.e. for the "CASE INT_RESULT WHERE REAL_RESULT
THEN ... WHERE DECIMAL_RESULT ... END" function call it
caches comparisons for INT_RESULT with REAL_RESULT and
for INT_RESULT with DECIMAL_RESULT. Usually a result
type is known after a call to the fix_fields function,
however, the setup_copy_fields function call may
wrap aggregate items with Item_copy_string that has
STRING_RESULT result type, so setup_copy_fields may
change argument result types of the CASE function after
call to Item_func_case::fix_fields/fix_length_and_dec.
Then the Item_func_case::find_item function tries to
use comparison function for unexpected pair of the
STRING_RESULT and some other type - that caused
an assertion failure of server crash.

The Item_func_case::fix_length_and_dec function has
been modified to take into account possible STRING_RESULT
result type in the presence of aggregate arguments of
the CASE function.
2008-12-31 15:55:04 +04:00
Tatiana A. Nurnberg
cd42736346 auto-merge 2008-12-30 12:48:38 +01:00
Tatiana A. Nurnberg
4c788d93b1 auto-merge 2008-12-30 12:47:34 +01:00
Sergey Glukhov
c9245922d6 Bug#41441 repair csv table crashes debug server
The problem: data file can not be deleted on win because
there is another opened instance of this file.
Data file might be opened twice, on table opening stage and
during write_row execution. We need to close both instances
to satisfy Win.
2008-12-29 16:50:51 +04:00
Sergey Glukhov
51b78382cd 5.0-bugteam->5.1-bugteam merge 2008-12-29 16:15:48 +04:00
Sergey Glukhov
f67ce47617 Bug#41131 "Questions" fails to increment - ignores statements instead stored procs(5.0 ver)
Added global status variable 'Queries' which represents
total amount of queries executed by server including
statements executed by SPs.
note: It's old behaviour of 'Questions' variable.
2008-12-29 16:06:53 +04:00
Mattias Jonsson
7ac7726509 Bug#40972: some sql execution lead the whole databse crashing
Problem was an errornous date that lead to end partition
was before the start, leading to a crash.

Solution was to check greater or equal instead of only
equal between start and end partition.

NOTE: partitioning pruning handles incorrect dates
differently than index lookup, which can give different
results in a partitioned table versus a non partitioned
table for queries having 'bad' dates in the where clause.
2008-12-28 12:33:49 +01:00
Sergey Glukhov
5ac5774977 5.0-bugteam->5.1-bugteam merge 2008-12-24 19:26:48 +04:00
Sergey Glukhov
a31795b82d Bug#40953 SELECT query throws "ERROR 1062 (23000): Duplicate entry..." error
Table could be marked dependent because it is
either 1) an inner table of an outer join, or 2) it is a part of
STRAIGHT_JOIN. In case of STRAIGHT_JOIN table->maybe_null should not
be assigned. The fix is to set st_table::maybe_null to 'true' only
for those tables which are used in outer join.
2008-12-24 19:24:11 +04:00
Sergey Glukhov
d23d1b4b8b 5.0-bugteam->5.1-bugteam merge 2008-12-24 19:16:50 +04:00
Sergey Glukhov
026e9c3676 Bug#41456 SET PASSWORD hates CURRENT_USER()
init user->user struct with 
thd->security_ctx->priv_user context
if user->user is not initializied
2008-12-24 19:14:59 +04:00
Sergey Glukhov
eec8f7c3f6 5.0-bugteam->5.1-bugteam merge 2008-12-24 19:09:00 +04:00
Sergey Glukhov
59543e9f80 Bug#25830 SHOW TABLE STATUS behaves differently depending on table name
replace wild_case_compare with my_wildcmp which is multibyte safe function
2008-12-24 19:01:41 +04:00
Sergey Glukhov
c61c1a0d60 Bug#40104 regression with table names?
On Winodws FN_DEVCHAR is ':' symbol.
There is a check in mysql_create_table_no_lock() func
on FN_DEVCHAR presence but this code is obsolete and
unnecessary. So the fix is to remove unnecessary code.
2008-12-23 19:33:46 +04:00
Sergey Glukhov
429409eb19 5.0-bugteam->5.1-bugteam merge 2008-12-23 18:21:01 +04:00
Sergey Glukhov
26e804d0a7 Bug#37575 UCASE fails on monthname
The MONTHNAME/DAYNAME functions
returns binary string, so the LOWER/UPPER functions
are not effective on the result of MONTHNAME/DAYNAME call.  
Character set of the MONTHNAME/DAYNAME function
result has been changed to connection character set.
2008-12-23 18:08:04 +04:00
Sergey Petrunia
adf8aaca5b Merge: mysql-5.0-bugteam -> mysql-5.1-bugteam 2008-12-23 16:28:13 +03:00
Sergey Vojtovich
6291fa6f4f Merge. 2008-12-23 15:06:30 +04:00
Sergey Petrunia
6147201a17 Merge 2008-12-22 23:28:08 +03:00
Matthias Leich
b82383b8d0 Merge into actual tree 2008-12-19 17:42:52 +01:00