@@ -105,6 +105,30 @@ int compareTrampoline(void*, int, char*, int, char*);
105
105
int commitHookTrampoline(void*);
106
106
void rollbackHookTrampoline(void*);
107
107
void updateHookTrampoline(void*, int, char*, char*, sqlite3_int64);
108
+
109
+ #ifdef SQLITE_LIMIT_WORKER_THREADS
110
+ # define _SQLITE_HAS_LIMIT
111
+ # define SQLITE_LIMIT_LENGTH 0
112
+ # define SQLITE_LIMIT_SQL_LENGTH 1
113
+ # define SQLITE_LIMIT_COLUMN 2
114
+ # define SQLITE_LIMIT_EXPR_DEPTH 3
115
+ # define SQLITE_LIMIT_COMPOUND_SELECT 4
116
+ # define SQLITE_LIMIT_VDBE_OP 5
117
+ # define SQLITE_LIMIT_FUNCTION_ARG 6
118
+ # define SQLITE_LIMIT_ATTACHED 7
119
+ # define SQLITE_LIMIT_LIKE_PATTERN_LENGTH 8
120
+ # define SQLITE_LIMIT_VARIABLE_NUMBER 9
121
+ # define SQLITE_LIMIT_TRIGGER_DEPTH 10
122
+ # define SQLITE_LIMIT_WORKER_THREADS 11
123
+ #endif
124
+
125
+ static int _sqlite3_limit(sqlite3* db, int limitId, int newLimit) {
126
+ #ifndef _SQLITE_HAS_LIMIT
127
+ return -1;
128
+ #else
129
+ return sqlite3_limit(db, limitId, newLimit);
130
+ #endif
131
+ }
108
132
*/
109
133
import "C"
110
134
import (
@@ -847,14 +871,14 @@ const (
847
871
// GetLimit returns the current value of a run-time limit.
848
872
// See: sqlite3_limit, http://www.sqlite.org/c3ref/limit.html
849
873
func (c * SQLiteConn ) GetLimit (id int ) int {
850
- return int (C .sqlite3_limit (c .db , C .int (id ), - 1 ))
874
+ return int (C ._sqlite3_limit (c .db , C .int (id ), - 1 ))
851
875
}
852
876
853
877
// SetLimit changes the value of a run-time limits.
854
878
// Then this method returns the prior value of the limit.
855
879
// See: sqlite3_limit, http://www.sqlite.org/c3ref/limit.html
856
880
func (c * SQLiteConn ) SetLimit (id int , newVal int ) int {
857
- return int (C .sqlite3_limit (c .db , C .int (id ), C .int (newVal )))
881
+ return int (C ._sqlite3_limit (c .db , C .int (id ), C .int (newVal )))
858
882
}
859
883
860
884
// Close the statement.
0 commit comments