Commit graph

1685 commits

Author SHA1 Message Date
Sergei Golubchik
59d9d08e2b 5.5 merge 2014-02-01 00:54:03 +01:00
Sergei Golubchik
4bf002d6a0 MDEV-5576 ALTER TABLE progress report > 100% 2014-01-27 20:50:32 +01:00
Michael Widenius
680288873c Fix for MDEV-5168: MariaDB returns warnings for INSERT IGNORE
Added variable "OLD_MODE" that can be used to turn off the new behavior

mysql-test/r/insert.result:
  Added test case
mysql-test/r/mysqld--help.result:
  Added old_mode
mysql-test/suite/sys_vars/r/old_mode_basic.result:
  Added testing of new variable
mysql-test/suite/sys_vars/t/old_mode_basic.test:
  Added testing of new variable
mysql-test/t/insert.test:
  Added test case
sql/sql_class.h:
  Added bit flags for OLD_MODE
sql/sql_insert.cc:
  Disable duplicate key warnings for INSERT IGNORE of OLD_MODE NO_DUP_KEY_WARNINGS_WITH_IGNORE is used
sql/sql_show.cc:
  Don't show progress reporting on SHOW PROCESSLIST if OLD_MODE NO_PROGRESS_INFO is used
sql/sys_vars.cc:
  Added OLD_MODE
2014-01-26 21:48:42 +01:00
Sergei Golubchik
c6d30805db 5.5 merge 2013-11-23 00:50:54 +01:00
Sergei Golubchik
fa3f8a18b2 mysql-5.5.34 merge
(some patches reverted, test case added)
2013-11-19 13:16:25 +01:00
Sergei Golubchik
bdd883ed9a 5.5. merge 2013-11-13 14:07:58 +01:00
Sergey Petrunya
2cba9e0cdc MDEV-407: Print EXPLAIN [ANALYZE] in the slow query log
- Address input from the mail list: change how EXPLAIN is 
  formatted in the slow query log.
2013-11-12 17:13:11 +04:00
Sergei Golubchik
feea10a453 MDEV-5101 INFORMATION_SCHEMA.PROCESSLIST reports an incorrect value for Time for connecting threads
by convention query execution time should be 0 if its start_time is 0
(this was lost when fixing MDEV-4578)
2013-11-11 09:31:17 +01:00
Alexander Barkov
8f0be1ad7c Merge 5.5 -> 10.0-base 2013-11-09 00:16:42 +04:00
Alexander Barkov
ef43b71fd2 Merge 5.3 -> 5.5 2013-11-08 23:14:26 +04:00
Alexander Barkov
542ce5a068 Merge 5.2 -> 5.3 2013-11-08 22:50:01 +04:00
Alexander Barkov
d5cd8cd724 Merge 5.1 -> 5.2 2013-11-08 22:22:25 +04:00
Alexander Barkov
a4dc526fc7 MDEV-5181 incorrect binary search in remove_status_vars()
The loop in the binary search in remove_status_vars() was
incorrectly implemented and could continue infinitely in some cases.
Rewrote the binary search code.
2013-11-08 22:19:24 +04:00
Sergei Golubchik
b2f16628cf support DEFINER=role and DEFINER=current_role 2013-10-18 12:17:49 -07:00
Sergei Golubchik
fe2d265704 INFORMATION_SCHEMA.APPLICABLE_ROLES table 2013-10-18 09:15:55 -07:00
Sergei Golubchik
7f0965f490 information_schema.enabled_roles table 2013-10-18 09:15:46 -07:00
Sergey Petrunya
7be365ea9c MDEV-3798: [SHOW] EXPLAIN UPDATE/DELETE
- When showing EXPLAIN output in the slow query log, 
  format it so that one could use grep or other tool
  to get the output.
2013-10-15 13:21:06 +04:00
Sergey Petrunya
1e36cbfa39 MDEV-3798: [SHOW] EXPLAIN UPDATE/DELETE
- Merge with 10.0-base
2013-10-15 11:51:41 +04:00
Sergey Petrunya
2add402891 MDEV-407: Print EXPLAIN [ANALYZE] in the slow query log
- Initial implementation.
2013-09-19 08:33:58 +04:00
Sergey Vojtovich
1a2a9d74fe MDEV-4911 - add KILL query id, and add query id information to processlist
It is now possible to kill query by query id. KILL syntax was extended to:
KILL [HARD | SOFT] [CONNECTION | QUERY [ID query_id]] [thread_id | USER user_name]

Added QUERY_ID column to INFORMATION_SCHEMA.PROCESSLIST.

Fixed tests affected by this change:
- added PROCESSLIST.QUERY_ID column
- ID is now keyword and is quoted in SHOW CREATE TABLE output
- PFS statement digest is calculated basing on token id
  (not token text). Token id has shifted for keywords residing
  after ID in keywords array.
2013-09-13 20:14:56 +04:00
Sergey Petrunya
662bfed027 [SHOW] EXPLAIN UPDATE/DELETE, code re-structuring
- Merge with current 10.0-base
2013-08-24 00:46:49 +04:00
Praveenkumar Hulakund
72ff5686a0 Bug#11765252 - READ OF FREED MEMORY WHEN "USE DB" AND
"SHOW PROCESSLIST"

Follow up path, addressing pb2 test failure.
2013-08-23 18:56:31 +05:30
Ashish Agarwal
292aa926c1 WL#7076: Backporting wl6715 to support both formats
in 5.5, 5.6, 5.7.
2013-08-23 09:07:09 +05:30
Praveenkumar Hulakund
7fffec875a Bug#11765252 - READ OF FREED MEMORY WHEN "USE DB" AND
"SHOW PROCESSLIST"

Merging from 5.1 to 5.5
2013-08-21 10:44:22 +05:30
Praveenkumar Hulakund
3b1e98d218 Bug#11765252 - READ OF FREED MEMORY WHEN "USE DB" AND
"SHOW PROCESSLIST"

Analysis:
----------
The problem here is, if one connection changes its
default db and at the same time another connection executes
"SHOW PROCESSLIST", when it wants to read db of the another
connection then there is a chance of accessing the invalid
memory. 

The db name stored in THD is not guarded while changing user
DB and while reading the user DB in "SHOW PROCESSLIST".
So, if THD.db is freed by thd "owner" thread and if another
thread executing "SHOW PROCESSLIST" statement tries to read
and copy THD.db at the same time then we may endup in the issue
reported here.

Fix:
----------
Used mutex "LOCK_thd_data" to guard THD.db while freeing it
and while copying it to processlist.
2013-08-21 10:39:40 +05:30
prabakaran thirumalai
8412ac003c Bug#17083851 BACKPORT BUG#11765744 TO 5.1, 5.5 AND 5.6
Description:
Original fix Bug#11765744 changed mutex to read write lock
to avoid multiple recursive lock acquire operation on 
LOCK_status mutex.  
On Windows, locking read-write lock recursively is not safe. 
Slim read-write locks, which MySQL uses if they are supported by
Windows version, do not support recursion according to their 
documentation. For our own implementation of read-write lock, 
which is used in cases when Windows version doesn't support SRW,
recursive locking of read-write lock can easily lead to deadlock
if there are concurrent lock requests.
      
Fix:  
This patch reverts the previous fix for bug#11765744 that used
read-write locks. Instead problem of recursive locking for
LOCK_status mutex is solved by tracking recursion level using 
counter in THD object and acquiring lock only once when we enter 
fill_status() function first time.
2013-07-30 09:51:14 +05:30
prabakaran thirumalai
592a2b2a94 Bug#17083851 BACKPORT BUG#11765744 TO 5.1, 5.5 AND 5.6
Description:
Original fix Bug#11765744 changed mutex to read write lock
to avoid multiple recursive lock acquire operation on 
LOCK_status mutex.  
On Windows, locking read-write lock recursively is not safe. 
Slim read-write locks, which MySQL uses if they are supported by
Windows version, do not support recursion according to their 
documentation. For our own implementation of read-write lock, 
which is used in cases when Windows version doesn't support SRW,
recursive locking of read-write lock can easily lead to deadlock
if there are concurrent lock requests.

Fix:  
This patch reverts the previous fix for bug#11765744 that used
read-write locks. Instead problem of recursive locking for
LOCK_status mutex is solved by tracking recursion level using 
counter in THD object and acquiring lock only once when we enter 
fill_status() function first time.
2013-07-30 09:44:11 +05:30
Sergei Golubchik
97e640b9ae 5.5 merge 2013-07-17 21:24:29 +02:00
Sergei Golubchik
005c7e5421 mysql-5.5.32 merge 2013-07-16 19:09:54 +02:00
Sergey Petrunya
9651a6f574 mdev-4173: Wrong result (extra row) with semijoin=on, joins in outer query, LEFT JOIN in the subquery
Apply the patch from Patryk Pomykalski:
- create_internal_tmp_table_from_heap() will now return information whether
  the last row that we tried to write was a duplicate row.
(mysql-5.6 also has this change)
2013-07-16 09:22:17 +04:00
Alexander Barkov
c51ed128b0 Merge from 5.3 2013-07-10 02:05:06 +04:00
Alexander Barkov
8a732d5a5e Merge from 5.2
modified:
  mysql-test/suite/plugins/r/fulltext_plugin.result
  mysql-test/suite/plugins/t/fulltext_plugin.test
  plugin/fulltext/plugin_example.c
  sql/sql_show.cc
pending merges:
  Alexander Barkov 2013-07-09 [merge] Merge from 5.1
    Sergei Golubchik 2013-07-06 Bug #69682 - mysqld crashes after uninst...
    Sergei Golubchik 2013-05-24 MDEV-4575 MySQL client doesn't strip off...
2013-07-09 11:02:56 +04:00
Alexander Barkov
762d3cb8ed Merge from 5.1
modified:
  mysql-test/suite/plugins/r/fulltext_plugin.result
  mysql-test/suite/plugins/t/fulltext_plugin.test
  plugin/fulltext/plugin_example.c
  sql/sql_show.cc
pending merges:
  Sergei Golubchik 2013-07-06 Bug #69682 - mysqld crashes after uninstall ...
    Sergei Golubchik 2013-05-24 MDEV-4575 MySQL client doesn't strip off...
2013-07-09 10:54:47 +04:00
Sergei Golubchik
48b403cd65 Bug #69682 - mysqld crashes after uninstall of plugin with "first" status var 2013-07-06 15:28:11 +02:00
Ashish Agarwal
e879caf845 WL#7076: Backporting wl6715 to support both formats in 5.5, 5.6, 5.7
Backporting wl6715 to mysql-5.5
2013-07-02 11:58:39 +05:30
Sergey Petrunya
ef47cc1f09 [SHOW] EXPLAIN UPDATE/DELETE, code re-structuring
- Merge with 10.0-base
2013-06-27 18:28:14 +04:00
Sergei Golubchik
0973b7a8d2 partitioning frm bugs:
1. default db type for partitions was stored as 1-byte DB_TYPE code,
   which doesn't work for dynamically generated codes.
2. storage engine plugin for default db type wasn't locked at all,
   which could trivially crash for dynamic plugins.

Now the storage engine name is stored in the extra2 section,
and the plugin is correctly locked.
2013-06-15 19:10:00 +02:00
Sergei Golubchik
8bc6aed491 plugin_hton helper 2013-06-15 19:09:47 +02:00
Sergei Golubchik
68a6705ed1 MDEV-4441 DROP DATABASE with a newly created ARCHIVE table does not work
1. DROP DATABASE should use ha_discover_table_names(), not look at .frm files.
2. filename_to_tablename() also encodes temp file names #sql- -> #mysql50##sql
3. no special treatment for #sql- files, no TABLE_LIST::internal_tmp_table
4. discover also table file names, that start from #
2013-06-15 19:09:31 +02:00
Sergei Golubchik
85a8de31b1 MDEV-4578 information_schema.processlist reports incorrect value for Time (2147483647)
SHOW PROCESSLIST might see a thread that started executing a query *after*
processlist has started. Don't show a negative or huge wrapped-around query execution time.
2013-06-13 20:19:32 +02:00
Sergei Golubchik
36c7535198 MDEV-4519 SHOW EVENTS and SHOW PROCEDURE STATUS truncate long user names
fix I_S table definitions in sql_show.cc
2013-06-13 20:18:40 +02:00
Sergei Golubchik
dacb3809a2 MDEV-4422 SHOW PROCESSLIST reference to THD::db not protected against simultaneous updates
protect THD::db with THD::LOCK_thd_data
2013-06-12 20:29:19 +02:00
Sergei Golubchik
4749d40c63 5.5 merge 2013-06-06 17:51:28 +02:00
Sergey Petrunya
e21b32d7fa [SHOW] EXPLAIN UPDATE/DELETE - Merge with 10.0-base 2013-05-27 09:31:41 +04:00
Michael Widenius
0737932b90 Fixed that SHOW PROCESSLIST and information_schema.processlist uses the right length for user names.
Fixed some failing tests


mysql-test/mysql-test-run.pl:
  Removed warning from mysql-test-run
mysql-test/r/create.result:
  Updated result
mysql-test/r/log_slow.result:
  Fixed failing test
mysql-test/suite/funcs_1/r/is_columns_is.result:
  Updated result
mysql-test/suite/funcs_1/r/processlist_priv_no_prot.result:
  Updated result
mysql-test/suite/funcs_1/r/processlist_val_no_prot.result:
  Updated result
mysql-test/t/log_slow.test:
  Ensure variables are properly reset at end of test
sql/sql_show.cc:
  Fixed max length for user names
2013-05-11 20:31:50 +03:00
Sergei Golubchik
b381cf843c mysql-5.5.31 merge 2013-05-07 13:05:09 +02:00
Michael Widenius
5333dafa84 Fixed errors and compiler warnings found by buildbot
Solaris fixes:
- Fixed that wait_timeout_func and wait_timeout tests works on solaris
- We have to compile without NO_ALARM on Solaris as Solaris doesn't support timeouts on sockets with setsockopt(.. SO_RCVTIMEO).
- Fixed that compile-solaris-amd64-debug works (before that we got a wrong ELF class: ELFCLASS64 on linkage)
- Added missing sync_with_master
Other bug fixes:
- Free memory for rpl_global_gtid_binlog_state before exit() to avoid 'accessing uninitalized mutex' error.



BUILD/FINISH.sh:
  Fixed issues on Solaris with ksh
BUILD/compile-solaris-amd64-debug:
  Added missing -m64 flag
configure.cmake:
  We have to compile without NO_ALARM on Solaris as Solaris doesn't support timeouts on sockets with setsockopt(.. SO_RCVTIMEO)
mysql-test/suite/rpl/t/rpl_gtid_mdev4473.test:
  - Added missing sync_with_master (fix by knielsen)
sql-common/client.c:
  Added () to get rid of compiler warning
sql/item_strfunc.cc:
  Fixed compiler warning
sql/log.cc:
  Free memory for static variable rpl_global_gtid_binlog_state before exit()
  - If we are compiling with safemalloc, we would try to call sf_free() for some members after sf_terminate() was called, which would result of trying to access the uninitalized mutex 'sf_mutex'
sql/multi_range_read.cc:
  Fixed compiler warnings of converting double to ulong.
sql/opt_range.cc:
  Fixed compiler warnings of converting double to ulong or uint
  - Better to have all variables that can be number of rows as 'ha_rows'
sql/rpl_gtid.cc:
  Added rpl_binlog_state::free() to be able to free memory for static objects before exit()
sql/rpl_gtid.h:
  Added rpl_binlog_state::free() to be able to free memory for static objects before exit()
sql/set_var.cc:
  Fixed compiler warning
sql/sql_join_cache.cc:
  Fixed compiler warnings of converting double to uint
sql/sql_show.cc:
  Added cast to get rid of compiler warning
sql/sql_statistics.cc:
  Remove code that didn't do anything.
  (store_record() with record[0] is a no-op)
storage/xtradb/os/os0file.c:
  Added  __attribute__ ((unused))
support-files/compiler_warnings.supp:
  Ignore warnings from atomic_add_64_nv
  (was not able to fix this with a cast as the macro is a bit different between systems)
vio/viosocket.c:
  Added more DBUG_PRINT
2013-05-05 21:39:31 +03:00
Sergei Golubchik
84ce6832e6 MDEV-4332 Increase username length from 16 characters 2013-04-18 22:17:29 +02:00
Sergei Golubchik
30b2c64c4e compiler warnings 2013-04-15 11:19:39 +02:00
Sergei Golubchik
f57ecb7786 5.5 merge 2013-04-14 10:04:07 +02:00