Sergei Golubchik
9bd3af97df
MDEV-15413 Unexpected errors upon CREATE TABLE .. WITH SYSTEM VERSIONING AS SELECT ...
...
numerous fixes for CREATE ... SELECT with system versioning:
In CREATE ... SELECT the table is created based on the result set,
field properties do not count. That is
* field invisibility is *not* copied over
* AS ROW START/END is *not* copied over
* the history is *not* copied over
* system row_start/row_end fields can *not* be created from the SELECT part
2018-04-10 13:12:36 +02:00
Sergei Golubchik
a4251d6f18
MDEV-15391 Server crashes in JOIN::fix_all_splittings_in_plan or Assertion `join->best_read < double(1.79...e+308L)' failed
...
vers_setup_conds() used to AND all conditions on row_start/row_end
columns and store it either in the WHERE clause or in the ON
clause for some table. In some cases this caused ON clause
to have conditions for tables that aren't part of that ON's join.
Fixed to put a table's condition always in the ON clause of the
corresponding table.
Removed unnecessary ... `OR row_end IS NULL` clause, it's not needed
in the ON clause.
Simplified handling on PS and SP.
2018-04-10 13:12:36 +02:00
Sergei Golubchik
f3088112cb
MDEV-14645: AS OF TIMESTAMP is misused as TRX_ID
...
Remove 1668efb722 that introduced a special magic
behavior for UNIX_TIMESTAMP() in the AS OF context
2018-02-24 00:50:58 +01:00
Sergei Golubchik
33366b1098
remove @@system_versioning_innodb_algorithm_simple
...
and delete few garbage-in-garbage-out tests
2018-02-24 00:50:57 +01:00
Aleksey Midenkov
f1bd02d994
MDEV-15004 parser greedily parses AS OF TIMESTAMP
...
* TIMESTAMP precedence fixed.
2018-02-23 15:33:23 +01:00
Eugene Kosov
fbed4ca4f1
MDEV-14816 Assertion join->best_read < double(1.797...e+308L) failed in bool greedy_search
2018-01-12 21:20:24 +01:00
Sergei Golubchik
b85efdc3af
rename system_time columns
...
sys_trx_start -> row_start
sys_trx_end -> row_end
2018-01-09 15:49:07 +03:00
Sergei Golubchik
35b679b924
SQL: error messages
...
remove unused error messages
reword ER_VERS_SYS_FIELD_NOT_HIDDEN->ER_VERS_SYS_FIELD_EXISTS
2018-01-09 14:16:47 +03:00
Sergei Golubchik
e6a7457653
SQL: derived, hiding, error messages
...
Many related changes.
Note that AS OF condition must always be pushed down to physical tables,
it cannot be applied to a derived or a view. Thus:
* no versioning for internal temporary tables, they can never store
historical data.
* remove special versioning code from mysql_derived_prepare and
remove ER_VERS_DERIVED_PROHIBITED - derived can have no historical
data and cannot be prohibited for system versioning related reasons.
* do not expand select list for derived/views with sys vers fields,
derived/views can never have historical data.
* remove special invisiblity rules for sys vers fields, they are no
longer needed after the previous change
* remove system_versioning_hide, it lost the meaning after the
previous change.
* remove ER_VERS_SYSTEM_TIME_CLASH, it's no "clash", the inner
AS OF clause always wins.
* non-versioned fields in a historical query
reword the warning text, downgrade to note, don't
replace values with NULLs
2018-01-09 14:12:41 +03:00
Aleksey Midenkov
c5d0c38efc
MDEV-14676 Redundancy in error codes
...
ER_VERS_NOT_VERSIONED vs ER_VERSIONING_REQUIRED
2017-12-19 22:05:25 +03:00
Aleksey Midenkov
ee68d019d1
SQL: removed VERS_HIDDEN_FLAG [ closes #409 ]
2017-12-19 16:12:56 +03:00
Aleksey Midenkov
b55a149194
Timestamp-based versioning for InnoDB [ closes #209 ]
...
* Removed integer_fields check
* Reworked Vers_parse_info::check_sys_fields()
* Misc renames
* versioned as vers_sys_type_t
* Removed versioned_by_sql(), versioned_by_engine()
versioned() works as before;
versioned(VERS_TIMESTAMP) is versioned_by_sql();
versioned(VERS_TRX_ID) is versioned_by_engine().
* create_tmp_table() fix
* Foreign constraints for timestamp-based
* Range auto-specifier fix
* SQL: 1-row partition rotation fix [fixes #260 ]
* Fix 'drop system versioning, algorithm=inplace'
2017-12-18 19:03:51 +03:00
Aleksey Midenkov
4624e565f3
System Versioning 1.0 pre6
...
Merge remote-tracking branch 'mariadb/bb-10.3-temporal-serg' into trunk
2017-12-15 18:12:18 +03:00
Aleksey Midenkov
70d7672377
SQL: MDEV-14633 Assertion on TRT read [ fixes #406 ]
2017-12-15 16:42:25 +03:00
Aleksey Midenkov
2ae2876a6c
MDEV-14652 NATURAL JOIN crash in mark_common_columns() [ fixes #405 ]
...
SQL: reverted NATURAL JOIN fix #161 (deprecated by #383 )
2017-12-14 21:31:38 +03:00
Aleksey Midenkov
f96815fe97
SQL: unit resolution Item_field not yet accessible [ fixes #398 ]
2017-12-14 18:42:53 +03:00
Aleksey Midenkov
1668efb722
MDEV-14645: AS OF TIMESTAMP is misused as TRX_ID [ fixes #396 ]
2017-12-14 18:14:21 +03:00
Sergei Golubchik
ca6454bcfe
for now, remove FOR SYSTEM_TIME at the end of the query
...
non-standard, redundant, potentially risky in the future,
hides bugs. See #383 , #384 , #385
Fixed a parser bug where
SELECT * FROM (t1 join t2) FOR SYSTEM_TIME ...
was not an error.
2017-12-13 21:51:20 +01:00
Aleksey Midenkov
947aa0bab9
SQL: vers_setup_select() misc refactoring
...
Renamed to SELECT_LEX::vers_setup_conds().
Moved optimized fields check to JOIN::vers_check_items().
2017-12-08 19:37:24 +03:00
Aleksey Midenkov
ad51d77f79
SQL: WHERE top level item [ #365 bug 11]
...
Tests affected (forced mode):
main.range main.range_mrr_icp
2017-12-08 16:26:18 +03:00
Sergei Golubchik
3198bc839d
Parser: unreserve keywords
...
SELECT * FROM t1 FOR SYSTEM_TIME AS OF ...
becomes ambiguous, but it's the same as with
SELECT ... UNION SELECT ... ORDER BY ...
2017-12-05 15:09:09 +03:00
Aleksey Midenkov
6ac773421f
SQL: WHERE cond freed prematurely for PS [ #365 bug 10]
...
Applicable to vanilla version.
Applies to Item_cond_and, etc.: items with allocating copy_andor_structure().
Tests affected (forced mode):
main.subselect_sj
main.subselect_sj_jcl6
2017-12-05 14:32:34 +03:00
Aleksey Midenkov
3d88a72f76
SQL: fix subquery not a derived table [ #365 bug 9]
...
Tests affected (forced mode):
main.ps \
main.user_var \
main.myisam_explain_non_select_all \
main.opt_tvc \
main.subselect \
main.subselect_no_exists_to_in \
main.derived \
main.derived_opt \
main.update
2017-12-05 14:32:33 +03:00
Aleksey Midenkov
68e160fb25
Tests: removed common.inc from results
2017-12-04 00:49:44 +03:00
Aleksey Midenkov
b9225bb52c
SQL: outdated select_lex->where fix [ #365 bug 5]
...
Affected tests (forced mode):
main.index_merge_myisam
After optimization versioning AND takes operands from WHERE AND
leaving `select_lex->where` as empty dangling AND.
2017-11-30 23:23:21 +03:00
Aleksey Midenkov
e4b86780ae
SQL: optimized transformer fix [ #365 bug 4]
...
Affected tests (forced mode):
main.win
main.selectivity_innodb
main.subselect_cache
main.analyze_stmt_orderby
Related to #226 (909867d014 ).
2017-11-30 08:31:38 +03:00
Aleksey Midenkov
33085349e9
IB, SQL: removed VTQ, added TRT on SQL layer [ closes #305 ]
2017-11-15 00:22:10 +03:00
Aleksey Midenkov
17bd486f36
SQL: thd_start_utime() fix [ fixes #284 ]
2017-10-17 17:20:46 +03:00
Aleksey Midenkov
75bc483d7a
Tests: moved concat_execN() to common.inc
2017-09-25 22:07:01 +03:00
Aleksey Midenkov
d3d2ea9fd5
SQL, Parser: system_time logic and syntax fixes [ closes #237 ]
2017-08-08 17:12:16 +03:00
Aleksey Midenkov
c2c8808a16
SQL: compare TRX_ID fields against timestamps [ closes #231 ]
2017-08-03 16:01:16 +03:00
Aleksey Midenkov
91c8b43e77
Parser: syntax for query system_time [ closes #230 ]
...
Eliminated `QUERY FOR`.
2017-07-12 12:10:13 +03:00
Aleksey Midenkov
bdcce58fad
IB: long names in information_schema
2017-07-04 12:09:33 +03:00
Aleksey Midenkov
4b0f1284ee
SQL: revisit error messages [ closes #217 ]
2017-07-03 14:04:34 +03:00
Aleksey Midenkov
b19645caf5
Tests: verify_vtq() fix
2017-05-05 20:36:38 +03:00
Aleksey Midenkov
1e8a81dea6
SQL: CREATE VIEW and misc improvements [ fixes #183 ]
2017-05-05 20:36:37 +03:00
kevg
f77a4135bf
SQL: parsing of QUERY FOR [ fixes #159 ]
...
Reverts 46e36bbffa7cd8d9eb861a22755025ffe8751449 - SQL: fix assertion failure in parser
2017-05-05 20:36:34 +03:00
kevg
14f007f907
SQL: versioning in embedded JOINs [ fixes #160 ]
2017-05-05 20:36:33 +03:00
kevg
e8ae9f1ae9
SQL: VIEW NATURAL JOIN TABLE [ fixes #161 ]
2017-05-05 20:36:33 +03:00
Aleksey Midenkov
1894fab11a
Tests: split versioning.select into combinations
2017-05-05 20:36:32 +03:00
kevg
fb0b3e5902
SQL: NATURAL LEFT JOIN for versioned tables [ fixes #156 ]
2017-05-05 20:36:32 +03:00
kevg
5a08bd3515
Tests: subqueries with JOINed tables with different FOR SYSTEM_TIME clauses [ closes #154 ]
2017-05-05 20:36:32 +03:00
kevg
7fd549095f
IB: return correct sys_trx_end in TRIGGER after UPDATE [ fixes #100 ]
2017-05-05 20:36:31 +03:00
kevg
9ea02899f8
SQL: nested equi-join for versioned table [ fixes #150 ]
2017-05-05 20:36:31 +03:00
kevg
d85e7a5e01
SQL: NATUAL JOIN on view + table [ fixes #148 ]
2017-05-05 20:36:30 +03:00
kevg
7a22dd3716
SQL: INNER JOIN USING with versioned tables [ fixes #147 ]
2017-05-05 20:36:29 +03:00
kevg
17745222a1
SQL: incorrect check on specific JOIN query [ fixes #145 ]
2017-05-05 20:36:29 +03:00
Aleksey Midenkov
3a64d55aed
Parser, SQL: table-specific FOR SYSTEM_TIME [ closes #116 ]
...
* Syntax sugar: query-global QUERY FOR SYSTEM_TIME
2017-05-05 20:36:25 +03:00
Aleksey Midenkov
27d9e762a9
SQL: prohibit write-locking of historic rows [ fixes #102 ]
2017-05-05 20:36:23 +03:00
Aleksey Midenkov
695c5aabad
SQL: error on FOR SYSTEM_TIME without any versioned tables
...
[fixes #88 ]
2017-05-05 20:36:20 +03:00