I have not seen an error like this as a result of an upgrade of asterisk. The error does not have anything to do with asterisk directly so I would suspect that something else may have changed on your system. The error message you received is an unusual one. It is often associated with mixed or incorrect versions of sqlite. Did you by any chance build sqlite with your new asterisk install? How did you install the new asterisk version? which version of sark/sail do you have?
You can get an output (in the error-log) of the actual sql command which you are running by uncommenting line 914 in the same SarkSubs module and running your code again.
Kind Regards
S