1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-24 19:42:23 +03:00
Commit Graph

35 Commits

Author SHA1 Message Date
ddea8f6a39 MDEV-23779 Error upon querying the view, that selecting from versioned table with partitions
PARTITION clause in SELECT means query is non-versioned (see
WITH_PARTITION_STORAGE_ENGINE in vers_setup_conds()).

vers_setup_conds() expands such query to SYSTEM_TIME_ALL which is then
added to VIEW specification. When VIEW is queried both clauses
PARTITION and FOR SYSTEM_TIME ALL lead to ER_VERS_QUERY_IN_PARTITION
(same place WITH_PARTITION_STORAGE_ENGINE).

Fix removes FOR SYSTEM_TIME ALL from VIEW by accessing original
SYSTEM_TIME clause: the one specified in parser. As a side-effect
EXPLAIN SELECT displays SYSTEM_TIME specified in SELECT which is
user-friendly.
2020-10-20 10:49:54 +03:00
19da9a51ae MDEV-16937 Strict SQL with system versioned tables causes issues
Respect system fields in NO_ZERO_DATE mode.

This is the subject for refactoring in MDEV-19597
2020-05-28 22:22:20 +03:00
db32d9457e MDEV-18929 2nd execution of SP does not detect ER_VERS_NOT_VERSIONED
Don't do skip_setup_conds() unless all errors are checked.

Fixes following errors:
      ER_PERIOD_NOT_FOUND
      ER_VERS_QUERY_IN_PARTITION
      ER_VERS_ENGINE_UNSUPPORTED
      ER_VERS_NOT_VERSIONED
2019-12-02 11:48:37 +03:00
6dd41e008e MDEV-21155 Assertion with versioned table upon DELETE from view of view after replacing first view
When view is merged by DT_MERGE_FOR_INSERT it is then skipped from
processing and doesn't update WHERE clause with
vers_setup_conds(). Note that view itself cannot work in
vers_setup_conds() because it doesn't have row_start, row_end
fields. Thus it is required to descend down to material TABLE_LIST
through calls of mysql_derived_prepare() and run vers_setup_conds()
from there. Luckily, all views (views of views, views of views of
views, etc.) are linked in one list through next_global pointer, so we
can skip all views of views and get straight to non-view TABLE_LIST by
checking its merge_underlying_list property for zero value (it is
assigned by DT_MERGE_FOR_INSERT for merged derived tables).

We have to do that only for UPDATE and DELETE. Other DML commands
don't use WHERE clause.

MDEV-21146 Assertion `m_lock_type == 2' in handler::ha_drop_table upon LOAD DATA

LOAD DATA does not use WHERE and the above call of vers_setup_conds()
is not needed. unit->prepare() led to wrongly locked temporary table.
2019-12-02 11:48:37 +03:00
0076dce2c8 MDEV-18727 improve DML operation of System Versioning
MDEV-18957 UPDATE with LIMIT clause is wrong for versioned partitioned tables

UPDATE, DELETE: replace linear search of current/historical records
with vers_setup_conds().

Additional DML cases in view.test
2019-11-22 14:29:03 +03:00
6684989801 versioning test suite fixes
Preparation for MDEV-16210:

replace.test:
key_type combinations: PK and UNIQUE.

foreign.test:
Preparation for key_type combinations.

Other fixes:

* Merged versioning.update2 into versioning.update;
* Removed test2 database and done individual drop instead.
2019-10-10 00:20:34 +03:00
a071e0e029 Merge branch '10.2' into 10.3 2019-09-03 13:17:32 +03:00
1a86fc5f14 MDEV-15378 Valid query causes invalid view definition due to syntax limitation in FOR SYSTEM_TIME
fix parsing of the AS OF clause
2018-04-10 13:12:36 +02:00
f1bd02d994 MDEV-15004 parser greedily parses AS OF TIMESTAMP
* TIMESTAMP precedence fixed.
2018-02-23 15:33:23 +01:00
f51ecfee93 MDEV-15146 SQLError[4122]: View is not system versioned
don't expand AS OF in views, and, in particular, don't auto-add
AS OF NOW().
2018-02-12 23:43:48 +01:00
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
b85efdc3af rename system_time columns
sys_trx_start -> row_start
sys_trx_end -> row_end
2018-01-09 15:49:07 +03:00
aa4d1bedfc MDEV-14689 Server crashes in find_field_in_tables on 2nd execution of PS with versioned table and view
SQL: wrong usage of Item::transform()
2017-12-21 14:59:46 +03:00
8e8363bb75 SQL: VIEW system fields propagation removed [fixes #393] 2017-12-13 18:23:32 +03:00
84b718ae70 SQL: derived SYSTEM_TIME clash detection [closes #371] 2017-12-08 16:26:17 +03:00
68e160fb25 Tests: removed common.inc from results 2017-12-04 00:49:44 +03:00
33085349e9 IB, SQL: removed VTQ, added TRT on SQL layer [closes #305] 2017-11-15 00:22:10 +03:00
335bfb3421 Tests: view.test combinations 2017-11-13 19:11:02 +03:00
7ebd12e779 SQL: VIEW of UNION [fixes #293] 2017-11-13 19:11:02 +03:00
17bd486f36 SQL: thd_start_utime() fix [fixes #284] 2017-10-17 17:20:46 +03:00
75bc483d7a Tests: moved concat_execN() to common.inc 2017-09-25 22:07:01 +03:00
9ba635fda3 SQL: VIEW with UNION fix [fixes #269] 2017-09-14 14:38:49 +03:00
88ccf759c1 SQL: pruning, derived, view fixes [fixes #244] 2017-09-01 19:05:20 +03:00
99baeaa951 SQL: MAX microseconds for current system rows [fixes #245] 2017-08-18 14:29:22 +03:00
c2c8808a16 SQL: compare TRX_ID fields against timestamps [closes #231] 2017-08-03 16:01:16 +03:00
7e0ff13d7a SQL: derived fixes [related to #185] 2017-05-05 20:36:39 +03:00
1e8a81dea6 SQL: CREATE VIEW and misc improvements [fixes #183] 2017-05-05 20:36:37 +03:00
d64702d43a SQL: different results when querying a VIEW from PREPARED STATEMENT and without it [fixes #176] 2017-05-05 20:36:35 +03:00
352d83569b SQL: versioning for tmp HEAP tables created from IB tables [closes #158] 2017-05-05 20:36:32 +03:00
4ebf680c9b SQL: VIEW over a JOIN of versioned tables [fixes #153] 2017-05-05 20:36:31 +03:00
a37cf5258b SQL: CREATE VIEW with view_list from versioned table [fixes #151] 2017-05-05 20:36:30 +03:00
7aa3ebdd18 SQL, Tests: FOR SYSTEM_TIME for VIEWs [closes #98] 2017-05-05 20:36:27 +03:00
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
ea60760e47 SQL: missed FOR SYSTEM_TIME ALL for FOR_SYSTEM_TIME_UNSPECIFIED
[fixes #105]
2017-05-05 20:36:23 +03:00
412dd1e1f3 SQL: FOR SYSTEM_TIME support in VIEW expression [fixes #99] 2017-05-05 20:36:23 +03:00