Skip to content
Snippets Groups Projects
Commit 0bc63674 authored by Ivan Koptelov's avatar Ivan Koptelov Committed by Kirill Yukhin
Browse files

sql: add index_def to Index

Now every sqlite struct Index is created with tnt
struct index_def inside. This allows us to use tnt
index_def in work with sqlite indexes in the same
manner as with tnt index and is a step to remove
sqlite Index with tnt index.
Fields coll_array, coll_id_array, aiColumn,
sort_order, aiRowLogEst and zName are removed from
Index. All usages of this fields changed to usage of
corresponding index_def or index_def->opts fields.
index_is_unique(), sql_index_collation() and
index_column_count() are removed with calls of
index_def corresponding fields.
Also there is small change in behavior: before the
patch a statement like
CREATE TABLE t1(a,b, PRIMARY KEY(a,b), UNIQUE(a,b))
created only one constraint index (for primary key)
and no index for UNIQUE constraint (since it is upon
the same columns), neither it is named or non-named
constraint.
After the patch index will be always created for named
constraints. It is a temporary solution. In future
it's preferable not to create an index, but to make
some record in _constraints space that this named
unique constraint implemented with the same index as
primary key constraint.

Closes: #3369, #3498
parent 09d7a5da
No related branches found
No related tags found
Loading
Showing
with 996 additions and 1120 deletions
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment