Commit graph

699 commits

Author SHA1 Message Date
bar@mysql.com
3855520138 WL#2928 Date Translation NRE
(implemented by by Josh Chamas)
2006-07-04 17:40:40 +05:00
aelkin@mysql.com
a0b4c8ed12 Merge mysql.com:/net/nb/home/elkin/MySQL/FIXES/4.1-bug19188_tmp_name
into  mysql.com:/usr_rh9/home/elkin.rh9/MySQL/Merge/4.1
2006-05-12 21:38:41 +03:00
aelkin@mysql.com
9b16a7b91a BUG#19188: incorrect temporary table name of DROP query in replication
A pattern to generate binlog for DROPped temp table in close_temporary_tables
  was buggy: could not deal with a grave-accent-in-name table.

  The fix exploits `append_identifier()' for quoting and duplicating accents.
2006-05-12 21:29:06 +03:00
aelkin@mysql.com
226d978ae8 BUG#14157: utf8 encoding in binlog without set character_set_client e.g DROP temporary
Binlog lacks encoding info about DROPped temporary table.

Idea of the fix is to switch temporary to system_charset_info when a temporary table
is DROPped for binlog. Since that is the server, that automatically, but not the client, who generates the query
the binlog should be updated on the server's encoding for the coming DROP.
The `write_binlog_with_system_charset()' is introduced to replace similar problematic places in the code.
2006-05-09 23:01:31 +03:00
konstantin@mysql.com
a81ea4a830 Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/opt/local/work/mysql-4.1-16365
2006-04-07 23:50:45 +04:00
konstantin@mysql.com
518993312c A fix and a test case for Bug#16365 "Prepared Statements: DoS with
too many open statements". The patch adds a new global variable
@@max_prepared_stmt_count. This variable limits the total number
of prepared statements in the server. The default value of
@@max_prepared_stmt_count is 16382. 16382 small statements
(a select against 3 tables with GROUP, ORDER and LIMIT) consume 
100MB of RAM. Once this limit has been reached, the server will 
refuse to prepare a new statement and return ER_UNKNOWN_ERROR 
(unfortunately, we can't add new errors to 4.1 without breaking 5.0). The limit is changeable after startup
and can accept any value from 0 to 1 million. In case
the new value of the limit is less than the current
statement count, no new statements can be added, while the old
still can be used. Additionally, the current count of prepared 
statements is now available through a global read-only variable 
@@prepared_stmt_count.
2006-04-07 23:37:06 +04: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
ingo@mysql.com
5aa315e23a BUG#5390 - problems with merge tables
Problem #1: INSERT...SELECT, Version for 4.1.
INSERT ... SELECT with the same table on both sides (hidden
below a MERGE table) does now work by buffering the select result.
The duplicate detection works now after open_and_lock_tables() 
on the locks.
I did not find a test case that failed without the change in
sql_update.cc. I made the change anyway as it should in theory
fix a possible MERGE table problem with multi-table update.
2005-12-07 19:52:26 +01: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
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
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
sergefp@mysql.com
e9f2f9437a BUG#12915: Added single-table UPDATE/DELTE ... ORDER BY ... LIMIT
optimization: now can use index to find records to update/delete
when there is no WHERE clause.
2005-09-30 15:21:37 +04:00
sasha@asksasha.com
00eae49b5c fix for BUG#11139 (multi-delete with alias breaking replication if table rules are
present): the problem originally was that the tables in auxilliary_tables did not have 
the correct real_name, which caused problems in the second call to tables_ok(). 
The fix corrects the real_name problem, and also sets the updating flag properly, 
which makes the second call to tables_ok() unnecessary.
2005-09-14 06:31:38 -06:00
bell@sanja.is.com.ua
1bff548cb3 Merge sanja.is.com.ua:/home/bell/mysql/bk/work-4.0
into  sanja.is.com.ua:/home/bell/mysql/bk/work-4.1
2005-09-06 12:18:23 +03:00
bell@sanja.is.com.ua
10c0ef69e7 support of concurent query cache resizing (BUG#12848) 2005-09-06 11:16:53 +03:00
bar@mysql.com
0eafb9572a mysqld.cc, mysql_priv.h, sql_parse.cc:
bug#9948
  changed client-charset behavior in 4.1.x libmysql, which issue BC prob
  after review fixes
2005-09-05 20:00:11 +05:00
sergefp@mysql.com
5e9545d4c4 BUG#11869 (cont'd, eliminating "table type doesn't support FULLTEXT" error):
When creating temporary table for UNION, pass TMP_TABLE_FORCE_MYISAM flag to 
create_tmp_table if we will be using fulltext function(s) when reading from the 
temp. table.
2005-08-06 21:08:28 +00:00
hf@deer.(none)
39ef54fd8e Fix for bug #12177 (errorlog file isn't closed)
4.1 version of the patch
2005-08-04 15:23:21 +05:00
monty@mysql.com
24d45c5c30 Merge mysql.com:/home/my/mysql-4.0
into  mysql.com:/home/my/mysql-4.1
2005-07-27 13:24:59 +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
monty@mysql.com
4098c40d87 Review fixes:
Fixed portability problem with bool in C programs
Moved close_thread_tables out from LOCK_thread_count mutex (safety fix)
my_sleep() -> pthread_cond_timedwait()
2005-07-26 17:55:58 +03: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
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
monty@mishka.local
7e83d09ce7 Simple fixes during review of new code 2005-07-19 19:25:05 +03: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
konstantin@mysql.com
e08caeeee2 A fix and a test case for Bug#9359 "Prepared statements take snapshot
of system vars at PREPARE time": implement a special Item
to handle system variables. This item substitutes itself with 
a basic constant containing variable value at fix_fields.
2005-07-16 03:29:13 +04:00
konstantin@mysql.com
374b9182af Merge bk-internal.mysql.com:/home/bk/mysql-4.1
into  mysql.com:/opt/local/work/mysql-4.1-11458
2005-07-13 17:39:48 +04:00
konstantin@mysql.com
bef558b7ee - a fix for Bug#11458 "Prepared statement with subselects return random
data": remove the fix for another bug (8807) that
added OUTER_REF_TABLE_BIT to all subqueries that used a placeholder
to prevent their evaluation at prepare. As this bit hanged in 
Item_subselect::used_tables_cache for ever, a constant subquery with
a placeholder was never evaluated as such, which caused wrong 
choice of the execution plan for the statement.
- to fix Bug#8807 backport a better fix from 5.0
- post-review fixes.
2005-07-13 17:38:55 +04:00
jimw@mysql.com
de9909faec Fix crash caused by calling DES_ENCRYPT() without the --des-key-file
option having been passed to the server. (Bug #11643)
2005-07-07 11:49:44 -07:00
monty@mishka.local
83f90e060e Better bug fix for:
#9728  'Decreased functionality in "on duplicate key update
#8147  'a column proclaimed ambigous in INSERT ... SELECT .. ON DUPLICATE'

This ensures fields are uniquely qualified and also that one can't update other tables in the ON DUPLICATE KEY UPDATE part
2005-06-27 16:46:41 +03:00
konstantin@mysql.com
dcb0e65dcb Fix Bug#9334 "PS API queries in log file" and
Bug#8367 "low log doesn't gives complete information about prepared 
statements"
Implement status variables for prepared statements commands (a port of
the patch by Andrey Hristov).
See details in comments to the changed files.
No test case as there is no way to test slow log/general log in 
mysqltest.
2005-06-17 00:11:48 +04:00
konstantin@mysql.com
f10b395982 A fix for Bug#9141 "4.1 does not log into slow log
ALTER, OPTIMIZE and ANALYZE statements".
In 4.1 we disabled logging of slow admin statements. The fix adds an 
option to enable it back.
No test case (slow log is not tested in the test suite), but tested
manually.
+ post-review fixes (word police mainly).
2005-06-16 23:05:38 +04: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
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
antony@ltantony.mysql.com
cc3bfc6ff1 Bug#8733 - server accepts malformed query (multiply mentioned distinct)
Detect conflicting options in SELECT
2005-05-09 14:31:46 +01:00
ingo@mysql.com
235d2295da Merge from 4.0 needs fixes 2005-04-27 18:59:31 +02:00
ingo@mysql.com
0998abc831 Bug#7823 - FLUSH TABLES WITH READ LOCK + INSERT DELAYED = deadlock
Added protection against global read lock while creating and
initializing a delayed insert handler.
Allowed to ignore a global read lock when locking the table
inside the delayed insert handler.
Added some minor improvements.
2005-04-27 12:40:37 +02:00
ingo@mysql.com
792b816b1b Bug#7806 - insert on duplicate key and auto-update of timestamp
Modified the check for the timestamp field so that the flags for
the automatic for inserts and updates are cleared independently.
2005-04-19 15:12:32 +02:00
brian@zim.(none)
cfcedd85cd Additional storage engine called "blackhole". Customer request, and for that matter a Zawodny request. With this you can alter table to a type of table that would never store data. Its a /dev/null for a database. 2005-03-22 16:10:39 -08:00
serg@serg.mylan
e47d0a0e2d merge 2005-03-03 23:07:20 +01:00
serg@serg.mylan
8d9a53a78c Fixes for bugs reported by Stefano Di Paola (stefano.dipaola@wisec.it) 2005-03-03 19:51:29 +01:00
guilhem@mysql.com
11a1c83c03 Fix for BUG#8325 "Deadlock in replication thread stops replication":
in slave SQL thread: if a transaction fails because of InnoDB deadlock or innodb_lock_wait_timeout exceeded,
optionally retry the transaction a certain number of times (new variable --slave_transaction_retries).
2005-03-02 11:29:48 +01:00
lars@mysql.com
2d1089e8c1 Merge mysql.com:/home/bkroot/mysql-4.1 into mysql.com:/home/bk/b6662-4.1 2005-02-22 13:22:34 +01:00
lars@mysql.com
1d3c67000b BUG#6662: Changes after Guilhems and Sergs review 2005-02-22 12:40:31 +01:00
lars@mysql.com
be28ef0a20 BUG#6662: Importing mysqldumps should not show any warnings of level "notes". 2005-02-21 18:40:28 +01:00
jimw@mysql.com
5ebbc834fe Fix removal of tables from cache when the database they are contained
within is dropped and lower_case_table_names is set. (Bug #8355)
2005-02-08 15:14:14 -08:00
jimw@mysql.com
4b8d81ff1e Merge mysql.com:/home/jimw/my/mysql-4.1-6511
into mysql.com:/home/jimw/my/mysql-4.1-clean
2005-01-31 15:30:34 -08:00
acurtis@pcgem.rdg.cyberkinetica.com
6a354b1b04 Bug#7011
Merge from 4.0
2005-01-31 12:48:00 +00:00