Commit graph

5331 commits

Author SHA1 Message Date
Vladislav Vaintroub
dc93ce8dea Windows : Fix truncation warnings in sql/ 2017-10-10 06:19:50 +00:00
Vladislav Vaintroub
7354dc6773 MDEV-13384 - misc Windows warnings fixed 2017-09-28 17:20:46 +00:00
Sergei Golubchik
d07daa3125 MDEV-13313 JSON type alias is insufficiently compatible
make JSON an alias for LONGTEXT CHARACTER SET utf8mb4 COLLATE utf8mb4_bin

(same collation that item_jsonfunc.cc is using internally)
2017-08-14 19:45:59 +02:00
Sergei Golubchik
87f39bf824 MDEV-8659 Conflicting declaration is accepted: INT SIGNED ZEROFILL
don't allow arbitrary combinations of SIGNED/UNSIGNED/ZEROFILL
2017-08-14 19:45:59 +02:00
Sergei Golubchik
1ea3c93fda MDEV-9144 JSON data type
for compatibility with MySQL, add 'JSON' as an alias for 'TEXT'
2017-07-05 17:15:59 +02:00
Sergei Golubchik
a6bef22cda reduce grammar duplication 2017-07-05 17:15:57 +02:00
Sergei Golubchik
5c30fcfa2f cleanup: C++ comments 2017-07-05 17:15:57 +02:00
Marko Mäkelä
70505dd45b Merge 10.1 into 10.2 2017-05-22 09:46:51 +03:00
Marko Mäkelä
71cd205956 Silence bogus GCC 7 warnings -Wimplicit-fallthrough
Do not silence uncertain cases, or fix any bugs.

The only functional change should be that ha_federated::extra()
is not calling DBUG_PRINT to report an unhandled case for
HA_EXTRA_PREPARE_FOR_DROP.
2017-05-17 08:27:04 +03:00
Sergei Golubchik
22d8bb2706 MDEV-12421 Check constraint with query crashes server and renders DB unusable
parse CHECK constraint *before* Column_definition validity checks
2017-04-01 18:59:29 +02:00
Sergei Golubchik
da4d71d10d Merge branch '10.1' into 10.2 2017-03-30 12:48:42 +02:00
Marko Mäkelä
0094b6581d Merge 10.0 into 10.1 2017-03-10 15:16:13 +02:00
Marko Mäkelä
8805fe0d5c Use %pure-parser instead of the deprecated %pure_parser. 2017-03-09 11:27:24 +02:00
Marko Mäkelä
adc91387e3 Merge 10.0 into 10.1 2017-03-03 13:27:12 +02:00
Alexey Botchkov
fdeeab01c0 MDEV-6390 CONVERT TO CHARACTER SET utf8 doesn't change DEFAULT CHARSET.
ALTER_CONVERT flag removed and replaced for ALTER_OPTIONS
        for the CONVERT TO CHARACTER SET command.
2017-02-26 23:01:23 +04:00
Sergei Golubchik
6f6d0531dc MDEV-11439 No data type JSON, but CAST(something AS JSON) pretends to work
Use JSON_COMPACT(X) instead of CAST(X AS JSON).
Bonus - X is validated to be a valid JSON.
Fix a typo in the error message.
2017-02-14 20:43:41 +01:00
Sergei Golubchik
e1f0f0dd06 Revert "MDEV-11439 No data type JSON, but CAST(something AS JSON) pretends to work"
This reverts commit 1f372cf1de.
Wasn't supposed to be pushed just yet.
2017-02-13 18:37:06 +01:00
Sergei Golubchik
1f372cf1de MDEV-11439 No data type JSON, but CAST(something AS JSON) pretends to work
remove CAST(... AS JSON) from the grammar for 10.2.4
2017-02-13 18:19:02 +01:00
Sergei Golubchik
239790d92f MDEV-11604 Assertion `!check_datetime_range(ltime)' failed in TIME_to_longlong_datetime_packed 2017-02-13 18:12:16 +01:00
Sergei Golubchik
1afb11074e MDEV-11582 InnoDB: Failing assertion: !((field)->vcol_info && !(field)->stored_in_db())
change the parser not to allow SERIAL as a normal data type.
make a special rule for it, where it could be used for define
fields, but not generated fields, not return type of a stored function, etc.
2017-02-13 18:12:15 +01:00
Sergei Golubchik
2195bb4e41 Merge branch '10.1' into 10.2 2017-02-10 17:01:45 +01:00
Igor Babaev
8481c70ede Fixed bug mdev-11867.
If a window function with aggregation is over the result
set of a grouping query then the argument of the aggregate
function from the window function is allowed to be an
aggregate function itself.
2017-02-01 19:15:28 -08:00
Igor Babaev
9073f9fd7d Fixed bug mdev-9976.
This bug happens due to a conflict in the construct window_spec.
(win_ref conflicts with the non-reserved key word ROWS).
The standard SQL-2003 says that ROWS is a reserved key word.
Made this key word reserved in our grammar and removed
the conflict.
2017-01-31 20:37:26 -08:00
Alexander Barkov
1d96b09890 MDEV-9979 Keywords UNBOUNDED, PRECEDING, FOLLOWING, TIES, OTHERS should be non-reserved
Adding keywords the following keywords into the "keyword" rules:
- EXCLUDE
- UNBOUNDED
- PRECEDING
- FOLLOWING
- TIES
- OTHERS

They are non-reserved words in the SQL standard (checked in a SQL-2011 draft),
and they don't cause any conflicts in sql_yacc.yy.
2017-01-31 23:41:10 +04:00
Vicențiu Ciorbaru
8e15768731 Merge branch '10.0' into 10.1 2017-01-16 03:18:14 +02:00
vicentiu
e9aed131ea Merge remote-tracking branch 'origin/5.5' into 10.0 2017-01-06 17:09:59 +02:00
Marko Mäkelä
8049d2e9d9 Merge 10.0 into 10.1 2017-01-05 20:32:15 +02:00
Oleksandr Byelkin
bc4cac358e MDEV-10035: DBUG_ASSERT on CREATE VIEW v1 AS SELECT * FROM t1 FOR UPDATE
Ability to print lock type added.
Restoring correct lock type for CREATE VIEW added.
2017-01-04 13:27:45 +01:00
Sergei Golubchik
4a5d25c338 Merge branch '10.1' into 10.2 2016-12-29 13:23:18 +01:00
Sergei Golubchik
ec6d8dadc0 reduce code duplication a little 2016-12-22 13:02:32 +01:00
Sergei Golubchik
9fefe97336 Merge branch 'mysql/5.5' into 5.5 2016-12-22 12:49:06 +01:00
Sergei Golubchik
8c876adfb6 Item_func_like: print a not like b instead of !(a like b) 2016-12-12 20:44:45 +01:00
Sergei Golubchik
6b0f4c24ab cleanup: unpack_vcol_info_from_frm
* do setup/cleanup for charset and arena only once per table
  not for every vcol
* don't copy every vcol expression into table's memroot for parsing,
  do it in a temporary String buffer that is freed at the end
* add asserts
2016-12-12 20:35:49 +01:00
Sergei Golubchik
a72f1deb2d rename Virtual_column_info::expr_item
now, when expr_str is gone, expr_item can be unambiguously
renamed to expr.
2016-12-12 20:35:48 +01:00
Sergei Golubchik
a411d7f4f6 store/show vcols as item->print()
otherwise we'd need to store sql_mode *per vcol*
(consider CREATE INDEX...) and how SHOW CREATE TABLE would
support that?

Additionally, get rid of vcol::expr_str, just to make sure
the string is always generated and never leaked in the
original form.
2016-12-12 20:35:41 +01:00
Sergei Golubchik
a3614d33e8 cleanup: FOREIGN_KEY_INFO
instead of returning strings for CASCADE/RESTRICT
from every storage engine, use enum values
2016-12-12 20:27:39 +01:00
Sergei Golubchik
590d473760 cleanup: my_printf_error(ER_xxx, ER(ER_xxx), ... )
only use my_print_error when the error message is not
ER(error_code)
2016-12-12 20:27:28 +01:00
Sergei Golubchik
0ed291e61c cleanup: parser: s/USER/USER_SYM/ 2016-12-12 20:27:26 +01:00
Sergei Golubchik
a721dcab8e cleanup: Item_func_opt_neg::negate()
remove redundant method
2016-12-12 20:27:24 +01:00
Sergei Golubchik
fd0044041b don't convert WEEK(x) to WEEK(x, @@default_week_format) 2016-12-12 20:27:24 +01:00
Sergei Golubchik
2f20d297f8 Merge branch '10.0' into 10.1 2016-12-11 09:53:42 +01:00
Vicențiu Ciorbaru
eb4f2e063c MDEV-11533: Roles with trailing white spaces are not cleared correctly
Role names with trailing whitespaces are truncated in length as of
956e92d908 to fix MDEV-8609. The problem
is that the code that creates role mappings expects the string to be null
terminated.

Add the null terminator to account for that as well. In the future
the rest of the code can be cleaned up to never assume c style strings
but only LEX_STRINGS.
2016-12-10 22:23:25 +02:00
Alexey Botchkov
486079d159 MDEV-11440 JSON has become a reserved word in MariaDB.
'JSON' made possible identifier.
2016-12-06 00:39:53 +04:00
Oleksandr Byelkin
098dff10ba MDEV-11359 Implement IGNORE for bulk operation 2016-11-29 08:29:46 +01:00
Alexander Barkov
9bfde897c3 MDEV-11360 Dynamic SQL: DEFAULT as a bind parameter
This patch adds DEFAULT as a possible dynamic SQL parameter, e.g.:
  EXECUTE IMMEDIATE 'INSERT INTO t1 (column) VALUES(?)' USING DEFAULT;
  EXECUTE IMMEDIATE 'UPDATE t1 SET column=?' USING DEFAULT;
and for similar PREPARE..EXECUTE queries.

This is done for symmetry with the STMT_INDICATOR_DEFAULT indicator in
the client-server PS protocol.

The changes include:
- Allowing DEFAULT as a possible option in execute USING clause (sql_yacc.yy)
- Adding "virtual bool Item::save_in_param(THD *thd, Item_param *param)",
  because "normal" items (that have real values) and Item_default_value
  have now different actions when assigning itself as an Item_param value.
- Fixing switch() statements in a few Item_param methods not to have "default",
  because it was easy to forget to add a new "case" when adding a new XXX_VALUE
  value into the enum Item_param::enum_item_param_state.
  This is important, as we'll be adding new values soon, e.g. for MDEV-11359.
  Removing "default" helped to find and report bugs MDEV-11361 and MDEV-11362,
  because DECIMAL_VALUE is obviously not properly handled in some cases.
2016-11-27 18:21:18 +04:00
Alexander Barkov
e0fc6dc8bd Merge pull request #244 from hholzgra/hartmut-MDEV-726
MDEV-726 - CREATE and ALTER SERVER need to lowercase host name
2016-11-19 12:59:22 +04:00
Alexey Botchkov
ebe5ebba16 MDEV-9143 JSON_xxx functions.
The rest of mysql/json functions implemented.
        CAST AS JSON implemented.
2016-11-15 17:04:31 +04:00
Alexey Botchkov
27025221fe MDEV-9143 JSON_xxx functions.
strings/json_lib.c added as a JSON library.
        SQL frunction added with sql/item_jsonfunc.h/cc
2016-10-19 14:10:03 +04:00
Kristian Nielsen
e1ef99c3dc MDEV-7145: Delayed replication
Merge feature into 10.2 from feature branch.

Delayed replication adds an option

  CHANGE MASTER TO master_delay=<seconds>

Replication will then delay applying events with that many
seconds. This creates a replication slave that reflects the state of
the master some time in the past.

Feature is ported from MySQL source tree.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2016-10-16 23:44:44 +02:00
Kristian Nielsen
19abe79fd1 MDEV-7145: Delayed replication, intermediate commit.
Initial merge of delayed replication from MySQL git.

The code from the initial push into MySQL is merged, and the
associated test case passes. A number of tasks are still pending:

1. Check full test suite run for any regressions or .result file updates.

2. Extend the feature to also work for parallel replication.

3. There are some todo-comments about future refactoring left from
MySQL, these should be located and merged on top.

4. There are some later related MySQL commits, these should be checked
and merged. These include:
    e134b9362ba0b750d6ac1b444780019622d14aa5
    b38f0f7857c073edfcc0a64675b7f7ede04be00f
    fd2b210383358fe7697f201e19ac9779879ba72a
    afc397376ec50e96b2918ee64e48baf4dda0d37d

5. The testcase from MySQL relies heavily on sleep and timing for
testing, and seems likely to sporadically fail on heavily loaded test
servers in buildbot or distro build farms.

Signed-off-by: Kristian Nielsen <knielsen@knielsen-hq.org>
2016-10-14 23:15:58 +02:00