Commit graph

64446 commits

Author SHA1 Message Date
Sergei Golubchik
a099686e2e cleanup: remove Field->stored_in_db, Create_field->stored_in_db
and don't set Create_field->sql_type to MYSQL_TYPE_VIRTUAL
temporarily only to change it again few lines later.
2015-11-24 22:21:42 +01:00
Sergei Golubchik
13989b36c1 cleanup: remove useless internal fied flag 2015-11-24 22:21:42 +01:00
Sergei Golubchik
4434c5cee8 followup for optimizer_search_depth change
see commit 81e4ce5
2015-11-24 22:21:41 +01:00
Alexander Barkov
80ca997faa Changing %type of opt_place from <NONE> to <const_simple_string>.
A prerequisite change for:
- MDEV-8093 sql_yacc.yy: add %type create_field for field_spec and column_def
- MDEV-8094 sql_yacc.yy: get rid of the rules "opt_if_not_exists_table_element"
            and "opt_if_exists_table_element"
- MDEV-8095 Split Create_field
2015-11-24 12:44:35 +04:00
Sergei Golubchik
65d69c84cf cmake: remove unused checks, options, and symbols 2015-11-23 16:02:56 +01:00
Alexander Barkov
d73cf394a5 MDEV-9170 Get rid of LEX::length and LEX::dec
A preparatory task for:
  MDEV-4912 Add a plugin to field types (column types)
2015-11-23 18:55:01 +04:00
Alexander Barkov
b7e9bf9122 MDEV-9169 BINLOG_SYM in keywords_sp causes shift/reduce conflicts 2015-11-23 17:52:09 +04:00
Alexander Barkov
6b97b0c5e0 MDEV-9166 Wrong error message and shift/reduce conflicts in the RETURNS clause 2015-11-23 14:49:23 +04:00
Sergei Golubchik
d0dc7b3e92 Merge branch '10.1' into 10.2 2015-11-20 11:18:16 +01:00
Sergei Golubchik
2fc3dc393d Merge branch '10.1' into bb-10.1-serg 2015-11-20 09:31:13 +01:00
Sergei Golubchik
e52c753ab9 cleanup 2015-11-20 09:16:36 +01:00
Monty
1e156e1436 Fixed compile warnings on Solaris 2015-11-20 10:00:06 +02:00
Sergei Golubchik
7f19330c59 Merge branch 'github/10.0-galera' into 10.1 2015-11-19 17:48:36 +01:00
Sergei Golubchik
4046ed12bc rbr and savepoint in a subtatement
Apply MySQL fix for bug#76727:
https://github.com/mysql/mysql-server/commit/69d4e72c

  Bug#20901025: SLAVE ASSERTION IN UNPACK_ROW WITH ROLLBACK TO
  SAVEPOINT IN ERROR HANDLER
2015-11-19 17:04:19 +01:00
Sergei Golubchik
beded7d9c9 Merge branch '10.0' into 10.1 2015-11-19 15:52:14 +01:00
Oleksandr Byelkin
81e4ce5e31 Removed depricated optimizer_search_depth. 2015-11-19 10:56:30 +01:00
Sergei Golubchik
ab476a8d10 Merge branch '5.5' into 10.0 2015-11-18 22:03:02 +01:00
Sergei Petrunia
f91798dd1c MDEV-7370: Server deadlocks on renaming a table for which persistent statistics exists
RENAME TABLE code tries to update EITS statistics. It hung, because
it used an index on (db_name,table_name) to find the table, and attempted
to update these values at the same time. The fix is do what SQL UPDATE
statement does when updating index that it's used for scanning:
- First, buffer the rowids of rows to be updated,
- then make the second pass to actually update the rows

Also fixed the call to rename_table_in_stat_tables() in sql_rename.cc
to pass the correct new database (before, it passed old db_name so cross-
database renames were not handled correctly).

Variant #2, with review feedback addressed.
2015-11-18 21:31:45 +03:00
Monty
c2ec897745 Fixed buildbot failures on Solaris 64 bit
rpl/rpl_mdev382     ; Wrong replace in show_binlog_events2.inc
binlog/database     ; Different error on Solaris if file exists
mroonga/repair_table_no_index_file ; Different system error on Solaris
partition_not_blackhole ; Different error on Solaris
partition_myisam     ; Different error on Solaris

Some other failures in mroonga was because have_32bit.inc didn't correctly
detect 64 bits on Solaris. Fixed using DEFAULT_MACHINE instead of MACHINE_TYPE
for Sys_version_compile_machine.
2015-11-18 17:42:39 +02:00
Nirbhay Choubey
f47124c9ef Incorrect statements binlogged on slave with do_domain_ids=(...)
In domain ID based filtering, a flag is used to filter-out
the events that belong to a particular domain. This flag gets
set when IO thread receives a GTID_EVENT for the domain on
filter list and its reset at the last event in the GTID group.
The resetting, however, was wrongly done before the decision to
write/filter the event from relay log is made. As a result, the
last event in the group will always pass through the filter.
Fixed by deferring the reset logic. Also added a test case.
2015-11-18 02:11:20 -05:00
Vladislav Vaintroub
dd90dae3c0 MDEV-7588 Add thd_wait_begin/end to notify threadpool of binlog waits 2015-11-17 20:08:36 +01:00
Alexey Botchkov
836275bb20 MDEV-4829 BEFORE INSERT triggers dont issue 1406 error.
Turn the 'abort_on_warning' on for assigning value to fields.
2015-11-17 22:09:42 +04:00
Vladislav Vaintroub
e669a5fd87 MDEV-7588 Add thd_wait_begin/end to notify threadpool of binlog waits 2015-11-17 18:33:08 +01:00
Sergei Golubchik
296338147c MDEV-8453 Alter table not returning engine errors
remove ~15 years old print_lock_error() function, use
handler::print_error() instead
2015-11-16 07:55:55 +01:00
Sergei Golubchik
2e0ac16827 remove obsolete workaround
The workaround is not needed anymore - mariadb requires bison 2.x.

And removing all __attribute__ in sql_yacc.yy breaks
new DBUG_ENTER.
2015-11-16 07:55:55 +01:00
Sergei Golubchik
da957310d0 compiler warning (no return in non-void function) 2015-11-16 07:55:55 +01:00
Kristian Nielsen
e46c8bbf62 Merge branch 'mdev7818-4' into bb-10.1-knielsen
Conflicts:
	sql/sql_parse.cc
2015-11-13 15:32:55 +01:00
Kristian Nielsen
65986b8a0a Merge branch 'mdev7818-4' into bb-10.0-knielsen 2015-11-13 15:30:48 +01:00
Kristian Nielsen
d5d87c98c0 Fix embedded server build after MDEV-7818 patch 2015-11-13 15:30:37 +01:00
Kristian Nielsen
8f2e05f41c Merge branch 'mdev7818-4' into 10.1
Conflicts:
	mysql-test/suite/perfschema/r/stage_mdl_global.result
	sql/rpl_rli.cc
	sql/sql_parse.cc
2015-11-13 14:24:40 +01:00
Kristian Nielsen
6bf88cdd9d Merge branch 'mdev7818-4' into bb-10.0-knielsen 2015-11-13 14:08:38 +01:00
Kristian Nielsen
ba02550166 MDEV-7818: Deadlock occurring with parallel replication and FTWRL
Problem is that FLUSH TABLES WITH READ LOCK first blocks threads from
starting new commits, then waits for running commits to complete. But
in-order parallel replication needs commits to happen in a particular
order, so this can easily deadlock.

To fix this problem, this patch introduces a way to temporarily pause
the parallel replication worker threads. Before starting FTWRL, we let
all worker threads complete in-progress transactions, and then
wait. Then we proceed to take the global read lock. Once the lock is
obtained, we unpause the worker threads. Now commits are blocked from
starting by the global read lock, so the deadlock will no longer occur.
2015-11-13 14:02:15 +01:00
Kristian Nielsen
6d96fab7dd MDEV-7818: Deadlock occurring with parallel replication and FTWRL
Preparation patch, moving the GCO wait into a separate function, in
preparation for adding a separate wait phase for FLUSH TABLES WITH
READ LOCK.
2015-11-13 14:02:14 +01:00
Kristian Nielsen
75dc267101 Change Seconds_behind_master to be updated only at commit in parallel replication
Before, the Seconds_behind_master was updated already when an event
was queued for a worker thread to execute later. This might lead users
to interpret a low value as the slave being almost up to date with the
master, while in reality there might still be lots and lots of events
still queued up waiting to be applied by the slave.

See https://lists.launchpad.net/maria-developers/msg08958.html for
more detailed discussions.
2015-11-13 10:24:53 +01:00
Monty
e8c1b35f18 MDEV-8476 Race condition in slave SQL thread shutdown
Patch backported from MariaDB 10.1

- Ensure that we wait with cleanup() until slave thread has stopped.
- Added signal_thd_deleted() to signal close_connections() that all THD's has been freed.

Other things
- Removed not needed calls to THD_CHECK_SENTRY() when we are calling 'delete thd'.
2015-11-12 14:51:01 +02:00
Vladislav Vaintroub
6c8f650ea0 MDEV-9089 Server crashes in MDL_key::mdl_key_init (main.lowercase_table4 test fails)
Fix : make sure that database name is converted to lowercase in
check_fk_parent_table_access(), if lowercase_table_names !=0
2015-11-10 14:45:26 +01:00
Monty
65151e0cd1 Change stage_copying_to_tmp_table to stage_creating_tmp_table like in MySQL.
(We where using stage_copying_to_tmp_table twice)
2015-11-10 13:46:57 +02:00
Monty
2f63e2e2a0 MDEV-8426 mysqlbinlog: "Corrupted replication event was detected.
Not printing the value" with binlog-row-image=minimal"

Merged Rows_log_event::print_verbose_one_row() and log_event_print_value()
with MySQL 5.7
Added flush after writing of Table_map_log_event() to fix wrong order of
lines in output. This causes a lot of changes in some test results.
2015-11-10 13:46:57 +02:00
Monty
78771189e7 Ignore MySQL 5.7 log events not relevant for MariaDB
- XA
- Transaction_context_event (used by MysQL group replication)
- View change event (used by MysQL group replication)
2015-11-10 13:46:57 +02:00
Monty
e3868ee072 Don't store vcol bitmaps in TABLE if table doesn't have virtual fields.
(Makes TABLE a bit smaller)
2015-11-10 13:46:57 +02:00
Monty
93d1e5ce0b table->write_set was changed if binary logging was used, which caused the
changes in query execution plans.
Fixed by introducing table->rpl_write_set which holds which columns should
be stored in the binary log.

Other things:
- Removed some not needed references to read_set and write_set to make
  code really changing read_set and write_set easier to read
  (in opt_range.cc)
- Added error handling of failed unpack_current_row()
- Added missing call to mark_columns_needed_for_insert() for DELAYED INSERT
- Removed not used functions in_read_set() and in_write_set()
- In rpl_record.cc, removed not used variable error
2015-11-10 13:46:56 +02:00
Oleksandr Byelkin
7e4da9b370 DEV-8632 Segmentation fault on INSERT
View/derived fields should be taken into account when we build ref_pointer_array constructed.

DBUG_ASSERTs added to avoid memory overrun.
2015-11-09 16:08:06 +01:00
Sergei Petrunia
9f862ce026 MDEV#7383: engine-independent-stats column_stats has limited values for max/min values
Patch from Daniel Black:
- Change the charset of mysql.column_stats.{min_value, max_value} from
  utf8_bin varchar to varbinary
- Adjust the code that saves/reads the data accordingly.
- Also provide upgrade statement in mysql_system_tables_fix.sql
2015-11-09 17:58:35 +03:00
Nirbhay Choubey
7ec6558503 MDEV-9021: MYSQLD SEGFAULTS WHEN BUILT USING --WITH-MAX-INDEXES=128
The bitmap implementation defines two template Bitmap classes. One
optimized for 64-bit (default) wide bitmaps while the other is used for
all other widths.

In order to optimize the computations, Bitmap<64> class has defined its
own member functions for bitmap operations, the other one, however,
relies on mysys' bitmap implementation (mysys/my_bitmap.c).

Issue 1:
In case of non 64-bit Bitmap class, intersect() wrongly reset the
received bitmap while initialising a new local bitmap structure
(bitmap_init() clears the bitmap buffer) thus, the received bitmap was
getting cleared.

Fixed by initializing the local bitmap structure by using a temporary
buffer and later copying the received bitmap to the initialised bitmap
structure.

Issue 2:
The non 64-bit Bitmap class had the Iterator missing which caused
compilation failure.

Also added a cmake variable to hold the MAX_INDEXES value when supplied
from the command prompt. (eg. cmake .. -DMAX_INDEXES=128U). Checks have
been put in place to trigger build failure if MAX_INDEXES value is
greater than 128.

Test modifications:
* Introduced include/have_max_indexes_[64|128].inc to facilitate
skipping of tests for which the output differs with different
MAX_INDEXES.

* Introduced include/max_indexes.inc which would get modified by cmake
to reflect the MAX_INDEXES value used to build the server. This file
simply sets an mtr variable '$max_indexes' to show the MAX_INDEXES
value, which will then be consumed by the above introduced include file.

* Some tests (portions), dependent on MAX_INDEXES value, have been moved
to separate test files.
2015-11-09 09:28:00 -05:00
Oleksandr Byelkin
c88ca2c227 MDEV-8701 Crash on derived query
MDEV-8938 Server Crash on Update with joins

Make unique table check after setup_fields of update because unique table can materialize table and we do not need field resolving after materialization.
2015-11-06 17:56:56 +01:00
Sergei Petrunia
4e421687c2 Merge pull request #112 from openquery/MDEV-8981
MDEV-8981: Analyze stmt - cycles can overflow
2015-11-06 16:35:00 +03:00
Nirbhay Choubey
5079d69d48 MDEV-8975: 10.1 Fails To Join Existing Galera Cluster
During the process of guessing the IP address, if bind-address
is INADDR_ANY, mysqld should proceed with address specified via
wsrep_node_address or use one from network interfaces.

Patch contributed by darkain (pull#115).
2015-11-05 21:52:19 -05:00
Oleksandr Byelkin
5041de97e1 MDEV-8701 Crash on derived query
Make unique table check after setup_fields of update because unique table can materialize table and we do not need field resolving after materialization.
2015-11-05 17:50:59 +01:00
Vladislav Vaintroub
1216429cfd MDEV-8738 Application Verifier stop during server shutdown
The verifier exception is caused by using thread local storage key
after key was deleted.

my_free() used current_thd within malloc size callback, which does
pthread_get_specific(THR_THD), but THR_THD is already deleted at this
point.

The fix moves pthread_key_delete() to a later point in shutdown.
2015-11-04 17:47:21 +01:00
Alexey Botchkov
641644a862 MDEV-8992 MariaDB crashes when accessing table with GIS features.
we don't test for not-existing gis extra in FRM.
2015-11-01 20:37:23 +04:00