mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-19 15:14:23 +01:00
sqlite3: no NULLS FIRST
sqlite3 added NULLS FIRST to their schema as of v3.30.1 but some older boxes aren't updated (notably the author's own node box). The default behavior for sqlite3 is to sort nulls first however, this is *really* only needed for postgres. As a simple fix (which will allow older boxes to not upgrade their sqlite yet), simply strip out the NULLS FIRST keywords from sqlite3 queries. Reported-By: Simon Vrouwe @SimonVrouwe Fixes: #5517
This commit is contained in:
@@ -51,6 +51,8 @@ class Sqlite3Rewriter(Rewriter):
|
||||
r'decode\((.*),\s*[\'\"]hex[\'\"]\)': 'x\\1',
|
||||
# GREATEST() of multiple columns is simple MAX in sqlite3.
|
||||
r'GREATEST\(([^)]*)\)': "MAX(\\1)",
|
||||
# NULLS FIRST is default behavior on sqlite, make it disappear
|
||||
r' NULLS FIRST': '',
|
||||
}
|
||||
return self.rewrite_types(query, typemapping)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user