Commit graph

3564 commits

Author SHA1 Message Date
Oleksandr Byelkin
3ad37ed0eb Merge 10.4 into 10.5 2019-11-07 08:52:30 +01:00
Marko Mäkelä
ec40980ddd Merge 10.3 into 10.4 2019-11-01 15:23:18 +02:00
Oleksandr Byelkin
55b2281a5d Merge branch '10.2' into 10.3 2019-10-31 10:58:06 +01:00
Oleksandr Byelkin
36f67a7dff Merge branch '10.1' into 10.2 2019-10-30 21:33:01 +01:00
Eugene Kosov
b8eff8bce4 avoid accessing TLS 2019-10-30 13:23:15 +03:00
Eugene Kosov
a7e3008ab3 MDEV-20926 UBSAN: load of value 165, which is not a valid value for type bool
Basicaly it's an uninitialized read. 165 is 0xa5 which comes from TRASH_ALLOC()

Fix by calling a class ctor which initializes problematic
TMP_TABLE_PARAM::force_copy_fields field
2019-10-30 12:53:25 +03:00
Sergei Golubchik
c075c7a861 MDEV-20549 SQL SECURITY DEFINER does not work for INFORMATION_SCHEMA tables
switch to definer privileges when populating I_S tables
2019-10-28 08:17:56 +01:00
Marko Mäkelä
19ceaf2928 Merge 10.1 into 10.2 2019-10-25 12:57:36 +03:00
Sergei Golubchik
790a74d22b Merge branch 'github/5.5' into 10.1 2019-10-23 15:55:23 +02:00
Alexander Barkov
9a833dc688 MDEV-20856 Bad values in metadata views for partitions on VARBINARY
The old code to print partition values was too complicated:
- it created new Items for character set conversion purposes.
- it mixed string conversion and partition error reporting
  in the same code blocks.

Simplifying the code as follows:

- Adding helper methods String::can_be_safely_convert_to() and
  String::append_introducer_and_hex().

- Adding DBUG_EXECUTE_IF("generate_partition_syntax_for_frm",  push_warning...)
  into generate_partition_syntax_for_frm(), to test the PARTITON
  clause written to FRM. Adding test partition_utf8-debug.test for this.

- Removing functions get_cs_converted_part_value_from_string() and
  get_cs_converted_string_value. Changing get_partition_column_description()
  to use Type_handler::partition_field_append_value() instead.
  This makes SHOW CREATE TABLE and SELECT FROM I_S.PARTITIONS
  use the same code path.

- Changing Type_handler::partition_field_append_value() not to
  call convert_charset_partition_constant(), to avoid creating a new Item
  for string conversion pursposes.
  Rewritting the code to use only String methods.

- Removing error reporting code (ER_PARTITION_FUNCTION_IS_NOT_ALLOWED)
  from Type_handler::partition_field_append_value().
  The error is correctly detected and reported on the caller level.
  So error reporting was redundant here.

Also:

- Moving methods Type_handler::partition_field_*() from sql_partition.cc
  to sql_type.cc. This fixes compilation problem with -DPLUGIN_PARTITION=NO,
  earlier introduced by the patch for MDEV-20831.
2019-10-18 10:15:17 +04:00
Oleksandr Byelkin
c2854c7863 MDEV-20466: SHOW PROCESSLIST truncates query text on \0 bytes
Data should be sent with length.
2019-10-15 09:48:49 +02:00
Sergei Golubchik
173ae63114 MDEV-12684 Show what config file a sysvar got a value from
Show the config file in I_S.SYSTEM_VARIABLES
But only if the user has FILE privilege
2019-10-14 10:29:30 +02:00
Marko Mäkelä
d04f2de80a Merge 10.4 into 10.5 2019-10-11 08:41:36 +03:00
Marko Mäkelä
c11e5cdd12 Merge 10.3 into 10.4 2019-10-10 11:19:25 +03:00
Sergey Vojtovich
cf71cc838e After merge fix, this line was removed in adefaef 2019-10-09 22:08:04 +04:00
Marko Mäkelä
892378fb9d Merge 10.2 into 10.3 2019-10-09 13:25:11 +03:00
Marko Mäkelä
24232ec12c Merge 10.1 into 10.2 2019-10-09 08:30:23 +03:00
Sergey Vojtovich
adefaeffcc MDEV-19536 - Server crash or ASAN heap-use-after-free in is_temporary_table /
read_statistics_for_tables_if_needed

Regression after 279a907, read_statistics_for_tables_if_needed() was
called after open_normal_and_derived_tables() failure.

Fixed by moving read_statistics_for_tables() call to a branch of
get_schema_stat_record() where result of open_normal_and_derived_tables()
is checked.

Removed THD::force_read_stats, added read_statistics_for_tables() instead.
Simplified away statistics_for_command_is_needed().
2019-10-07 13:30:22 +04:00
Marko Mäkelä
780d2bb8a7 Merge 10.4 into 10.5 2019-09-06 14:25:20 +03:00
Marko Mäkelä
db4a27ab73 Merge 10.3 into 10.4 2019-08-31 06:53:45 +03:00
Marko Mäkelä
f42a23178e MDEV-20425: Fix -Wimplicit-fallthrough
With --skip-debug-assert, DBUG_ASSERT(false) will allow execution to
continue. Hence, we will need /* fall through */ after them.

Some DBUG_ASSERT(0) were replaced by break; when the switch () statement
was followed by DBUG_ASSERT(0).
2019-08-30 14:11:59 +03:00
Marko Mäkelä
efb8485d85 Merge 10.3 into 10.4, except for MDEV-20265
The MDEV-20265 commit e746f451d5
introduces DBUG_ASSERT(right_op == r_tbl) in
st_select_lex::add_cross_joined_table(), and that assertion would
fail in several tests that exercise joins. That commit was skipped
in this merge, and a separate fix of MDEV-20265 will be necessary in 10.4.
2019-08-23 08:06:17 +03:00
Anel Husakovic
888f685226 MDEV-20210 If you have an INVISIBLE VIRTUAL column, SHOW CREATE TABLE doesn't list it as INVISIBLE 2019-08-21 01:26:06 -07:00
Alexander Barkov
afe6eb499d Revert "MDEV-20342 Turn Field::flags from a member to a method"
This reverts commit e86010f909.

Reverting on Monty's request, as this change makes merging
things from 10.5 to 10.2 much harder.
2019-08-14 20:27:00 +04:00
Alexander Barkov
e86010f909 MDEV-20342 Turn Field::flags from a member to a method 2019-08-14 13:33:01 +04:00
Alexander Barkov
c1599821a5 Merge remote-tracking branch 'origin/10.4' into 10.5 2019-08-13 23:49:10 +04:00
Monty
c4fd167d5a Fixed access to unitialized memory when using unique HASH key
Fixed the following issues:
- Call info with HA_STATUS_CONST to ensure that (key_info->rec_per_key)
  contains latest data
- Don't access rec_per_key if key_info->algorithm == HA_KEY_ALG_LONG_HASH
  is in this case the rec_per_key points to uninitialized data
- Cleaned up code to avoid some extra 'if' and to make things more readable
- Updated test cases that used 'old' rec_per_key values
2019-08-13 17:19:00 +03:00
Marko Mäkelä
97bbac8ec6 Revert part of 05619f6989
This fixes the following test failures related to index cardinality:
main.join main.stat_tables main.partition main.stat_tables_innodb
innodb.innodb_bug57252
2019-08-12 19:37:24 +03:00
Monty
05619f6989 Fixes based on warnings from gcc/clang and valgrind
- Initialize variables that could be used uninitialized
- Added extra end space to DbugStringItemTypeValue to get rid of warnings
  from c_ptr()
- Session_sysvars_tracker::update() accessed unitialized memory if called
  with NULL value.
- get_schema_stat_record() accessed unitialized memory if HA_KEY_LONG_HASH
  was used
- parse_vcol_defs() accessed random memory for tables without keys.
2019-08-12 10:48:38 +03:00
Sergey Vojtovich
0940e25d69 MDEV-19991 Turn I_S tables GEOMETRY_COLUMNS and SPATIAL_REF_SYS into a plugin
Cleanups.
2019-07-09 13:02:52 +04:00
Alexander Barkov
a179de0402 MDEV-19991 Turn I_S tables GEOMETRY_COLUMNS and SPATIAL_REF_SYS into a plugin 2019-07-09 06:27:40 +04:00
Marko Mäkelä
412533b4a7 MDEV-18582: Extend SHOW STATUS LIKE 'Innodb_%'
Many InnoDB internal variables and counters were only exposed
in an unstructured fashion via SHOW ENGINE INNODB STATUS.

Expose more variables via SHOW STATUS. Many of these were
exported in XtraDB.

Also, introduce SHOW_SIZE_T and use the proper size for
exporting the InnoDB variables.

Remove some unnecessary indirection via export_vars, and
bind some variables directly.

dict_sys_t::rough_size(): Replaces dict_sys_get_size()
and includes the hash table sizes.

This is based on a contribution by Tony Liu from ServiceNow.
2019-07-04 00:09:16 +03:00
Alexander Barkov
b511202335 MDEV-19923 Add type handlers for geometry sub-types 2019-07-03 14:51:00 +04:00
Alexander Barkov
c62eaa7bdf MDEV-19843 Modify ST_FIELD_INFO to use Type_handler and LEX_CSTRING 2019-06-24 06:25:16 +04:00
Marko Mäkelä
3c88ce4cd1 Merge 10.4 into 10.5 2019-06-18 11:30:06 +03:00
Alexander Barkov
4156b1a260 MDEV-19772 Add helper classes for ST_FIELD_INFO 2019-06-16 19:03:47 +04:00
Oleksandr Byelkin
f66d1850ac Merge branch '10.3' into 10.4 2019-06-14 22:10:50 +02:00
Aleksey Midenkov
2e73561c6c MDEV-16804 SYSTEM VERSIONING columns not showing as GENERATED
Closes #830
2019-06-14 11:12:18 +02:00
Marko Mäkelä
984d7100cd Merge 10.4 into 10.5 2019-06-13 18:36:09 +03:00
Marko Mäkelä
90fec9602f Merge 10.1 into 10.2 2019-06-12 16:28:45 +03:00
Sergey Vojtovich
9d886de499 MDEV-16467 - MariaDB crashes because of "long semaphore wait"after migrating from 10.1 to 10.3
This patch fixes 10.2 issue reported in MDEV-16467 by partial backport of
c2118a0. Specifically "Remove not needed LOCK_thread_count from
thd_get_error_context_description()".
2019-06-12 13:27:43 +04:00
Kentoku SHIBA
be5c432a42
MDEV-16249 CHECKSUM TABLE for a spider table is not parallel and saves all data in memory in the spider head by default (#1328)
add checksum_null for setting null value of checksum
2019-06-11 00:25:08 +09:00
Robert Bindar
bf70430ead MDEV-17709 Remove handlerton::state 2019-06-06 22:09:31 +04:00
Alexander Barkov
9f23f8e598 MDEV-19599 Change db_name, table_name to LEX_CSTRING in Item_ident and Send_field 2019-05-26 09:49:13 +04:00
Alexander Barkov
ac93d7d674 MDEV-19593 Split create_schema_table() into virtual methods in Type_handler 2019-05-25 11:41:18 +04:00
Alexander Barkov
c83018751c MDEV-19566 Remove Item::name related strlen() calls in constructors of some Item_string descendands 2019-05-23 14:58:03 +04:00
Marko Mäkelä
826f9d4f7e Merge 10.4 into 10.5 2019-05-23 10:32:21 +03:00
Robert Bindar
042f5165e3 MDEV-307 review minor edits, add yacc_ora support 2019-05-21 09:33:30 +03:00
Gagan Goel
e9c6d5a1e8 MDEV-307 Add functionality for database comments
This commit adds a new feature to the server to add comments at the database
level. 1024 bytes is the maximum comment length allowed. If the comment length
exceeds this limit, a new error/warning code 4144 is thrown, based on whether
thd->is_strict_mode() is true/false. The database comment is also added to the
db.opt file, as well as to the information_schema.schemata table.
2019-05-21 09:33:17 +03:00
Oleksandr Byelkin
c07325f932 Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00