Commit graph

606 commits

Author SHA1 Message Date
Monty
7b96416f3c Use sql_mode_t for sql_mode.
This fixed several cases where we where using just ulong for sql_mode
2016-10-05 01:11:08 +03:00
Monty
8be53a389c MDEV-6112 multiple triggers per table
This is similar to MysQL Worklog 3253, but with
a different implementation. The disk format and
SQL syntax is identical with MySQL 5.7.

Fetures supported:
- "Any" ammount of any trigger
- Supports FOLLOWS and PRECEDES to be
  able to put triggers in a certain execution order.

Implementation details:
- Class Trigger added to hold information about a trigger.
  Before this trigger information was stored in a set of lists in
  Table_triggers_list and in Table_triggers_list::bodies
- Each Trigger has a next field that poinst to the next Trigger with the
  same action and time.
- When accessing a trigger, we now always access all linked triggers
- The list are now only used to load and save trigger files.
- MySQL trigger test case (trigger_wl3253) added and we execute these
  identically.
- Even more gracefully handling of wrong trigger files than before. This
  is useful if a trigger file uses functions or syntax not provided by
  the server.
- Each trigger now has a "Created" field that shows when the trigger was
  created, with 2 decimals.

Other comments:
- Many of the changes in test files was done because of the new "Created"
  field in the trigger file. This shows up in SHOW ... TRIGGER and when
  using information_schema.trigger.
- Don't check if all memory is released if on uses --gdb;  This is needed
  to be able to get a list from safemalloc of not freed memory while
  debugging.
- Added option to trim_whitespace() to know how many prefix characters
  was skipped.
- Changed a few ulonglong sql_mode to sql_mode_t, to find some wrong usage
  of sql_mode.
2016-10-05 01:11:07 +03:00
Vladislav Vaintroub
f7a7c0c2fe MDEV-10297 Add priorization to threadpool
Also MDEV-10385 Threadpool refactoring
2016-09-22 17:01:28 +00:00
Sergey Vojtovich
a2b1c58c19 MDEV-10296 - Multi-instance table cache
Fixed sysvars_server_[not]embedded failure: changed type of
table_open_cache_instances from ulong to uint.

Added casts foratomic operations around tc_active_instances and
tc_contention_warning_reported: needed on some platforms.
2016-09-16 18:41:21 +04:00
Sergey Vojtovich
8613633f26 MDEV-10296 - Multi-instance table cache
Table cache instances autosizing.
2016-09-16 15:46:15 +04:00
Sergey Vojtovich
7e9ac7b8ac MDEV-10296 - Multi-instance table cache
Improve scalability by implementing multi-instance table cache.
2016-09-16 15:46:15 +04:00
Sergei Golubchik
06b7fce9f2 Merge branch '10.1' into 10.2 2016-09-09 08:33:08 +02:00
Igor Babaev
3fb4f9bb93 Merge branch '10.2-mdev9197-cons' of github.com:shagalla/server
into branch 10.2-mdev9197.
2016-08-31 16:16:54 -07:00
Igor Babaev
f11e892b57 Merge branch '10.2' of github.com:MariaDB/server into bb-10.2-mdev9864 2016-08-31 10:34:21 -07:00
Oleksandr Byelkin
6dfa1d374e MDEV-8931: (server part of) session state tracking
Postreview fixes.
New MySQL tests fixes.
2016-08-31 17:17:46 +02:00
Oleksandr Byelkin
0ee3e64c55 MDEV-8931: (server part of) session state tracking
Transaction tracker
2016-08-31 17:17:46 +02:00
Oleksandr Byelkin
c8948b0d0d MDEV-8931: (server part of) session state tracking
System variables tracking
2016-08-31 17:17:46 +02:00
Oleksandr Byelkin
e7608a78ef MDEV-8931: (server part of) session state tracking
initial commit to test
2016-08-31 17:17:46 +02:00
Igor Babaev
2250e9ea26 Merge 10.2 into 10.2-mdev9864. 2016-08-30 16:14:51 -07:00
Monty
1c91569274 Set server_id to 1 by default and disallow to set it to 0
This makes it easier to setup master as on only have to set --log-bin.
Before this patch if one did set up the master with just --log-bin, slaves
could not connect until server_id was set on the master, which could be
both confusing and hard to do.
2016-08-29 20:28:06 +03:00
Nirbhay Choubey
3575618237 Post merge fixes. 2016-08-25 21:28:26 -04:00
Nirbhay Choubey
90266e8a0e Merge branch '10.0-galera' into bb-10.1-serg 2016-08-25 15:39:39 -04:00
Sergei Golubchik
6b1863b830 Merge branch '10.0' into 10.1 2016-08-25 12:40:09 +02:00
Nirbhay Choubey
c309e99ff9 Merge branch '10.0' into 10.0-galera 2016-08-24 19:30:32 -04:00
Vicențiu Ciorbaru
4eb898bb16 MDEV-10563 Crash during shutdown in Master_info_index::any_slave_sql_running
In well defined C code, the "this" pointer is never NULL. Currently, we
were potentially dereferencing a NULL pointer (master_info_index). GCC v6
removes any "if (!this)" conditions as it assumes this is always a
non-null pointer. In order to prevent undefined behaviour, check the
pointer before dereferencing and remove the check within member
functions.
2016-08-23 21:24:36 +03:00
Galina Shalygina
eb2c147475 The consolidated patch for mdev-9197. 2016-08-23 00:39:12 +03:00
Igor Babaev
2f9555c40f Removed the parameter from st_select_lex_unit::exec_recursive.
Moved checking whether the limit set for the number of iterations
when executing a recursive query has been reached from
st_select_lex_unit::exec_recursive to TABLE_LIST::fill_recursive.
Changed the name of the system variable max_recursion_level for
max_recursive_iterations.
Adjusted test cases.
2016-08-10 15:51:40 -07:00
Sergei Golubchik
309c08c17c Merge branch '5.5' into 10.0 2016-08-10 19:19:05 +02:00
Sergei Golubchik
0098d789c9 MDEV-10465 general_log_file can be abused
Windows!
2016-08-09 13:25:40 +02:00
Sergei Golubchik
2a54a530a9 MDEV-10465 general_log_file can be abused
followup
2016-08-08 21:27:30 +02:00
Sergei Golubchik
470f2598cc MDEV-10465 general_log_file can be abused
This issue was discovered by
Dawid Golunski (http://legalhackers.com)
2016-08-03 20:56:24 +02:00
Sergei Golubchik
0214115c7f trivial cleanup 2016-08-03 20:53:10 +02:00
Nirbhay Choubey
67480fc5fd MDEV-10429: sys_vars.sysvars_wsrep fails in buildbot on host 'work' (valgrind builder)
- Fixed the test
- Improved comment for wsrep_drupal_282555_workaround
2016-07-28 15:49:59 -04:00
Daniele Sciascia
74f80b3499 MW-267 Enforce wsrep_max_ws_size limit in wsrep provider
This changes variable wsrep_max_ws_size so that its value
is linked to the value of provider option repl.max_ws_size.
That is, changing the value of variable wsrep_max_ws_size
will change the value of provider option repl.max_ws_size,
and viceversa.
The writeset size limit is always enforced in the provider,
regardless of which option is used.
2016-07-25 11:44:57 -04:00
Daniele Sciascia
3db92ee433 MW-265 Add support for wsrep_max_ws_rows
Variable wsrep_max_ws_rows limits the number of rows that a transaction
can insert/update/delete.
2016-07-19 21:06:42 -04:00
Sergei Golubchik
932646b1ff Merge branch '10.1' into 10.2 2016-06-30 16:38:05 +02:00
Michael Widenius
db7edfed17 MDEV-7563 Support CHECK constraint as in (or close to) SQL Standard
MDEV-10134 Add full support for DEFAULT

- Added support for using tables with MySQL 5.7 virtual fields,
  including MySQL 5.7 syntax
- Better error messages also for old cases
- CREATE ... SELECT now also updates timestamp columns
- Blob can now have default values
- Added new system variable "check_constraint_checks", to turn of
  CHECK constraint checking if needed.
- Removed some engine independent tests in suite vcol to only test myisam
- Moved some tests from 'include' to 't'. Should some day be done for all tests.
- FRM version increased to 11 if one uses virtual fields or constraints
- Changed to use a bitmap to check if a field has got a value, instead of
  setting HAS_EXPLICIT_VALUE bit in field flags
- Expressions can now be up to 65K in total
- Ensure we are not refering to uninitialized fields when handling virtual fields or defaults
- Changed check_vcol_func_processor() to return a bitmap of used types
- Had to change some functions that calculated cached value in fix_fields to do
  this in val() or getdate() instead.
- store_now_in_TIME() now takes a THD argument
- fill_record() now updates default values
- Add a lookahead for NOT NULL, to be able to handle DEFAULT 1+1 NOT NULL
- Automatically generate a name for constraints that doesn't have a name
- Added support for ALTER TABLE DROP CONSTRAINT
- Ensure that partition functions register virtual fields used. This fixes
  some bugs when using virtual fields in a partitioning function
2016-06-30 11:43:02 +02:00
Nirbhay Choubey
7ff44b1a83 MDEV-10161: wsrep_sync_wait not enabled when set to 1 in config file
Since wsrep_sync_wait & wsrep_causal_reads variables are related,
they are always kept in sync whenever one of them changes.
Same is tried on server start, where wsrep_sync_wait get updated
based on wsrep_causal_reads' value. But, since wsrep_causal_reads
is OFF by default, wsrep_sync_wait's value gets modified and loses
its WSREP_SYNC_WAIT_BEFORE_READ bit.

Fixed by syncing wsrep_sync_wait & wsrep_causal_reads values
individually on server start in mysqld_get_one_option() based
on command line arguments used.
2016-06-27 18:30:07 -04:00
Nirbhay Choubey
b57232d3cb MDEV-6699 : wsrep_node_name not automatically set to hostname
Fixed by using hostname (glob_hostname) as default value for
wsrep_node_name system variable.
Added a test case.
2016-06-27 17:56:59 -04:00
Nirbhay Choubey
7305be2f7e MDEV-5535: Cannot reopen temporary table
mysqld maintains a list of TABLE objects for all temporary
tables created within a session in THD. Here each table is
represented by a TABLE object.

A query referencing a particular temporary table for more
than once, however, failed with ER_CANT_REOPEN_TABLE error
because a TABLE_SHARE was allocate together with the TABLE,
so temporary tables always had only one TABLE per TABLE_SHARE.

This patch lift this restriction by separating TABLE and
TABLE_SHARE objects and storing TABLE_SHAREs for temporary
tables in a list in THD, and TABLEs in a list within their
respective TABLE_SHAREs.
2016-06-10 18:39:43 -04:00
Sergei Petrunia
5a5a54f7b4 MDEV-8989: ORDER BY optimizer ignores equality propagation
Post-fix #2:
- Update test results
- Make the optimization conditional under @@optimizer_switch flag.
- The optimization is now disabled by default, so .result files
  are changed back to be what they were before the MDEV-8989 patch.
2016-06-01 23:43:11 +03:00
Galina Shalygina
b4f1f42062 Fixed the problem of wrong identification of WITH tables defined in WITH clauses without RECURSIVE.
Added test cases to check the fix.
Fixed the problem of wrong types of recursive tables when the type of anchor part does not coincide with the
type of recursive part.
Prevented usage of marerialization and subquery cache for subqueries with recursive references.
Introduced system variables 'max_recursion_level'.
Added a test case to test usage of this variable.
2016-05-24 21:29:52 +03:00
Galina Shalygina
46a2e41398 Fixed many problems in the code of With_element::check_unrestricted_recursive().
Added the check whether there are set functions in the specifications of recursive CTE.
Added the check whether there are recursive references in subqueries.
Introduced boolean system variable 'standards_compliant_cte'. By default it's set to 'on'.
When it's set to 'off' non-standard compliant CTE can be executed.
2016-05-19 22:07:53 +03:00
Galina Shalygina
be1d06c8a5 Merge branch '10.2' into 10.2-mdev9864 2016-05-08 23:04:41 +03:00
Monty
d0b178fb45 Added new range of MariaDB error messages, starting from 3000
This is done by splitting variables.errmsg and locale.errmsg to
variables.errmsg_extra and locale.errmsg_extra

The ER() macros in unireg.h now looks more complex than before, but this
isn't critical as most usage of them are with constants and the compiler
will remove most of the test code.
2016-04-05 18:00:03 +03:00
Sergei Golubchik
f67a2211ec Merge branch '10.1' into 10.2 2016-03-23 22:36:46 +01:00
Monty
fa3edbf40d Increase value of thread_cache_size to 32
Added 5 minute timeout before automaticlally removing threads from thread
cache.

This solves a problem with jemalloc, which is slow with a small
thread cache and also makes thread_cache big enough that most users
doesn't have to touch it
2016-03-22 23:44:52 +02:00
Alexey Botchkov
0a4a78ae8c MDEV-6058 MySQL Bug #11766693: LOG-SLOW-ADMIN-STATEMENTS AND
LOG-SLOW-SLAVE-STATEMENTS NOT DISPLAYED.

        These parameters were moved from the command line options to
        the system variables section. Treatment of the
        opt_log_slow_slave_statements changed to let the
        dynamic change of the variable.
2016-03-22 23:26:39 +04:00
Oleksandr Byelkin
e5377457d8 MDEV-9058: protocol: COM_MULTI command (part 1)
Adding a command from the end of avaliable commands numering space (254)
2016-03-18 17:24:12 +01:00
Sergei Golubchik
00d1db7a38 Merge branch '10.1' into 10.2 2016-02-25 18:19:55 +01:00
Nirbhay Choubey
0d58323e26 Merge tag 'mariadb-10.0.24' into 10.0-galera 2016-02-23 20:53:29 -05:00
Sergei Golubchik
d4b1425b60 cleanup
* make a local variable for target_table->field[col]
* move an often-used bit function to my_bit.h
* remove a non-static and not really needed trivial comparison
  function with a very generic name
2016-02-23 10:46:16 +01:00
Vladislav Vaintroub
b436db98fe Fix compilation 2016-02-10 00:20:23 +01:00
Monty
b3093073b1 Changed my_thread_id to int64 to fix compilation problem with
my_atomic_add32_explicit on windows
Fixed that server_audit.c also works if one compiles with safemalloc
Fixed compiler warnings
2016-02-08 22:34:41 +02:00
Monty
b2f8d7b410 Merge branch '10.1' into 10.2
Conflicts:
	VERSION
	cmake/plugin.cmake
	config.h.cmake
	configure.cmake
	plugin/server_audit/server_audit.c
	sql/sql_yacc.yy
2016-02-06 18:14:54 +02:00