Apply quoting rules to SQLite index column names.

The previous fix was wrong for missing the point: rather than unquote column
names in the table definition when matching the column names in the index
definition, we should in the first place have quoted the index column names
when needed.

Fixes #872 for real this time.
This commit is contained in:
Dimitri Fontaine 2018-12-02 00:17:26 +01:00
parent a939d20dff
commit af2995b918
2 changed files with 2 additions and 4 deletions

View File

@ -266,9 +266,7 @@
:collect (column-type-name
(find idx-col tbl-cols
:test #'string-equal
:key (lambda (col)
(ensure-unquoted
(column-name col)))))))
:key #'column-name))))
(nobtree (catalog-types-without-btree
(schema-catalog (table-schema (index-table index))))))
(let* ((idx-type (first idx-types))

View File

@ -150,7 +150,7 @@
"Return the list of columns in INDEX-NAME."
(let ((sql (format nil (sql "/sqlite/list-index-cols.sql") index-name)))
(loop :for (index-pos table-pos col-name) :in (sqlite:execute-to-list db sql)
:collect col-name)))
:collect (apply-identifier-case col-name))))
(defun list-indexes (table &optional (db *sqlite-db*))
"Return the list of indexes attached to TABLE."