Commit graph

785 commits

Author SHA1 Message Date
ingo@mysql.com
d27a15a81c Bug#16986 - Deadlock condition with MyISAM tables
Addendum fixes after changing the condition variable
for the global read lock.

The stress test suite revealed some deadlocks. Some were
related to the new condition variable (COND_global_read_lock)
and some were general problems with the global read lock.

It is now necessary to signal COND_global_read_lock whenever 
COND_refresh is signalled.

We need to wait for the release of a global read lock if one 
is set before every operation that requires a write lock.
But we must not wait if we have locked tables by LOCK TABLES.
After setting a global read lock a thread waits until all
write locks are released.
2006-06-26 19:14:35 +02:00
svoj@may.pils.ru
77ab3b28a7 BUG#19192 - CHECK TABLE EXTENDED / REPAIR TABLE show no errors.
ALTER TABLE crashes
Executing fast alter table (one that doesn't need to copy data)
on tables created by mysql versions prior to 4.0.25 could result
in posterior server crash when accessing these tables.

There was a bug prior to mysql-4.0.25. Number of null fields was
calculated incorrectly. As a result frm and data files gets out of
sync after fast alter table. There is no way to determine by which
mysql version (in 4.0 and 4.1 branches) table was created, thus we
disable fast alter table for all tables created by mysql versions
prior to 5.0 branch.
See BUG#6236.
2006-06-01 18:08:57 +05:00
gluh@eagle.intranet.mysql.r18.ru
ae72df07f2 Bug#17204 "second CALL to procedure crashes Server"
Bug#18282 "INFORMATION_SCHEMA.TABLES provides inconsistent info about invalid views"
This bug caused crashes or resulted in wrong data being returned
when one tried to obtain information from I_S tables about views
using stored functions.

It was caused by the fact that we were using LEX representing
statement which were doing select from I_S tables as active LEX
when contents of I_S table were built. So state of this LEX both
affected and was affected by open_tables() calls which happened
during this process. This resulted in wrong behavior and in
violations of some of invariants which caused crashes.

This fix tries to solve this problem by properly saving/resetting
and restoring part of LEX which affects and is affected by the
process of opening tables and views in get_all_tables() routine.
To simplify things we separated this part of LEX in a new class
and made LEX its descendant.
2006-05-30 10:45:23 +05:00
svoj@april.(none)
0674c702b0 Merge svojtovich@bk-internal.mysql.com:/home/bk/mysql-5.0
into  april.(none):/home/svoj/devel/mysql/BUG17001/mysql-5.0
2006-05-24 15:13:49 +05:00
svoj@april.(none)
3afbfc5fed BUG#17001 - Table and server crash on ALTER TABLE
frm and data files for tables created by earlier MySQL
versions becomes out of sync after certain ALTER TABLE statements:
- One that changes column default value;
- One that changes table comment;
- One that changes table password.

As a result one can expirience either server crash or data corruption/loss.

This fix ensures that running ALTER TABLE on tables created by earlier
MySQL versions recreates data files.
2006-05-16 18:37:23 +05:00
konstantin@mysql.com
85c6883146 Merge mysql.com:/opt/local/work/mysql-5.0-root
into  mysql.com:/opt/local/work/mysql-5.0-runtime-merge
2006-05-15 00:51:12 +04:00
acurtis@xiphis.org
7c9b4c2792 Merge acurtis@bk-internal:/home/bk/mysql-5.0-engines
into  xiphis.org:/home/antony/work2/p1-bug10952.1
2006-05-09 13:34:31 -07:00
acurtis@xiphis.org
47e89f208a bug#10952
"alter table from MyISAM to MERGE lost data without errors and warnings"
  Add new handlerton flag which prevent user from altering table storage
  engine to storage engines which would lose data. Both 'blackhole' and 
  'merge' are marked with the new flag.
  Tests included.
2006-05-09 13:31:46 -07:00
dlenev@mysql.com
b9d49ee894 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mysql.com:/home/dlenev/mysql-5.0-bg12472
2006-05-09 16:48:23 +04:00
dlenev@mysql.com
589daad10f Fix for bugs#12472/#15137 'CREATE TABLE ... SELECT ... which explicitly
or implicitly uses stored function gives "Table not locked" error'

CREATE TABLE ... SELECT ... statement which was explicitly or implicitly
(through view) using stored function gave "Table not locked" error.

The actual bug resides in the current locking scheme of CREATE TABLE SELECT
code, which first opens and locks tables of the SELECT statement itself,
and then, having SELECT tables locked, creates the .FRM, opens the .FRM and
acquires lock on it. This scheme opens a possibility for a deadlock, which
was present and ignored since version 3.23 or earlier. This scheme also
conflicts with the invariant of the prelocking algorithm -- no table can
be open and locked while there are tables locked in prelocked mode.

The patch makes an exception for this invariant when doing CREATE TABLE ...
SELECT, thus extending the possibility of a deadlock to the prelocked mode.
We can't supply a better fix in 5.0.
2006-05-09 16:39:11 +04:00
holyfoot@mysql.com
2f7ac18f22 Merge bk@192.168.21.1:mysql-5.0
into mysql.com:/home/hf/work/mysql-5.0.mrg
2006-05-04 02:17:17 +05:00
pekka@mysql.com
ec42119233 Merge pnousiainen@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/space/pekka/ndb/version/my50
2006-05-03 23:17:16 +02:00
holyfoot@deer.(none)
81e625ac4a merging fix 2006-05-03 17:43:32 +05:00
holyfoot@mysql.com
7ee205f67a merging 2006-05-03 16:42:39 +05:00
holyfoot@mysql.com
9de68b8122 merging 2006-05-03 16:33:42 +05:00
holyfoot@mysql.com
0007484c26 Merge mysql.com:/home/hf/work/mysql-4.1.15225
into mysql.com:/home/hf/work/mysql-4.1.mrg
2006-05-03 15:51:19 +05:00
ramil@mysql.com
b337e83db2 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/ram/work/4.1.b7643
2006-05-02 11:33:26 +05:00
cmiller@zippy.(none)
6af3f88f07 Merge zippy.(none):/home/cmiller/work/mysql/merge/tmp_merge
into  zippy.(none):/home/cmiller/work/mysql/merge/mysql-5.0
2006-05-01 09:46:00 -04:00
elliot@mysql.com
604b5836bb BUG#19145: mysqld crashes if you set the default value of an enum field to NULL
Now test for NULLness the pointers returned from objects created from the
default value. Pushing patch on behalf of cmiller.
2006-04-28 12:15:29 -04:00
ramil@mysql.com
815da9ccee Fix for bug #7643: ALTER TABLE fails for CSV, EXAMPLE, ARCHIVE engines 2006-04-25 15:27:28 +05:00
holyfoot@deer.(none)
c2acfc5b7c bug #15860 (SPATIAL keys in INNODB) 2006-04-12 22:05:23 +05:00
evgen@sunlight.local
eb075f2255 Manual merge 2006-03-30 17:14:55 +04:00
evgen@sunlight.local
47f9b46564 Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-4.1
into sunlight.local:/local_work/15560-bug-4.1-mysql
2006-03-30 10:22:03 +04:00
gluh@eagle.intranet.mysql.r18.ru
70a8f32d81 post-merge fix 2006-03-30 09:13:25 +05:00
gluh@mysql.com
ea56026e4f Merge 2006-03-30 08:13:28 +05:00
evgen@moonbone.local
1c13e54890 Fixed bug#15560: GROUP_CONCAT wasn't ready for WITH ROLLUP queries
The GROUP_CONCAT uses its own temporary table. When ROLLUP is present
it creates the second copy of Item_func_group_concat. This copy receives the
same list of arguments that original group_concat does. When the copy is
set up the result_fields of functions from the argument list are reset to the
temporary table of this copy.
As a result of this action data from functions flow directly to the ROLLUP copy
and the original group_concat functions shows wrong result.
Since queries with COUNT(DISTINCT ...) use temporary tables to store
the results the COUNT function they are also affected by this bug.

The idea of the fix is to copy content of the result_field for the function
under GROUP_CONCAT/COUNT from  the first temporary table to the second one,
rather than setting result_field to point to the second temporary table.
To achieve this goal force_copy_fields flag is added to Item_func_group_concat
and Item_sum_count_distinct classes. This flag is initialized to 0 and set to 1
into the make_unique() member function of both classes.
To the TMP_TABLE_PARAM structure is modified to include the similar flag as
well.
The create_tmp_table() function passes that flag to create_tmp_field().
When the flag is set the create_tmp_field() function will set result_field
as a source field and will not reset that result field to newly created 
field for Item_func_result_field and its descendants. Due to this there
will be created copy func to copy data from old result_field to newly 
created field.
2006-03-29 23:30:34 +04:00
gluh@eagle.intranet.mysql.r18.ru
2545c7d414 Fix for bug#15316 SET value having comma not correctly handled
disallow the use of comma in SET members
2006-03-29 19:52:26 +05:00
dlenev@mysql.com
4d1d8ed335 Follow-up for the fix for bug #18153 "ALTER/OPTIMIZE/REPAIR on transactional
tables corrupt triggers".

It turned out that we also have relied at certain places that
(new_table != table_name) were always true on Windows and for transactional
tables. Since our fix for the bug brakes this assumption we have to add new
flag to pass this information around.
This code needs to be refactored but I dare not to do this in 5.0.
2006-03-24 22:46:33 +03:00
dlenev@mysql.com
891e9424f2 Fix for bug #18153 "ALTER/OPTIMIZE/REPAIR on transactional tables corrupt
triggers".

Applying ALTER/OPTIMIZE/REPAIR TABLE statements to transactional table or to
table of any type on Windows caused disappearance of its triggers.
Bug was introduced in 5.0.19 by my fix for bug #13525 "Rename table does not
keep info of triggers" (see comment for sql_table.cc for more info).
.
2006-03-24 14:58:18 +03:00
dlenev@mysql.com
6cb5c38c14 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-bg13525
2006-02-27 20:00:03 +03:00
dlenev@mysql.com
4ca3409390 Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mysql.com:/home/dlenev/src/mysql-5.0-bg13525
2006-02-26 21:20:13 +03:00
dlenev@mysql.com
0b422c635d Merge bk-internal.mysql.com:/home/bk/mysql-5.0-runtime
into  mysql.com:/home/dlenev/src/mysql-5.0-bg13525
2006-02-26 16:38:48 +03:00
dlenev@mysql.com
0c15039e74 Fix for bug #13525 "Rename table does not keep info of triggers".
Let us transfer triggers associated with table when we rename it (but only if
we are not changing database to which table belongs, in the latter case we will
emit error).
2006-02-24 23:50:36 +03:00
konstantin@mysql.com
af62c4a959 Merge mysql.com:/opt/local/work/mysql-4.1-13134
into  mysql.com:/opt/local/work/mysql-5.0-runtime
2006-02-24 00:00:15 +03:00
konstantin@mysql.com
442c2ba8af A fix and a test case for Bug#13134 "Length of VARCHAR() utf8
column is increasing when table is recreated with PS/SP":
make use of create_field::char_length more consistent in the code.
Reinit create_field::length from create_field::char_length
for every execution of a prepared statement (actually fixes the 
bug).
2006-02-21 19:52:20 +03:00
evgen@moonbone.local
e6924206cd Fixed bug#17530: Incorrect key truncation on table creation caused server crash.
When a too long field is used for a key, only a prefix part of the field is 
used. Length is reduced to the max key length allowed for storage. But if the
field have a multibyte charset it is possible to break multibyte char
sequence. This leads to the failed assertion in the innodb code and 
server crash when a record is inserted.

The make_prepare_table() now aligns truncated key length to the boundary of
multibyte char.
2006-02-21 18:09:32 +03:00
holyfoot@mysql.com
78cc24e284 Merge bk@192.168.21.1:mysql-4.1
into mysql.com:/home/hf/work/mysql-4.1.15225
2006-02-20 18:01:59 +04:00
holyfoot@mysql.com
f500cbf83c Merge bk@192.168.21.1:mysql-5.0
into mysql.com:/home/hf/work/mysql-5.0.w2645
2006-02-17 10:56:54 +04:00
holyfoot@deer.(none)
053d90a234 WL#2645 (CHECK TABLE FOR UPGRADE)
necessary implementation in the server
mysql_upgrade script added
2006-02-17 10:52:32 +04:00
ingo@mysql.com
c5a7bffcee Bug#8841 - CHECKSUM TABLE is broken in MyISAM
There are (at least) two implementations of the checksum
computation. One is in MyISAM for the quick checksum. It
is executed on every row change. The other is in the
SQL layer for the extended checksum. It retrieves all rows
of a table via the respective storage engine.

In former MySQL versions varchars were stored with their 
maximum length, but now with their real length similar to
blobs.

This change had been forgotten to take care of in the
extended checksum calculation. Hence too much data was
checksumed. In MyISAM this change had been taken care of 
already. Only the real data is included in the checksum.

I changed mysql_checksum_table() so that it uses the
length information of true varchar fields instead
of the field length like in former varchar 
implementations.
2006-02-01 16:46:44 +01:00
jani@a193-229-222-105.elisa-laajakaista.fi
b948c2941d Merge a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-4.1
into  a193-229-222-105.elisa-laajakaista.fi:/home/my/bk/mysql-5.0
2006-01-16 21:31:22 +02:00
andrey@lmy004.
7b2238d484 Merge 2006-01-16 16:21:41 +01:00
svoj@april.(none)
5581ef960a BUG#13835: max key length is 1000 bytes when trying to create a fulltext index
Allow fulltext index on VARCHAR columns longer than max key length.
2006-01-13 21:25:12 +04:00
holyfoot@deer.(none)
3994b2150e Fix for bug #15225 (ANALYZE temporary has no effect) 2005-12-10 18:02:36 +04:00
serg@serg.mylan
719089a819 better error for optimize/repair/etc a view 2005-12-05 12:08:30 +01:00
serg@serg.mylan
9c0a8bbd17 this has nothing to do with the bug#13012.
it's about mysql_admin_commands not being reexecution-safe
(and CHECK still isn't)
2005-12-03 15:02:09 +01:00
holyfoot@mysql.com
c60b8e3027 Merge bk@192.168.21.1:mysql-5.0
into mysql.com:/home/hf/work/mysql-5.0.14693
2005-11-29 13:33:56 +04:00
konstantin@mysql.com
463175c4e8 Post-merge fixes. 2005-11-25 18:53:55 +03:00
konstantin@mysql.com
9fd6204ad1 Merge mysql.com:/opt/local/work/mysql-4.1-root
into  mysql.com:/opt/local/work/mysql-5.0-root
2005-11-25 13:57:13 +03:00
konstantin@mysql.com
f57dffe453 A fix and a test case for Bug#14410 "Crash in Enum or Set type in
CREATE TABLE and PS/SP": make sure that 'typelib' object for
ENUM values and 'Item_string' object for DEFAULT clause are 
created in the statement memory root.
2005-11-25 13:25:31 +03:00