Prior to version 3.23 SQLite does not support TRUE or FALSE, so always use 1 and 0 for SQLite.
Showing the changes to tools/perf/scripts/python (1 of 1 file). Show all
Unified · Split
| @@ -637,7 +637,7 @@ class CallGraphRootItem(CallGraphLevelItemBase): · 636 unmodified lines | |||
| 637 | self.query_done = True | 637 | self.query_done = True |
| 638 | if_has_calls = "" | 638 | if_has_calls = "" |
| 639 | if IsSelectable(glb.db, "comms", columns = "has_calls"): | 639 | if IsSelectable(glb.db, "comms", columns = "has_calls"): |
| 640 | if_has_calls = " WHERE has_calls = TRUE" | 640 | if_has_calls = " WHERE has_calls = " + glb.dbref.TRUE |
| 641 | query = QSqlQuery(glb.db) | 641 | query = QSqlQuery(glb.db) |
| 642 | QueryExec(query, "SELECT id, comm FROM comms" + if_has_calls) | 642 | QueryExec(query, "SELECT id, comm FROM comms" + if_has_calls) |
| 643 | while query.next(): | 643 | while query.next(): |
| @@ -918,7 +918,7 @@ class CallTreeRootItem(CallGraphLevelItemBase): · 274 unmodified lines | |||
| 918 | self.query_done = True | 918 | self.query_done = True |
| 919 | if_has_calls = "" | 919 | if_has_calls = "" |
| 920 | if IsSelectable(glb.db, "comms", columns = "has_calls"): | 920 | if IsSelectable(glb.db, "comms", columns = "has_calls"): |
| 921 | if_has_calls = " WHERE has_calls = TRUE" | 921 | if_has_calls = " WHERE has_calls = " + glb.dbref.TRUE |
| 922 | query = QSqlQuery(glb.db) | 922 | query = QSqlQuery(glb.db) |
| 923 | QueryExec(query, "SELECT id, comm FROM comms" + if_has_calls) | 923 | QueryExec(query, "SELECT id, comm FROM comms" + if_has_calls) |
| 924 | while query.next(): | 924 | while query.next(): |
| @@ -1290,7 +1290,7 @@ class SwitchGraphData(GraphData): · 365 unmodified lines | |||
| 1290 | QueryExec(query, "SELECT id, c_time" | 1290 | QueryExec(query, "SELECT id, c_time" |
| 1291 | " FROM comms" | 1291 | " FROM comms" |
| 1292 | " WHERE c_thread_id = " + str(thread_id) + | 1292 | " WHERE c_thread_id = " + str(thread_id) + |
| 1293 | " AND exec_flag = TRUE" | 1293 | " AND exec_flag = " + self.collection.glb.dbref.TRUE + |
| 1294 | " AND c_time >= " + str(start_time) + | 1294 | " AND c_time >= " + str(start_time) + |
| 1295 | " AND c_time <= " + str(end_time) + | 1295 | " AND c_time <= " + str(end_time) + |
| 1296 | " ORDER BY c_time, id") | 1296 | " ORDER BY c_time, id") |
| @@ -5016,6 +5016,12 @@ class DBRef(): · 3719 unmodified lines | |||
| 5016 | def __init__(self, is_sqlite3, dbname): | 5016 | def __init__(self, is_sqlite3, dbname): |
| 5017 | self.is_sqlite3 = is_sqlite3 | 5017 | self.is_sqlite3 = is_sqlite3 |
| 5018 | self.dbname = dbname | 5018 | self.dbname = dbname |
| 5019 | self.TRUE = "TRUE" | ||
| 5020 | self.FALSE = "FALSE" | ||
| 5021 | # SQLite prior to version 3.23 does not support TRUE and FALSE | ||
| 5022 | if self.is_sqlite3: | ||
| 5023 | self.TRUE = "1" | ||
| 5024 | self.FALSE = "0" | ||
| 5019 | 5025 | ||
| 5020 | def Open(self, connection_name): | 5026 | def Open(self, connection_name): |
| 5021 | dbname = self.dbname | 5027 | dbname = self.dbname |