• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

tarantool / tarantool / 12404
81%
master: 88%

Build:
Build:
LAST BUILD BRANCH: ninarodicova/test5
DEFAULT BRANCH: master
Ran 06 Jun 2018 02:16PM UTC
Jobs 1
Files 353
Run time 53s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

pending completion
12404

push

travis-ci

Korablev77
sql: rework VIEW internals

This patch significantly reworks VIEW mechanisms.
Firstly, names resolution for VIEW now occurs during its creation.
In other words, we can't run following code, since name T1 doesn't exist
at the moment of V1 creation:

CREATE VIEW v1 AS SELECT * FROM t1;
CREATE TABLE t1(id PRIMARY KEY);

Now, table t1 must be created before view. As a result, no circularly
defined views are allowed. Moreover, it means that space representing
view is created with appropriate field names, types, collations etc.

Also, introduced view reference counter for each space. It is
incremented for each space participating in select statement.
For instace:

CREATE VIEW v1 AS SELECT * FROM (SELECT * FROM t1, t2);

In this case, view reference counter is increased for spaces T1 and T2.
Similarly, such counter is decremented for all dependent spaces when
VIEW is dropped.  To support such behavior, auxiliary
on_commit triggers are added. However, it is still not enough, since
before dropping space itself, we must drop secondary indexes, clear
_sequence space etc. Such changes can't be rollbacked (due to the lack
of transactional DDL), so before executing DROP routine, special opcode
OP_CheckViewReferences checks view reference counter for space to be
dropped.

Finally, we don't hold struct Select in struct Table or anywhere else
anymore.  Instead, 'CREATE VIEW AS SELECT ...' string is stored in
def->opts.sql.  At compilation time of query on view
(such as 'SELECT * FROM v1;') this string is parsed once and loaded
into struct Select, which in turn is used as before.

Fixed tests where view was created prior to referenced table.

Closes #3429, #3368, #3300

61641 of 75963 relevant lines covered (81.15%)

1500503.23 hits per line

Jobs
ID Job ID Ran Files Coverage
3 12404.3 (TARGET=coverage) 06 Jun 2018 02:16PM UTC 0
81.15
Travis Job 12404.3
Source Files on build 12404
Detailed source file information is not available for this build.
  • Back to Repo
  • Travis Build #12404
  • 815f5855 on github
  • Next Build on np/reword-view-internals (#12405)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc