Skip to content

Commit af2995b

Browse files
committed
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.
1 parent a939d20 commit af2995b

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/pgsql/pgsql-ddl.lisp

+1-3
Original file line numberDiff line numberDiff line change
@@ -266,9 +266,7 @@
266266
:collect (column-type-name
267267
(find idx-col tbl-cols
268268
:test #'string-equal
269-
:key (lambda (col)
270-
(ensure-unquoted
271-
(column-name col)))))))
269+
:key #'column-name))))
272270
(nobtree (catalog-types-without-btree
273271
(schema-catalog (table-schema (index-table index))))))
274272
(let* ((idx-type (first idx-types))

src/sources/sqlite/sqlite-schema.lisp

+1-1
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@
150150
"Return the list of columns in INDEX-NAME."
151151
(let ((sql (format nil (sql "/sqlite/list-index-cols.sql") index-name)))
152152
(loop :for (index-pos table-pos col-name) :in (sqlite:execute-to-list db sql)
153-
:collect col-name)))
153+
:collect (apply-identifier-case col-name))))
154154

155155
(defun list-indexes (table &optional (db *sqlite-db*))
156156
"Return the list of indexes attached to TABLE."

0 commit comments

Comments
 (0)