Commit graph

925 commits

Author SHA1 Message Date
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@mysql.com
e5a22d1bca Merge bk@192.168.21.1:mysql-4.1
into mysql.com:/home/hf/work/mysql-4.1.mrg
2006-05-04 00:03:58 +05: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
holyfoot@deer.(none)
e906120ba8 Fix for bug #14693 (ALTER COLUMN SET DEFAULT has no effect) 2005-11-24 20:24:45 +04:00
bell@sanja.is.com.ua
7f162c7899 Merge sanja.is.com.ua:/home/bell/mysql/bk/work-bug1-5.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-merge-5.0
2005-11-21 21:15:48 +02:00
bell@sanja.is.com.ua
806f9e24ff Inefficient usage of String::append() fixed.
Bad examples of usage of a string with its length fixed.
The incorrect length in the trigger file configuration descriptor
  fixed (BUG#14090).
A hook for unknown keys added to the parser to support old .TRG files.
2005-11-20 20:47:07 +02:00
ingo@mysql.com
3df2007147 Merge mysql.com:/home/mydev/mysql-4.1-4100
into  mysql.com:/home/mydev/mysql-5.0-5000
2005-11-16 10:23:42 +01:00
ingo@mysql.com
74781d6559 Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
Version for 5.0.
It fixes three problems:
1. The cause of the bug was that we did not check the table version for
 the HANDLER ... READ commands. We did not notice when a table was
 replaced by a new one. This can happen during ALTER TABLE, REPAIR
 TABLE, and OPTIMIZE TABLE (there might be more cases). I call the fix
 for this problem "the primary bug fix".
2. mysql_ha_flush() was not always called with a locked LOCK_open.
 Though the function comment clearly said it must.
 I changed the code so that the locking is done when required. I call
 the fix for this problem "the secondary fix".
3. In 5.0 (not in 4.1 or 4.0) DROP TABLE had a possible deadlock flaw in
 concur with FLUSH TABLES WITH READ LOCK. I call the fix for this
 problem "the 5.0 addendum fix".
2005-11-15 21:57:02 +01:00
ingo@mysql.com
6bc4636b64 Merge mysql.com:/home/mydev/mysql-4.0-4000
into  mysql.com:/home/mydev/mysql-4.1-4100
2005-11-15 18:09:40 +01:00
sergefp@mysql.com
c6a902f20c Merge mysql.com:/home/psergey/mysql-4.1-nov08-push
into mysql.com:/home/psergey/mysql-5.0-oct08-push
2005-11-09 10:12:58 +03:00
sergefp@mysql.com
f12212f74e BUG#14480: post-fix: use the default field value from CREATE list too. 2005-11-09 09:34:46 +03:00
sergefp@mysql.com
c5276ebcb0 Merge, will need post-merge fixes. 2005-11-08 11:22:51 +03:00
sergefp@mysql.com
edd094b194 BUG#14480, attempt2: In CREATE ... SELECT ..., don't count the same field twice
when calculating table->null_fields.
2005-11-07 09:23:43 +03:00
igor@rurik.mysql.com
0960f5fedc Post review fixes. 2005-11-05 22:41:36 -08:00
igor@rurik.mysql.com
84ad20364d Merge rurik.mysql.com:/home/igor/mysql-5.0
into  rurik.mysql.com:/home/igor/dev/mysql-5.0-0
2005-11-04 15:03:29 -08:00
ingo@mysql.com
1b99d30c23 Bug#14397 - OPTIMIZE TABLE with an open HANDLER causes a crash
Version for 4.0.
It fixes two problems:
1. The cause of the bug was that we did not check the table version for
   the HANDLER ... READ commands. We did not notice when a table was
   replaced by a new one. This can happen during ALTER TABLE, REPAIR
   TABLE, and OPTIMIZE TABLE (there might be more cases). I call the fix
   for this problem "the primary bug fix".
2. mysql_ha_flush() was not always called with a locked LOCK_open.
   Though the function comment clearly said it must.
   I changed the code so that the locking is done when required. I call
   the fix for this problem "the secondary fix".
2005-11-03 18:24:12 +01:00
jani@ua141d10.elisa.omakaista.fi
0f83ba137a Merge jamppa@bk-internal.mysql.com:/home/bk/mysql-5.0
into  ua141d10.elisa.omakaista.fi:/home/my/bk/mysql-5.0
2005-11-03 16:43:05 +02:00
jani@ua141d10.elisa.omakaista.fi
0ee589b4d6 Changes in get_table_type() and mysql_frm_type(). The main problem was
that in mysql_rm_table_part2_with_lock() previously we needed to open
same file twice. Now once is enough.
2005-11-03 16:10:11 +02:00
konstantin@mysql.com
7e3f757f2d A fix and a test case for Bug#14210 "Simple query with > operator on
large table gives server crash": make sure that when a MyISAM temporary
table is created for a cursor, it's created in its memory root,
not the memory root of the current query.
2005-11-03 14:20:13 +03:00
igor@rurik.mysql.com
44dd303c47 Post review fixes. 2005-11-02 22:13:10 -08:00
igor@rurik.mysql.com
fddc99bcd8 #view.test#:
new file
sql_table.cc, handler.h:
  Fixed bug #14540.
  Added error mnemonic code HA_ADMIN_NOT_BASE_TABLE
  to report that an operation cannot be applied for views.
view.test, view.result:
  Added a test case for bug #14540.
errmsg.txt:
  Fixed bug #14540.
  Added error ER_CHECK_NOT_BASE_TABLE.
2005-11-02 13:44:58 -08:00
sergefp@mysql.com
09a4d0c7a7 4.1->5.0 merge 2005-10-29 02:36:57 +04:00
sergefp@mysql.com
2219ada7f6 BUG#14139: When handling "CREATE TABLE(field_X type_spec,...) SELECT smth AS field_X, ...."
avoid multiplying length of field_X by charset->mbmaxlen twice when calculating space 
required for field_X in the new table.
2005-10-26 00:56:17 +04:00
hf@deer.(none)
86e358f1c8 Merge bk@192.168.21.1:/usr/home/bk/mysql-5.0
into deer.(none):/home/hf/work/mysql-5.0.12267
2005-10-25 19:08:33 +05:00
msvensson@neptunus.mysql.com
bb15425235 Fix for dropping a table with frm file consisting of "junk" 2005-10-24 15:05:06 +02:00
dlenev@mysql.com
920d379228 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-bg12739
2005-10-17 22:47:46 +04:00
dlenev@mysql.com
ea0b89aeae Fix for bug #12739 "Deadlock in multithreaded environment during creating/
droping trigger on InnoDB table".

Deadlock occured in cases when we were trying to create two triggers for
the same InnoDB table concurrently and both threads were able to reach
close_cached_table() simultaneously. Bugfix implements new approach to
table locking and table cache invalidation during creation/dropping
of trigger.

No testcase is supplied since bug was repeatable only under high concurrency.
2005-10-17 22:37:24 +04:00
hf@deer.(none)
9910198aaf Additional fix for bug #12267 (Can't use POINT for primary key) 2005-10-15 22:23:13 +05:00
hf@deer.(none)
7fb1ffd07e Merge bk@192.168.21.1:/usr/home/bk/mysql-5.0
into deer.(none):/home/hf/work/mysql-5.0.12267
2005-10-15 21:05:29 +05:00
monty@mysql.com
f5fdf3e87a Reviewing new pushed code
- CHAR() now returns binary string as default
- CHAR(X*65536+Y*256+Z) is now equal to CHAR(X,Y,Z) independent of the character set for CHAR()
- Test for both ETIMEDOUT and ETIME from pthread_cond_timedwait()
  (Some old systems returns ETIME and it's safer to test for both values
   than to try to write a wrapper for each old system)
- Fixed new introduced bug in NOT BETWEEN X and X
- Ensure we call commit_by_xid or rollback_by_xid for all engines, even if one engine has failed
- Use octet2hex() for all conversion of string to hex
- Simplify and optimize code
2005-10-12 00:58:22 +03:00
monty@mysql.com
17d7ba931d Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/my/mysql-5.0
2005-10-08 03:37:23 +03:00
monty@mysql.com
f577ebb88f Simple changes during review of code
Added back flag that I accidently removed in last patch
2005-10-08 00:57:40 +03:00
serg@serg.mylan
faa0365d29 Merge mysqldev@production.mysql.com:/data0/mysqldev/my/mysql-5.0-release
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
2005-10-05 19:37:02 +02:00
serg@mysql.com
83683bb649 sql_table.cc:
fixed CHECKSUM TABLE to be independent from the first 'deleted' bit in the null bitmask (undefined in the InnoDB)
  bug#13710
2005-10-05 19:36:20 +02:00
serg@serg.mylan
84859c3895 Merge mysqldev@production.mysql.com:/data0/mysqldev/my/mysql-5.0-release
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
2005-10-04 18:10:38 +02:00
serg@mysql.com
062f145bf8 sql_table.cc, table.cc, table.h:
fixed CHECKSUM TABLE to be independent from last - undefined in InnoDB - bits in the null bitmask
  bug#13710
2005-10-04 17:04:20 +02:00
eric@mysql.com
5008a5f208 Move handler specific options into handlerton flag check
BUG#13108
2005-09-30 16:26:48 -07:00
serg@serg.mylan
6716d16bc7 CHECKSUM TABLE now allows concurrent inserts 2005-09-27 20:11:09 +02:00
hf@deer.(none)
836bc2638e Fix for bug #12267 (primary key over GEOMETRY field) 2005-09-26 14:55:52 +05:00
andrey@lmy004.
72549b13c2 Merge ahristov@bk-internal.mysql.com:/home/bk/mysql-4.1
into lmy004.:/work/mysql-4.1-bug12913
2005-09-20 06:55:23 +03:00
dlenev@mysql.com
2a96aa110f Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mysql.com:/home/dlenev/src/mysql-5.0-bg12704-2
2005-09-15 03:57:59 +04:00
dlenev@mysql.com
e231ebe5fb Fix for bug #12704 "Server crashes during trigger execution".
This bug occurs when some trigger for table used by DML statement is created
or changed while statement was waiting in lock_tables(). In this situation
prelocking set which we have calculated becames invalid which can easily lead
to errors and even in some cases to crashes.

With proposed patch we no longer silently reopen tables in lock_tables(),
instead caller of lock_tables() becomes responsible for reopening tables and
recalculation of prelocking set.
2005-09-15 03:56:09 +04:00
monty@mishka.mysql.fi
9f22a16972 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  mishka.mysql.fi:/home/my/mysql-5.0
2005-09-14 01:47:38 +03:00
monty@mishka.mysql.fi
f348f62cc3 Added option --valgrind-mysqltest to mysql-test-run
Added flag to Field::store(longlong) to specify if value is unsigned.
This fixes bug #12750: Incorrect storage of 9999999999999999999 in DECIMAL(19, 0)
Fixed warning from valgrind in CREATE ... SELECT
Fixed double free of mysql.options if reconnect failed
2005-09-14 01:41:44 +03:00
ingo@mysql.com
7953594a4d Bug#12845 - Stress test: Server crashes on CREATE .. SELECT statement
Solution for 5.0.
Changed calls to open_table(). Requested to ignore
flush at places where the command did already lock tables.
This could happen in CREATE ... SELECT and ALTER TABLE.

No test case. The bug can only be triggered by true concurrency.
The stress test suite provides a test case for this.
2005-09-13 14:36:43 +02:00
jani@a193-229-222-105.elisa-laajakaista.fi
01ce8a8aa9 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
2005-09-12 20:18:49 +03:00
gluh@eagle.intranet.mysql.r18.ru
d9bd3c11e4 Fix for bug #6008: MySQL does not create warnings when creating database and using IF NOT EXISTS
produce warning for 'create database if not exists' if database exists
  do not update database options in this case  
  produce warning for 'create table if not exists' if table exists
2005-09-12 17:09:19 +05:00
msvensson@neptunus.(none)
211b78b6ee Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into  neptunus.(none):/home/msvensson/mysql/mysql-5.0
2005-09-01 09:05:45 +02:00
jimw@mysql.com
1d997477aa Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-08-31 15:24:06 -07:00
andrey@lmy004.
f75ac7fb82 fix for bug#12913
(Simple SQL can crash server or connection)
(not initialized member leads to server crash)
2005-09-01 00:13:02 +02:00
jimw@mysql.com
0dc444ec4e Fix incorrect spellings of "dropped" in source and tests. (Bug #12828) 2005-08-30 12:24:37 -07:00
ingo@mysql.com
9b11c9a822 Merge mysql.com:/home/mydev/mysql-5.0
into  mysql.com:/home/mydev/mysql-5.0-5000
2005-08-30 08:18:27 +02:00
andrey@lmy004.
1668c45d30 fix for bug 12207 (alter table discard tablespace on MyISAM table
causes ERROR 2013).
(all-in-one approved patch)
2005-08-29 21:00:43 +02:00
ingo@mysql.com
5d41d5e0f4 Merge mysql.com:/home/mydev/mysql-4.1-4100
into  mysql.com:/home/mydev/mysql-5.0-5000
2005-08-29 18:18:30 +02:00
ingo@mysql.com
330eb04536 Bug#12296 - CHECKSUM TABLE reports 0 for the table
Skipping deleted records instead of breaking the loop
during checksum calculation.
2005-08-29 17:08:41 +02:00
serg@sergbook.mysql.com
d591705e69 merged 2005-08-26 13:24:59 +04:00
monty@mishka.local
f384e08277 Merge mishka.local:/home/my/mysql-4.1
into  mishka.local:/home/my/mysql-5.0
2005-08-25 06:55:48 +03:00
msvensson@neptunus.(none)
9af0f156a5 Improve default error message for optimize/repair table 2005-08-24 10:41:44 +02:00
serg@sergbook.mysql.com
eadb86d56f after pull cleanup 2005-08-22 13:20:02 +04:00
sasha@asksasha.com
c594ab7921 updated patch for BUG#4680 (incomplete DROP DATABASE breaking replication).
We binlog the DROP TABLE for each table that was actually dropped. Per Sergei's 
suggestion a fixed buffer for the DROP TABLE query is pre-allocated from THD pool, and 
logging now is done in batches - new batch is started if the buffer becomes full.
Reduced memory usage by reusing the table list instead of accumulating a list of 
dropped table names. Also fixed the problem if the table was not actually dropped, eg
due to permissions. Extended the test case to make sure batched query 
logging does work.
2005-08-18 21:40:14 -06:00
sasha@asksasha.com
c44fe70d02 patch for BUG#4680 - drop database breaking replication if there were extra files
in the database directory on the master
2005-08-03 18:08:20 -06:00
georg@lmy002.wdf.sap.corp
aa044ab57a Changed/fixed error message from last commit 2005-08-04 02:06:21 +02:00
georg@lmy002.wdf.sap.corp
7251e9dbd8 Fix for bug #6859 (after Sanja's review)
Added check which throws ER_WRONG_OBJECT error in case the .frm
doesn't contain a valid table type (e.g. view or trigger)
2005-08-03 07:29:48 +02:00
monty@mysql.com
15d48525af Merge mysql.com:/home/my/mysql-4.1
into  mysql.com:/home/my/mysql-5.0
2005-07-28 17:09:54 +03:00
monty@mysql.com
e59360ac86 Review of new code:
Change argument order to be database, tablename for some functions
2005-07-27 13:05:30 +03:00
jimw@mysql.com
49e5636410 Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-07-22 12:35:15 -07:00
jimw@mysql.com
6eae678f56 Fix error message generated when trying to create a table in a
non-existent database. (Bug #10407)
2005-07-21 20:08:54 -07:00
pappa@c-450ae253.1238-1-64736c10.cust.bredbandsbolaget.se
6026054ead Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-4.1
into  c-450ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/mysql-5.0
2005-07-21 01:29:57 -04:00
pappa@c-450ae253.1238-1-64736c10.cust.bredbandsbolaget.se
ac6623f08f Fix merge 2005-07-20 22:30:34 -04:00
pappa@c-450ae253.1238-1-64736c10.cust.bredbandsbolaget.se
9663b9a974 Merge mronstrom@bk-internal.mysql.com:/home/bk/mysql-4.0
into  c-450ae253.1238-1-64736c10.cust.bredbandsbolaget.se:/home/pappa/mysql-4.1
2005-07-20 21:58:33 -04:00
mronstrom@mysql.com
4cb963439a Bug #10600 After review fixes 2005-07-20 21:19:01 +02:00
dlenev@mysql.com
8a3e723b74 Fix for bugs #5892/6182/8751/8758/10994 (based on Antony's patch)
"Triggers have the wrong namespace"
  "Triggers: duplicate names allowed"
  "Triggers: CREATE TRIGGER does not accept fully qualified names"
  "SHOW TRIGGERS"
2005-07-19 20:06:49 +04:00
mronstrom@mysql.com
2d23c691f7 Bug #10600
remove_table_from_cache fails to signal other thread and gets
blocked when other thread also gets blocked
2005-07-19 00:29:19 +02:00
bar@mysql.com
7d405e3c65 Merge mysql.com:/usr/home/bar/mysql-4.1.num-conv
into  mysql.com:/usr/home/bar/mysql-5.0
2005-07-14 16:11:55 +05:00
bar@mysql.com
1b612b0006 Merge abarkov@bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/usr/home/bar/mysql-4.1.num-conv
2005-07-14 10:46:15 +05:00
dlenev@mysql.com
f334ea1fc6 Implementation of Monty's idea: Now we can open mysql.proc table for lookup
of stored routines definitions even if we already have some tables open and
locked. To avoid deadlocks in this case we have to put certain restrictions
on locking of mysql.proc table.

This allows to use stored routines safely under LOCK TABLES without explicitly
mentioning mysql.proc in the list of locked tables. It also fixes bug #11554
"Server crashes on statement indirectly using non-cached function".
2005-07-13 13:48:13 +04:00
bar@mysql.com
5150fdcc04 ctype_utf8.result:
adding test case
sql_table.cc:
  sql_table.cc:
  - do not create a new item when charsets are the same
  - return ER_INVALID_DEFAULT if default value cannot
    be converted into the column character set.
item.cc:
  - Allow conversion not only to Unicode,
    but also to and from "binary".
  - Adding safe_charset_converter() for Item_num
    and Item_varbinary, returning a fixed const Item.
2005-07-13 13:00:17 +05:00
jimw@mysql.com
2669b86612 Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-07-05 15:23:13 -07:00
jimw@mysql.com
9f654b806a Merge mysql.com:/home/jimw/my/mysql-4.1-11440
into  mysql.com:/home/jimw/my/mysql-4.1-clean
2005-07-05 12:54:12 -07:00
bell@sanja.is.com.ua
4bc6bd38ec Merge 2005-07-05 13:42:19 +03:00
bell@sanja.is.com.ua
cee0f3f608 fixed environment creation and cleaning up for processing view one by one during checking (BUG#11337) 2005-07-05 13:37:02 +03:00
monty@mysql.com
86d7b02199 Merge with 4.1 2005-07-03 14:17:52 +03:00
bar@mysql.com
48f34a0bc5 sql_table.cc:
Bug#11657 Creation of secondary index fails:

  If TINYBLOB key part length is 255, it is equal
  to field length. For BLOB, unlike for CHAR/VARCHAR,
  we should keep a non-zero key part length, otherwise
  "BLOB/TEXT column used in key specification without a key length"
  error is produced afterwards.

type_blob.result, type_blob.test:
  fixing tests accordinly
2005-07-01 15:07:06 +05:00
ramil@mysql.com
2eea2f5208 a fix.
bug #10617: Insert from same table to same table give incorrect result for bit(4) column.
bug #11091: union involving BIT: assertion failure in Item::tmp_table_field_from_field_type
bug #11572: MYSQL_TYPE_BIT not taken care of in temp. table creation for VIEWs
2005-06-30 13:38:29 +05:00
monty@mishka.local
7398252d02 Portability fixes
Fixes while reviewing new pushed code
NULL as argument to encrypt/decrypt should return NULL without a warning
2005-06-27 20:31:00 +03:00
msvensson@neptunus.(none)
85b9ffc4ca Merged from mysql-4.1 to mysql-5.0 2005-06-22 14:10:02 +02:00
jimw@mysql.com
d11ef13ad9 Restore creation of files for temporary tables in the tmpdir,
which was broken by an earlier bug fix. (Bug #11440)
2005-06-21 11:25:51 -07:00
msvensson@neptunus.(none)
73c1578f15 Merge neptunus.(none):/home/msvensson/mysql/mysql-4.1
into neptunus.(none):/home/msvensson/mysql/bug10365
2005-06-20 13:08:45 +02:00
acurtis@xiphis.org
51dd521dfc Bug#6877 MySQL should give an error if the requested table type is not available
Implement new SQL mode - NO_ENGINE_SUBSTITUTION
2005-06-17 22:14:44 +01:00
jimw@mysql.com
1055c36000 Merge mysql.com:/home/jimw/my/mysql-5.0-10543
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-06-09 19:29:55 -07:00
acurtis@xiphis.org
3b8c3bd7e1 Merge 2005-06-09 17:15:06 +01:00
acurtis@xiphis.org
304bb0c66d Bug#11028 Crash on create table like
Report error instead of crashing
2005-06-09 16:06:15 +01:00
msvensson@neptunus.(none)
8771c73258 BUG#10365 Cluster handler uses non-standard error codes
- Added better error messages when trying to open a table that can't be discovered or unpacked. The most likely cause of this is that it does not have any frm data, probably since it has been created from NdbApi or is a NDB system table.
 - Separated functionality that was in ha_create_table_from_engine into two functions. One that checks if the table exists and another one that tries to create the table from the engine.
2005-06-08 13:31:59 +02:00
monty@mysql.com
775f17667b Merge with 4.1 2005-06-07 00:31:53 +03:00
monty@mysql.com
29fd1f2fd9 Move USE_PRAGMA_IMPLEMENTATION to proper place
Ensure that 'null_value' is not accessed before val() is called in FIELD() functions
Fixed initialization of key maps. This fixes some problems with keys when you have more than 64 keys
Fixed that ROLLUP don't always create a temporary table. This fix ensures that func_gconcat.test results are now predictable
2005-06-03 23:46:03 +03:00
jimw@mysql.com
d147e69bb7 Additional tweak to fix for bug #10543, to prevent a change in
behavior when extending fields that were fully part of a
multi-part key.
2005-06-02 10:00:36 -07:00
jimw@mysql.com
8b0daa8445 Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-06-01 16:13:25 -07:00
jimw@mysql.com
5a271e2c12 Merge mysql.com:/home/jimw/my/mysql-4.1-clean
into  mysql.com:/home/jimw/my/mysql-5.0-clean
2005-06-01 16:13:24 -07:00
jimw@mysql.com
f5f88703b2 Fix compile error when HAVE_BERKELEY_DB 2005-06-01 16:03:41 -07:00
jimw@mysql.com
b8f3c515ba Merge mysql.com:/home/jimw/my/mysql-4.1-9660
into  mysql.com:/home/jimw/my/mysql-4.1-clean
2005-06-01 13:02:26 -07:00
jimw@mysql.com
0a2d95e983 Merge mysql.com:/home/jimw/my/mysql-4.1-8135
into  mysql.com:/home/jimw/my/mysql-4.1-clean
2005-06-01 12:59:11 -07:00
ingo@mysql.com
0a1e38b7ed Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
Manual merge from 4.1.
2005-06-01 11:15:21 +02:00
ingo@mysql.com
c420599581 Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
Hand merged from 4.0.
2005-05-31 19:37:24 +02:00
ingo@mysql.com
51d80960ea Bug#10224 - ANALYZE TABLE crashing with simultaneous CREATE ... SELECT statement.
1.) Added a new option to mysql_lock_tables() for ignoring FLUSH TABLES.
Used the new option in create_table_from_items().
It is necessary to prevent the SELECT table from being reopend.
It would get new storage assigned for its fields, while the
SELECT part of the command would still use the old (freed) storage.
2.) Protected the CREATE TABLE and CREATE TABLE ... SELECT commands
against a global read lock. This prevents a deadlock in
CREATE TABLE ... SELECT in conjunction with FLUSH TABLES WITH READ LOCK
and avoids the creation of new tables during a global read lock.
3.) Replaced set_protect_against_global_read_lock() and
unset_protect_against_global_read_lock() by
wait_if_global_read_lock() and start_waiting_global_read_lock()
in the INSERT DELAYED handling.
2005-05-31 11:08:14 +02:00
jimw@mysql.com
1cc23599c2 Cleanups to patch for bug #9660 after review by Monty. 2005-05-26 10:01:26 -07:00
jimw@mysql.com
aac55df4f4 Fix table renaming to not lowercase table names for all storage
engines when lower_case_table_names == 2, as it did previously
for InnoDB and MEMORY. (Bug #9660)
2005-05-25 20:26:40 -07:00
jimw@mysql.com
ef9ef1f958 Fix partial keys when converting VARCHAR to TEXT. (Bug #10543) 2005-05-25 18:11:47 -07:00
monty@mysql.com
cb7cd33222 Fix that we can read tables with the 'older' decimal format used in 5.0.3 & 5.0.4
We will however give a warning when opening such a table that users should use ALTER TABLE ... FORCE to fix
the table. In future release we will fix that REPAIR TABLE will be able to handle this case
2005-05-25 18:33:36 +03:00
jimw@mysql.com
2fde78052b Fix error reporting for 'OPTIMIZE TABLE' on InnoDB tables. (Bug #8135) 2005-05-24 11:11:40 -07:00
monty@mysql.com
d06bb6fa39 After merge fixes 2005-05-16 15:21:35 +03:00
monty@mysql.com
9db45adb60 Merge with 4.1 2005-05-14 18:31:22 +03:00
monty@mysql.com
beb5867dfb After merge fixes 2005-05-14 16:24:36 +03:00
monty@mysql.com
b4e92e6360 Merge with 4.0 2005-05-14 00:01:40 +03:00
monty@mysql.com
20f969b256 Change create_field->offset to store offset from start of fields, independent of null bits.
Count null_bits separately from field offsets and adjust them in case of primary key parts.
(Previously a CREATE TABLE with a lot of null fields that was part of a primary key caused MySQL to wrongly count the number of bytes needed to store null bits)
This is a more complete bug fix for #6236
2005-05-13 11:11:50 +03:00
ramil@mysql.com
152f751831 fix (Bug #8295 and #8296: varchar and varbinary conversion)
select, gis & gis-tree tests fails at the moment, but
I will push this CS because it was tested before and I'm absolutely
sure it's right.
2005-05-12 15:56:04 +05:00
antony@ltantony.mysql.com
d51308aec4 Bug#6236
Incomplete ALTER TABLE breaks MERGE compatibility
  Fix implicit NOT NULL not set on ALTER of PK columns
2005-05-08 21:03:50 +01:00
gluh@mysql.com
a8febcd7d2 Merge sgluhov@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/gluh/MySQL/Bugs/5.0.9897
2005-05-07 12:21:48 +00:00
gluh@mysql.com
d76be7ab3f Fix for bug#9897: Views: 'Check Table' crashes MySQL, with a view and a table in the statement
thd->lex->derived_tables should be zero(it may be changed if we open a view)
2005-05-07 12:17:54 +00:00
monty@mishka.local
015cd1cd21 merge 2005-05-06 13:51:58 +03:00
monty@mishka.local
a9f6aab4c9 Fixes while reviewing new code
Added option --count to mysqlshow (to show number of rows)
Fixed possible core dump in information schema
2005-05-06 11:39:30 +03:00
jimw@mysql.com
7bab94f36b Clean up merge from 4.1 2005-05-02 10:19:37 -07:00
jimw@mysql.com
8ef6ae7442 Fix 'CREATE TABLE ... LIKE ...' when lower_case_table_names
is set on case-sensitive file systems and the source table
was specified in something other than lowercase. (Bug #9761)
2005-04-28 15:30:42 -07:00
acurtis@xiphis.org
f638e5cb8f Bug#9102 - Stored proccedures: function which returns blob causes crash
Initialization of fields for sp return type was not complete.
2005-04-19 09:09:25 +01:00
ramil@mysql.com
f93ebc20ac Bit type: code clean-up. 2005-04-12 23:12:00 +05:00
ramil@mysql.com
eae4d9c073 Bit type: code cleanup. 2005-04-12 19:36:21 +05:00
ramil@mysql.com
3b1c3d8c68 Merge rkalimullin@bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/usr/home/ram/work/5.0.bit_class
2005-04-12 12:30:09 +05:00
ramil@mysql.com
c4376b2bc6 Bit type support for non-MyISAM tables. 2005-04-12 12:27:43 +05:00
gbichot@quadita2.mysql.com
e0831dce7a merge from 4.1 2005-04-11 16:59:06 +02:00
gbichot@quadita2.mysql.com
c7c928f168 Fix for BUG#9149 "OPTIMIZE TABLE statement on InnoDB table is logged twice in the binary log"
if we fall back to mysql_alter_table() (for InnoDB), don't do binlogging in mysql_alter_table(), as mysql_admin_table()
is not supposed to do any binlogging (it is done by the caller).
2005-04-11 16:46:03 +02:00
bar@mysql.com
71f530c4ea merge 2005-04-11 15:11:52 +05:00
marko@hundin.mysql.fi
b5328a7dbc InnoDB: Prevent ALTER TABLE ... ENGINE=...
if there are foreign key constraints on the table. (Bug #5574)
2005-04-07 12:16:41 +03:00
monty@mysql.com
48de1ff277 Don't generate message in send_kill_message() if wrong data. (Caused core dump for wrong data in ALTER TABLE on some system) 2005-04-05 01:19:48 +03:00
monty@mysql.com
04f8e164fb Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/my/mysql-5.0
2005-04-04 16:45:23 +03:00
dlenev@brandersnatch.localdomain
fc1e7b07d6 Merge bk-internal.mysql.com:/home/bk/mysql-5.0
into mysql.com:/home/dlenev/src/mysql-5.0-trg3
2005-04-03 17:02:13 +04:00
dlenev@mysql.com
7b294bdc8d Merge of patch for bug #3891 into 5.0 tree. 2005-04-03 10:36:18 +04:00
serg@serg.mylan
7ba99ee324 merged 2005-04-02 20:28:58 +02:00
serg@serg.mylan
3098b93ef8 bug#3891 - DROP TABLE many-unexistent-tables, was printing an error with %s instead of table names
sql/sql_table.cc: print an error with a function that respects width modifiers (%.64s)
2005-04-02 20:13:19 +02:00
monty@mysql.com
201ee3eb78 Invalid DEFAULT values for CREATE TABLE now generates errors. (Bug #5902)
CAST() now produces warnings when casting a wrong INTEGER or CHAR values. This also applies to implicite string to number casts. (Bug #5912)
ALTER TABLE now fails in STRICT mode if it generates warnings.
Inserting a zero date in a DATE, DATETIME or TIMESTAMP column during TRADITIONAL mode now produces an error. (Bug #5933)
2005-04-01 15:04:50 +03:00
dlenev@brandersnatch.localdomain
d4b20f4a86 Fix for bugs #5859 "DROP TABLE does not drop triggers" and
#6559 "DROP DATABASE forgets to drop triggers".

If we drop table we should also drop all triggers associated with it.
To do this we have to check for existence of .TRG file when we are 
dropping table and delete it too.
2005-03-27 16:15:21 +04:00
monty@mysql.com
cc56005130 Hack to ensure that CHAR's created in 5.0 are not converted to VARCHAR even if the row type is dynamic
(For 4.1 tables old 'VARCHAR' fields are converted to true VARCHAR in the next ALTER TABLE)

This ensures that one can use MySQL 5.0 privilege tables with MySQL 4.1
2005-03-22 15:48:06 +02:00
jimw@mysql.com
ee2b4ec959 Eliminate warnings noticed by VC7. This includes fixing my_mmap() on
Windows to call CreateFileMapping() with correct arguments, and
propogating the introduction of query_id_t to everywhere query ids are
passed around. (Bug #8826)
2005-03-18 16:12:25 -08:00
serg@serg.mylan
41997cf263 Merge bk-internal:/home/bk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0
2005-03-17 08:46:48 +01:00
monty@mysql.com
aa6ab3b49c Move handler dependent tests to the specific handler (myisam, bdb, innodb)
Enabled VARCHAR testing for innodb

NOTE: innodb.test currently fails becasue of a bug in InnoDB. 
I have informed Heikki about this and expect him to fix this ASAP
2005-03-17 01:22:12 +02:00
monty@mysql.com
594ef41b2d Cleanup during reviews
Removed some optional arguments
Fixed portability problem in federated tests
2005-03-16 16:11:01 +02:00
serg@serg.mylan
d7b2d4c541 global read lock code now uses a dedicated mutex
(otherwise a deadlock when ALTER writes to
binlog holding LOCK_open, it causes binlog rotation,
binlog waits for prepared transactions to commit, and commit
needs LOCK_open to check for global read lock)
2005-03-16 08:40:19 +01:00
jimw@mysql.com
eaea82d3af Merge query_cache tests 2005-03-11 12:38:38 -08:00
jimw@mysql.com
50f9fc3368 Merge test and results 2005-03-11 11:07:32 -08:00
acurtis@ltantony.rdg.cyberkinetica.homeunix.net
be3c863ba0 Merge in fix Bug#3788 2005-03-08 22:32:09 +00:00
jimw@mysql.com
df84c534dd Flush entries from the query cache for tables used in
administrative statements that may alter the table, such
as REPAIR TABLE. (Bug #8480)
2005-03-07 18:15:19 -08:00
acurtis@pcgem.rdg.cyberkinetica.com
5e1d2ad68c Bug#3788
Crashes with stored procedure return non-string values
  Also fixes Bug#2773
2005-03-04 21:14:35 +00:00
monty@mysql.com
0a6b7aedb2 Remove compiler warnings and remove not used variables
(Found during build process)
2005-02-25 16:53:22 +02:00
monty@mysql.com
cd78e701a5 Show all generated warnings in SHOW ERROR
Previously we only stored the first given error (the error sent to the client)
2005-02-24 23:33:42 +02:00
monty@mysql.com
f5acf0be01 Generate warning in ha_delete_table() if files is missing in handler 2005-02-21 20:41:48 +02:00
monty@mysql.com
cab35adf7e Review of new pushed code (XA & other)
Portability fixes and cleanups
Fixed setting of 'res' in mysql_execute_command()
2005-02-21 14:47:57 +02:00
serg@serg.mylan
1235e6d2c7 Merge serg.mylan:/usr/home/serg/Abk/mysql-5.0
into serg.mylan:/usr/home/serg/Abk/mysql-5.0-xa
2005-02-18 13:38:10 +01:00
msvensson@neptunus.homeip.net
a004533a76 BUG#8547: Wrong errormessage when dropping table that does not exist in NDB
- Added tescases
 - Added handling of HA_ERR_NO_SUCH_TABLE in mysql_rm_table_part2 so that 
   error messages now are consistent
2005-02-17 14:22:44 +01:00
serg@serg.mylan
fd828e5b4d manually merged 2005-02-14 21:50:09 +01:00
hf@deer.(none)
b94a482ee9 Precision Math implementation 2005-02-09 02:50:45 +04:00
monty@mysql.com
422c2eb868 4.1 -> 5.0 merge 2005-02-03 13:18:30 +02:00
monty@mysql.com
3936edd7fa Fixed during review of new pulled code 2005-02-02 20:28:01 +02:00
reggie@bob.(none)
fe675641eb Merge bob.(none):/home/reggie/bk/mysql41
into bob.(none):/home/reggie/bk/mysql5.0
2005-01-31 22:24:04 -06:00
reggie@bob.(none)
16334eb414 Bug #6607 Create table... LIKE... with Windows Symlinks
sql_table.cc:
  use fn_format to resolve symlinks in mysql_create_like_table
2005-01-31 17:24:18 -06:00
serg@serg.mylan
3c5060981f query_id and my_xid -> ulonglong
fix for binlog+autocommit+tclog
comments, style fixes
2005-01-27 22:38:56 +01:00