Commit graph

5209 commits

Author SHA1 Message Date
Vicențiu Ciorbaru
b45c3d0b08 [MDEV-7978] Implement alter user and tested create user
Implemented the alter user syntax. Also tested that create user
creates users accordingly.
2016-03-08 16:55:17 +02:00
Vicențiu Ciorbaru
90b717b3cd [MDEV-7978] Update grammar for new syntax
Extend the syntax accepted by the grammar to account for the new create user
and alter user syntax.
2016-03-08 16:55:17 +02:00
Sergei Golubchik
00d1db7a38 Merge branch '10.1' into 10.2 2016-02-25 18:19:55 +01:00
Sergei Golubchik
a5679af1b1 Merge branch '10.0' into 10.1 2016-02-23 21:35:05 +01:00
Sergei Golubchik
9214d043fd disable SHOW I_S_table for built-in I_S tables
This fixes
MDEV-9538 Server crashes in check_show_access on SHOW STATISTICS
MDEV-9539 Server crashes in make_columns_old_format on SHOW GEOMETRY_COLUMNS
MDEV-9540 SHOW SPATIAL_REF_SYS and SHOW SYSTEM_VARIABLES return empty results with numerous warnings
2016-02-23 10:54:34 +01:00
Sergei Golubchik
271fed4106 Merge branch '5.5' into 10.0 2016-02-15 22:50:59 +01: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
Oleksandr Byelkin
41021c0254 MDEV-9462: Out of memory using explain on 2 empty tables
Fixed adding derived tables items to outer one.
2016-02-06 13:36:17 +01:00
Monty
11c2d3c3e2 Merge branch '10.0' into 10.1
Conflicts:
	configure.cmake
2016-02-02 13:07:53 +02:00
Oleksandr Byelkin
07e9762940 MDEV-8615: Assertion `m_cpp_buf <= begin_ptr && begin_ptr <= m_cpp_buf + m_buf_length' failed in Lex_input_stream::body_utf8_start
Nothing should be done before any keyword recognized.
2016-01-27 21:17:23 +01:00
Alexey Botchkov
a4ff37e912 MDEV-6421 SQL_ERROR_LOG doesn't log comments in Events.
Change parser so it saves all the query line to the ';' in the
    sp_instr::m_query.
2016-01-26 22:33:25 +04:00
Sergei Golubchik
c37107380a cleanup: LEX_USER::pwtext and LEX_USER::pwhash
Was:
* LEX_USER::password was storing sometimes
  plaintext password and sometimes password hash
* LEX_USER::auth was storing sometimes password hash and
  sometimes plugin authentication string

Now:
* LEX_USER::pwtext stores the password in plain-text
* LEX_USER::pwhash stores the password hash
* LEX_USER::auth stores the plugin authentication string
2016-01-25 17:04:15 +01:00
Sergei Golubchik
1fea7e785f cleanup: create LEX_USER::reset_auth()
as this is used quite often
2016-01-25 17:04:14 +01:00
Alexander Barkov
2ba7ed77aa Merge remote-tracking branch 'origin/10.1' into 10.2 2015-12-29 19:37:11 +04:00
Vicențiu Ciorbaru
afc2fb1bf8 MDEV-8627: SHOW GRANTS does not work for a replicated role
The bug was caused by accessing uninitialized fields within the LEX related to
ssl by mysql_show_grants() -> get_current_user() -> has_auth() function.
2015-12-21 13:42:19 +02:00
Alexander Barkov
cc8e863390 Removing sp_variable::type, as it was always set to the same value with
sp_variable::field_def.type, so there was data redundancy.
2015-11-26 15:04:55 +04:00
Alexander Barkov
b50fa6dab2 Removing the unused "field_type" parameter in
sp_head::fill_field_definition().
2015-11-26 14:40:40 +04:00
Sergey Vojtovich
54689e1d5c MDEV-8715 - Obsolete sql_alloc() in favor of THD::alloc() and thd_alloc()
The following left in semi-improved state to keep patch size reasonable:
- Field operator new: left thd_alloc(current_thd)
- Sql_alloc operator new: left thd_alloc(thd_get_current_thd())
- Item_args constructors: left thd_alloc(thd)
- Item_func_interval::fix_length_and_dec(): no THD arg, have to call current_thd
- Item_func_dyncol_exists::val_int(): same
- Item_dyncol_get::val_str(): same
- Item_dyncol_get::val_int(): same
- Item_dyncol_get::val_real(): same
- Item_dyncol_get::val_decimal(): same
- Item_singlerow_subselect::fix_length_and_dec(): same
2015-11-26 11:34:17 +04:00
Sergey Vojtovich
0746a07708 MDEV-8718 - Obsolete sql_strmake() in favor of THD::strmake() and thd_strmake() 2015-11-26 11:34:16 +04:00
Sergey Vojtovich
13af8650a8 MDEV-8719 - Obsolete sql_memdup() in favor of THD::memdup() and thd_memdup() 2015-11-26 11:34:15 +04:00
Alexander Barkov
55e67c3e34 MDEV-8095 Split Create_field
Part2: moving a few other fields from Column_definition to Create_field.
sizeof(sp_variable) is now 200 bytes (vs 248 bytes in 10.1)
2015-11-25 11:57:20 +04:00
Alexander Barkov
00ed55c71a A joint patch for:
- MDEV-8093 sql_yacc.yy: add %type create_field for field_spec and column_def

and partially:

- MDEV-8095 Split Create_field
2015-11-25 11:22:10 +04:00
Sergei Golubchik
13989b36c1 cleanup: remove useless internal fied flag 2015-11-24 22:21:42 +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
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
beded7d9c9 Merge branch '10.0' into 10.1 2015-11-19 15:52:14 +01:00
Sergei Golubchik
ab476a8d10 Merge branch '5.5' into 10.0 2015-11-18 22:03:02 +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
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 Golubchik
fb8713385f remove unneded #include's that had a dubious explanation 2015-10-24 19:58:34 +02:00
Sergei Golubchik
956e92d908 MDEV-8609 Server crashes in is_invalid_role_name on reloading ACL with a blank role name
strip endspaces from the role name in the parser
because they'll be lost anyway when the name is stored
in the mysql.user.user column (of type CHAR)
2015-10-22 11:58:54 +02:00
Sergei Golubchik
dfb74dea30 Merge branch '10.0' into 10.1 2015-10-12 00:37:58 +02:00
Sergei Golubchik
cfeedbfd3e Merge branch '5.5' into 10.0 2015-10-09 17:12:26 +02:00
Sergei Golubchik
82e9f6d948 Merge remote-tracking branch 'mysql/5.5' into 5.5 2015-10-08 22:54:24 +02:00
Oleksandr Byelkin
bed4e84795 MDEV-8380: Subquery parse error
backport mysql parser fixes
0034963fbf199696792491bcb79d5f0731c98804
5948561812bc691bd0c13cf518a3fe77d9daf920
2015-10-06 22:11:39 +02:00
Alexander Barkov
5c9c8ef1ea MDEV-3929 Add system variable explicit_defaults_for_timestamp for compatibility with MySQL 2015-09-22 14:01:54 +04:00
Sergei Golubchik
704ba5c514 cleanup: correct usage of semicolons in sql_yacc.yy 2015-09-04 10:33:54 +02:00
Monty
3bca8db4f9 MDEV-6152: Remove calls to current_thd while creating Item
- Part 4: Removing calls to sql_alloc() and sql_calloc()

Other things:
- Added current_thd in some places to make it clear that it's called (easier to remove later)
- Move memory allocation from Item_func_case::fix_length_and_dec() to Item_func_case::fix_fields()
- Added mem_root to some new calls
- Fixed some wrong UNINIT_VAR() calls
- Fixed a bug in generate_partition_syntax() in case of errors
- Added mem_root to argument to new thread_info
- Simplified my_parse_error() call in sql_yacc.yy
2015-08-27 22:29:11 +03:00
Monty
3cb578c001 MDEV-6152: Remove calls to current_thd while creating Item
- Part 3: Adding mem_root to push_back() and push_front()

Other things:
- Added THD as an argument to some partition functions.
- Added memory overflow checking for XML tag's in read_xml()
2015-08-27 22:21:08 +03:00
Monty
1bae0d9e56 Stage 2 of MDEV-6152:
- Added mem_root to all calls to new Item
- Added private method operator new(size_t size) to Item to ensure that
  we always use a mem_root when creating an item.

This saves use once call to current_thd per Item creation
2015-08-21 10:40:51 +04:00
Sergey Vojtovich
31e365efae MDEV-8010 - Avoid sql_alloc() in Items (Patch #1)
Added mandatory thd parameter to Item (and all derivative classes) constructor.
Added thd parameter to all routines that may create items.
Also removed "current_thd" from Item::Item. This reduced number of
pthread_getspecific() calls from 290 to 177 per OLTP RO transaction.
2015-08-21 10:40:39 +04:00
Mithun C Y
8fe0708808 Merge branch 'mysql-5.1' into mysql-5.5 2015-08-17 15:26:01 +05:30
Mithun C Y
557a57f3a2 Bug #21350175: SUBQUERIES IN PROCEDURE CLAUSE OF SELECT STATEMENT CAUSES SERVER FAILURES.
Analysis :
==========
During JOIN::prepare of sub-query which creates the
derived tables we call setup_procedure. Here we call
fix_fields for parameters of procedure clause. Calling
setup_procedure at this point may cause issue. If
sub-query is one of parameter being fixed it might
lead to complicated dependencies on derived tables
being prepared.

SOLUTION :
==========
In 5.6 with WL#6242, we have made procedure clause
parameters can only be NUM, so sub-queries are not
allowed as parameters. So in 5.5 we can block
sub-queries in procedure clause parameters.
This eliminates above conflicting dependencies.
2015-08-17 15:23:47 +05:30
Monty
872a953b22 MDEV-8469 Add RESET MASTER TO x to allow specification of binlog file nr
Other things:
- Avoid calling init_and_set_log_file_name() when opening binary log.
- Remove newlines early when reading from index file.
- Ensure that reset_logs() will work even if thd is 0 (Can happen on startup)
- Added thd to sart_slave_threads() for better error handling.
2015-07-16 10:36:58 +03:00
Sreeharsha Ramanavarapu
c773b320ff Merge branch 'mysql-5.1' into mysql-5.5 2015-07-10 07:54:55 +05:30
Sreeharsha Ramanavarapu
33a2e5abd8 Bug #20238729: ILLEGALLY CRAFTED UTF8 SELECT PROVIDES NO
WARNINGS

Backporting to 5.1 and 5.5
2015-07-10 07:52:00 +05:30
Monty
7332af49e4 - Renaming variables so that they don't shadow others (After this patch one can compile with -Wshadow and get much fewer warnings)
- Changed ER(ER_...) to ER_THD(thd, ER_...) when thd was known or if there was many calls to current_thd in the same function.
- Changed ER(ER_..) to ER_THD_OR_DEFAULT(current_thd, ER...) in some places where current_thd is not necessary defined.
- Removing calls to current_thd when we have access to thd

Part of this is optimization (not calling current_thd when not needed),
but part is bug fixing for error condition when current_thd is not defined
(For example on startup and end of mysqld)

Notable renames done as otherwise a lot of functions would have to be changed:
- In JOIN structure renamed:
   examined_rows -> join_examined_rows
   record_count -> join_record_count
- In Field, renamed new_field() to make_new_field()

Other things:
- Added DBUG_ASSERT(thd == tmp_thd) in Item_singlerow_subselect() just to be safe.
- Removed old 'tab' prefix in JOIN_TAB::save_explain_data() and use members directly
- Added 'thd' as argument to a few functions to avoid calling current_thd.
2015-07-06 20:24:14 +03:00
Sergey Vojtovich
0865e3deab MDEV-7792 - SQL Parsing Error - UNION AND ORDER BY WITH JOIN
ORDER BY against union may confuse name resolution context, causing valid
SQL statements to fail.

The purpose of context change was presumably intended for the duration of
gathering field list for ORDER BY. However it isn't actually required (name
resolution context is never accessed by the latter).

See also alternative solution (in MySQL 5.7): 92145b95.
2015-06-29 11:04:55 +04:00