Hi All,

I am using an FTS3 virtual table with multiple columns. This works very
well, until I try to do an UPDATE on _one_ of the columns in the vtable. In
that case, the other columns are cleared.

After looking into the FTS3 code, I discovered that the columns in the
original SQL statement are ignored. At least, the internal SQL query for the
content (%_content) updating is generated regardless of what columns were
referenced in the original SQL statement. (See contentUpdateStatement()
function). The unreferenced columns come as empty strings and get happily
written to the database. I assume that the same happens for other FTS3 stuff
(%_segments, etc). I am not very familiar with FTS3 and Sqlite internals,
though, and may be mistaken here.

The workaround would be simple - reference each and every column in your
UPDATE query, where the desired column is altered, and all the other are old
values. This might be wasteful and inelegant, however, as it requires a
redundant read.

Any thougths or hints on this will be greatly appreciated :)

Yaroslav
-- 
View this message in context: 
http://www.nabble.com/FTS3%2C-UPDATE-of-one-column%3A-why-are-all-columns-affected--tp20036520p20036520.html
Sent from the SQLite mailing list archive at Nabble.com.

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to