Expose sqlite3_limit() to JNI and remove the all SQLITE_ macros from the Java interface which are not directly exposed to client-level C code (SQLITE_MAX_... and SQLITE_THREADSAFE_...).
FossilOrigin-Name: 5fe5b0a585dbfa06cfca1fea40aea5ea3ccfe8295f41306ad2d5b851ace27203
This commit is contained in:
parent
55171a75ef
commit
03ca59afb9
@ -291,7 +291,7 @@ static inline void s3jni_unref_local(JNIEnv * const env, jobject const v){
|
||||
#define S3JniUnrefLocal(VAR) s3jni_unref_local(env, (VAR))
|
||||
|
||||
/*
|
||||
** Key type for use with S3JniGlobal_nph().
|
||||
** Lookup key type for use with s3jni_nph().
|
||||
*/
|
||||
typedef struct S3JniNphRef S3JniNphRef;
|
||||
struct S3JniNphRef {
|
||||
@ -304,7 +304,7 @@ struct S3JniNphRef {
|
||||
/*
|
||||
** Cache keys for each concrete NativePointerHolder subclass and
|
||||
** OutputPointer.T type. The members are to be used with
|
||||
** S3JniGlobal_nph() and friends, and each one's member->index
|
||||
** s3jni_nph() and friends, and each one's member->index
|
||||
** corresponds to its index in the S3JniGlobal.nph[] array.
|
||||
*/
|
||||
static const struct {
|
||||
@ -375,7 +375,7 @@ enum {
|
||||
/*
|
||||
** Cache entry for NativePointerHolder subclasses and OutputPointer
|
||||
** types. The pRef and klazz fields are set up the first time the
|
||||
** entry is fetched using S3JniGlobal_nph(). The other fields are
|
||||
** entry is fetched using s3jni_nph(). The other fields are
|
||||
** populated as needed by the routines which use them.
|
||||
*/
|
||||
typedef struct S3JniNphClass S3JniNphClass;
|
||||
@ -1282,12 +1282,11 @@ static int S3JniEnv_uncache(JNIEnv * const env){
|
||||
}
|
||||
|
||||
/*
|
||||
** Searches the NativePointerHolder cache for the given combination of
|
||||
** args. It returns a cache entry with its klazz member set. This is
|
||||
** an O(1) operation except on the first call for a given pRef, during
|
||||
** which pRef->klazz and pRef->pRef are initialized thread-safely. In
|
||||
** the latter case it's still effectively O(1), but with a much longer
|
||||
** 1.
|
||||
** Fetches the given nph-ref from cache the cache and returns the
|
||||
** object with its klazz member set. This is an O(1) operation except
|
||||
** on the first call for a given pRef, during which pRef->klazz and
|
||||
** pRef->pRef are initialized thread-safely. In the latter case it's
|
||||
** still effectively O(1), but with a much longer 1.
|
||||
**
|
||||
** It is up to the caller to populate the other members of the
|
||||
** returned object if needed, taking care to lock the modification
|
||||
@ -1296,7 +1295,7 @@ static int S3JniEnv_uncache(JNIEnv * const env){
|
||||
** This simple cache catches >99% of searches in the current
|
||||
** (2023-07-31) tests.
|
||||
*/
|
||||
static S3JniNphClass * S3JniGlobal__nph(JNIEnv * const env, S3JniNphRef const* pRef){
|
||||
static S3JniNphClass * s3jni__nph(JNIEnv * const env, S3JniNphRef const* pRef){
|
||||
/**
|
||||
According to:
|
||||
|
||||
@ -1333,7 +1332,7 @@ static S3JniNphClass * S3JniGlobal__nph(JNIEnv * const env, S3JniNphRef const* p
|
||||
return pNC;
|
||||
}
|
||||
|
||||
#define S3JniGlobal_nph(PREF) S3JniGlobal__nph(env, PREF)
|
||||
#define s3jni_nph(PRef) s3jni__nph(env, PRef)
|
||||
|
||||
/*
|
||||
** Common code for accessor functions for NativePointerHolder and
|
||||
@ -1348,7 +1347,7 @@ static S3JniNphClass * S3JniGlobal__nph(JNIEnv * const env, S3JniNphRef const* p
|
||||
** Property lookups are cached on a per-pRef basis.
|
||||
*/
|
||||
static jfieldID s3jni_nphop_field(JNIEnv * const env, S3JniNphRef const* pRef){
|
||||
S3JniNphClass * const pNC = S3JniGlobal_nph(pRef);
|
||||
S3JniNphClass * const pNC = s3jni_nph(pRef);
|
||||
|
||||
if( !pNC->fidValue ){
|
||||
S3JniNph_mutex_enter;
|
||||
@ -1665,7 +1664,7 @@ static void ResultJavaValue_finalizer(void *v){
|
||||
static jobject new_NativePointerHolder_object(JNIEnv * const env, S3JniNphRef const * pRef,
|
||||
const void * pNative){
|
||||
jobject rv = 0;
|
||||
S3JniNphClass * const pNC = S3JniGlobal_nph(pRef);
|
||||
S3JniNphClass * const pNC = s3jni_nph(pRef);
|
||||
if( !pNC->midCtor ){
|
||||
S3JniNph_mutex_enter;
|
||||
if( !pNC->midCtor ){
|
||||
@ -1816,7 +1815,7 @@ static int udf_args(JNIEnv *env,
|
||||
*jArgv = 0;
|
||||
if( !jcx ) goto error_oom;
|
||||
ja = (*env)->NewObjectArray(
|
||||
env, argc, S3JniGlobal_nph(&S3JniNphRefs.sqlite3_value)->klazz,
|
||||
env, argc, s3jni_nph(&S3JniNphRefs.sqlite3_value)->klazz,
|
||||
NULL);
|
||||
s3jni_oom_check( ja );
|
||||
if( !ja ) goto error_oom;
|
||||
@ -3216,6 +3215,17 @@ S3JniApi(sqlite3_last_insert_rowid(),jlong,1last_1insert_1rowid)(
|
||||
return rc;
|
||||
}
|
||||
|
||||
S3JniApi(sqlite3_limit(),jint,1limit)(
|
||||
JniArgsEnvClass, jobject jpDb, jint id, jint newVal
|
||||
){
|
||||
jint rc = 0;
|
||||
sqlite3 * const pDb = PtrGet_sqlite3(jpDb);
|
||||
if( pDb ){
|
||||
rc = sqlite3_limit( pDb, (int)id, (int)newVal );
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
/* Pre-open() code common to sqlite3_open[_v2](). */
|
||||
static int s3jni_open_pre(JNIEnv * const env, S3JniEnv **jc,
|
||||
jstring jDbName, char **zDbName,
|
||||
@ -4400,7 +4410,7 @@ JniDecl(void,1jni_1internal_1details)(JniArgsEnvClass){
|
||||
SO(S3JniHook);
|
||||
SO(S3JniDb);
|
||||
SO(S3JniNphRefs);
|
||||
printf("\t(^^^ %u NativePointerHolder subclasses)\n",
|
||||
printf("\t(^^^ %u NativePointerHolder/OutputPointer.T types)\n",
|
||||
(unsigned)S3Jni_NphCache_size);
|
||||
SO(S3JniGlobal);
|
||||
SO(S3JniAutoExtension);
|
||||
@ -5270,39 +5280,13 @@ Java_org_sqlite_jni_SQLite3Jni_init(JniArgsEnvClass){
|
||||
const char *zName;
|
||||
enum JType jtype;
|
||||
int value;
|
||||
} ConfigFlagEntry;
|
||||
const ConfigFlagEntry aLimits[] = {
|
||||
{"SQLITE_MAX_ALLOCATION_SIZE", JTYPE_INT, SQLITE_MAX_ALLOCATION_SIZE},
|
||||
{"SQLITE_LIMIT_LENGTH", JTYPE_INT, SQLITE_LIMIT_LENGTH},
|
||||
{"SQLITE_MAX_LENGTH", JTYPE_INT, SQLITE_MAX_LENGTH},
|
||||
{"SQLITE_LIMIT_SQL_LENGTH", JTYPE_INT, SQLITE_LIMIT_SQL_LENGTH},
|
||||
{"SQLITE_MAX_SQL_LENGTH", JTYPE_INT, SQLITE_MAX_SQL_LENGTH},
|
||||
{"SQLITE_LIMIT_COLUMN", JTYPE_INT, SQLITE_LIMIT_COLUMN},
|
||||
{"SQLITE_MAX_COLUMN", JTYPE_INT, SQLITE_MAX_COLUMN},
|
||||
{"SQLITE_LIMIT_EXPR_DEPTH", JTYPE_INT, SQLITE_LIMIT_EXPR_DEPTH},
|
||||
{"SQLITE_MAX_EXPR_DEPTH", JTYPE_INT, SQLITE_MAX_EXPR_DEPTH},
|
||||
{"SQLITE_LIMIT_COMPOUND_SELECT", JTYPE_INT, SQLITE_LIMIT_COMPOUND_SELECT},
|
||||
{"SQLITE_MAX_COMPOUND_SELECT", JTYPE_INT, SQLITE_MAX_COMPOUND_SELECT},
|
||||
{"SQLITE_LIMIT_VDBE_OP", JTYPE_INT, SQLITE_LIMIT_VDBE_OP},
|
||||
{"SQLITE_MAX_VDBE_OP", JTYPE_INT, SQLITE_MAX_VDBE_OP},
|
||||
{"SQLITE_LIMIT_FUNCTION_ARG", JTYPE_INT, SQLITE_LIMIT_FUNCTION_ARG},
|
||||
{"SQLITE_MAX_FUNCTION_ARG", JTYPE_INT, SQLITE_MAX_FUNCTION_ARG},
|
||||
{"SQLITE_LIMIT_ATTACHED", JTYPE_INT, SQLITE_LIMIT_ATTACHED},
|
||||
{"SQLITE_MAX_ATTACHED", JTYPE_INT, SQLITE_MAX_ATTACHED},
|
||||
{"SQLITE_LIMIT_LIKE_PATTERN_LENGTH", JTYPE_INT, SQLITE_LIMIT_LIKE_PATTERN_LENGTH},
|
||||
{"SQLITE_MAX_LIKE_PATTERN_LENGTH", JTYPE_INT, SQLITE_MAX_LIKE_PATTERN_LENGTH},
|
||||
{"SQLITE_LIMIT_VARIABLE_NUMBER", JTYPE_INT, SQLITE_LIMIT_VARIABLE_NUMBER},
|
||||
{"SQLITE_MAX_VARIABLE_NUMBER", JTYPE_INT, SQLITE_MAX_VARIABLE_NUMBER},
|
||||
{"SQLITE_LIMIT_TRIGGER_DEPTH", JTYPE_INT, SQLITE_LIMIT_TRIGGER_DEPTH},
|
||||
{"SQLITE_MAX_TRIGGER_DEPTH", JTYPE_INT, SQLITE_MAX_TRIGGER_DEPTH},
|
||||
{"SQLITE_LIMIT_WORKER_THREADS", JTYPE_INT, SQLITE_LIMIT_WORKER_THREADS},
|
||||
{"SQLITE_MAX_WORKER_THREADS", JTYPE_INT, SQLITE_MAX_WORKER_THREADS},
|
||||
{"SQLITE_THREADSAFE", JTYPE_INT, SQLITE_THREADSAFE},
|
||||
} DefineEntry;
|
||||
const DefineEntry aLimits[] = {
|
||||
{0,0}
|
||||
};
|
||||
jfieldID fieldId;
|
||||
jclass klazz;
|
||||
const ConfigFlagEntry * pConfFlag;
|
||||
const DefineEntry * pDef;
|
||||
|
||||
#if 0
|
||||
if( 0==sqlite3_threadsafe() ){
|
||||
@ -5376,18 +5360,18 @@ Java_org_sqlite_jni_SQLite3Jni_init(JniArgsEnvClass){
|
||||
** sqlite3_config(), if it's ever implemented. */;
|
||||
|
||||
/* Set up static "consts" of the SQLite3Jni class. */
|
||||
for( pConfFlag = &aLimits[0]; pConfFlag->zName; ++pConfFlag ){
|
||||
char const * zSig = (JTYPE_BOOL == pConfFlag->jtype) ? "Z" : "I";
|
||||
fieldId = (*env)->GetStaticFieldID(env, jKlazz, pConfFlag->zName, zSig);
|
||||
for( pDef = &aLimits[0]; pDef->zName; ++pDef ){
|
||||
char const * zSig = (JTYPE_BOOL == pDef->jtype) ? "Z" : "I";
|
||||
fieldId = (*env)->GetStaticFieldID(env, jKlazz, pDef->zName, zSig);
|
||||
S3JniExceptionIsFatal("Missing an expected static member of the SQLite3Jni class.");
|
||||
assert(fieldId);
|
||||
switch( pConfFlag->jtype ){
|
||||
switch( pDef->jtype ){
|
||||
case JTYPE_INT:
|
||||
(*env)->SetStaticIntField(env, jKlazz, fieldId, (jint)pConfFlag->value);
|
||||
(*env)->SetStaticIntField(env, jKlazz, fieldId, (jint)pDef->value);
|
||||
break;
|
||||
case JTYPE_BOOL:
|
||||
(*env)->SetStaticBooleanField(env, jKlazz, fieldId,
|
||||
pConfFlag->value ? JNI_TRUE : JNI_FALSE);
|
||||
pDef->value ? JNI_TRUE : JNI_FALSE);
|
||||
break;
|
||||
}
|
||||
S3JniExceptionIsFatal("Seting a static member of the SQLite3Jni class failed.");
|
||||
|
@ -379,6 +379,30 @@ extern "C" {
|
||||
#define org_sqlite_jni_SQLite3Jni_SQLITE_IOCAP_IMMUTABLE 8192L
|
||||
#undef org_sqlite_jni_SQLite3Jni_SQLITE_IOCAP_BATCH_ATOMIC
|
||||
#define org_sqlite_jni_SQLite3Jni_SQLITE_IOCAP_BATCH_ATOMIC 16384L
|
||||
#undef org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_LENGTH
|
||||
#define org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_LENGTH 0L
|
||||
#undef org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_SQL_LENGTH
|
||||
#define org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_SQL_LENGTH 1L
|
||||
#undef org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_COLUMN
|
||||
#define org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_COLUMN 2L
|
||||
#undef org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_EXPR_DEPTH
|
||||
#define org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_EXPR_DEPTH 3L
|
||||
#undef org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_COMPOUND_SELECT
|
||||
#define org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_COMPOUND_SELECT 4L
|
||||
#undef org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_VDBE_OP
|
||||
#define org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_VDBE_OP 5L
|
||||
#undef org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_FUNCTION_ARG
|
||||
#define org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_FUNCTION_ARG 6L
|
||||
#undef org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_ATTACHED
|
||||
#define org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_ATTACHED 7L
|
||||
#undef org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_LIKE_PATTERN_LENGTH
|
||||
#define org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_LIKE_PATTERN_LENGTH 8L
|
||||
#undef org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_VARIABLE_NUMBER
|
||||
#define org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_VARIABLE_NUMBER 9L
|
||||
#undef org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_TRIGGER_DEPTH
|
||||
#define org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_TRIGGER_DEPTH 10L
|
||||
#undef org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_WORKER_THREADS
|
||||
#define org_sqlite_jni_SQLite3Jni_SQLITE_LIMIT_WORKER_THREADS 11L
|
||||
#undef org_sqlite_jni_SQLite3Jni_SQLITE_OPEN_READONLY
|
||||
#define org_sqlite_jni_SQLite3Jni_SQLITE_OPEN_READONLY 1L
|
||||
#undef org_sqlite_jni_SQLite3Jni_SQLITE_OPEN_READWRITE
|
||||
@ -1315,6 +1339,14 @@ JNIEXPORT jstring JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1libversion
|
||||
JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1libversion_1number
|
||||
(JNIEnv *, jclass);
|
||||
|
||||
/*
|
||||
* Class: org_sqlite_jni_SQLite3Jni
|
||||
* Method: sqlite3_limit
|
||||
* Signature: (Lorg/sqlite/jni/sqlite3;II)I
|
||||
*/
|
||||
JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1limit
|
||||
(JNIEnv *, jclass, jobject, jint, jint);
|
||||
|
||||
/*
|
||||
* Class: org_sqlite_jni_SQLite3Jni
|
||||
* Method: sqlite3_open
|
||||
|
@ -669,6 +669,9 @@ public final class SQLite3Jni {
|
||||
@Canonical
|
||||
public static native int sqlite3_libversion_number();
|
||||
|
||||
@Canonical
|
||||
public static native int sqlite3_limit(@NotNull sqlite3 db, int id, int newVal);
|
||||
|
||||
/**
|
||||
Works like its C counterpart and makes the native pointer of the
|
||||
underling (sqlite3*) object available via
|
||||
@ -1557,10 +1560,6 @@ public final class SQLite3Jni {
|
||||
public static final String SQLITE_VERSION = sqlite3_libversion();
|
||||
public static final String SQLITE_SOURCE_ID = sqlite3_sourceid();
|
||||
|
||||
// Initialized at static init time to the build-time value of
|
||||
// SQLITE_THREADSAFE.
|
||||
public static int SQLITE_THREADSAFE = -1;
|
||||
|
||||
// access
|
||||
public static final int SQLITE_ACCESS_EXISTS = 0;
|
||||
public static final int SQLITE_ACCESS_READWRITE = 1;
|
||||
@ -1773,36 +1772,19 @@ public final class SQLite3Jni {
|
||||
public static final int SQLITE_IOCAP_IMMUTABLE = 8192;
|
||||
public static final int SQLITE_IOCAP_BATCH_ATOMIC = 16384;
|
||||
|
||||
// limits. These get injected at init-time so that they stay in sync
|
||||
// with the compile-time options. This unfortunately means they are
|
||||
// not final, but keeping them in sync with their C values seems
|
||||
// more important than protecting users from assigning to these
|
||||
// (with unpredictable results).
|
||||
public static int SQLITE_MAX_ALLOCATION_SIZE = -1;
|
||||
public static int SQLITE_LIMIT_LENGTH = -1;
|
||||
public static int SQLITE_MAX_LENGTH = -1;
|
||||
public static int SQLITE_LIMIT_SQL_LENGTH = -1;
|
||||
public static int SQLITE_MAX_SQL_LENGTH = -1;
|
||||
public static int SQLITE_LIMIT_COLUMN = -1;
|
||||
public static int SQLITE_MAX_COLUMN = -1;
|
||||
public static int SQLITE_LIMIT_EXPR_DEPTH = -1;
|
||||
public static int SQLITE_MAX_EXPR_DEPTH = -1;
|
||||
public static int SQLITE_LIMIT_COMPOUND_SELECT = -1;
|
||||
public static int SQLITE_MAX_COMPOUND_SELECT = -1;
|
||||
public static int SQLITE_LIMIT_VDBE_OP = -1;
|
||||
public static int SQLITE_MAX_VDBE_OP = -1;
|
||||
public static int SQLITE_LIMIT_FUNCTION_ARG = -1;
|
||||
public static int SQLITE_MAX_FUNCTION_ARG = -1;
|
||||
public static int SQLITE_LIMIT_ATTACHED = -1;
|
||||
public static int SQLITE_MAX_ATTACHED = -1;
|
||||
public static int SQLITE_LIMIT_LIKE_PATTERN_LENGTH = -1;
|
||||
public static int SQLITE_MAX_LIKE_PATTERN_LENGTH = -1;
|
||||
public static int SQLITE_LIMIT_VARIABLE_NUMBER = -1;
|
||||
public static int SQLITE_MAX_VARIABLE_NUMBER = -1;
|
||||
public static int SQLITE_LIMIT_TRIGGER_DEPTH = -1;
|
||||
public static int SQLITE_MAX_TRIGGER_DEPTH = -1;
|
||||
public static int SQLITE_LIMIT_WORKER_THREADS = -1;
|
||||
public static int SQLITE_MAX_WORKER_THREADS = -1;
|
||||
// limits
|
||||
public static final int SQLITE_LIMIT_LENGTH = 0;
|
||||
public static final int SQLITE_LIMIT_SQL_LENGTH = 1;
|
||||
public static final int SQLITE_LIMIT_COLUMN = 2;
|
||||
public static final int SQLITE_LIMIT_EXPR_DEPTH = 3;
|
||||
public static final int SQLITE_LIMIT_COMPOUND_SELECT = 4;
|
||||
public static final int SQLITE_LIMIT_VDBE_OP = 5;
|
||||
public static final int SQLITE_LIMIT_FUNCTION_ARG = 6;
|
||||
public static final int SQLITE_LIMIT_ATTACHED = 7;
|
||||
public static final int SQLITE_LIMIT_LIKE_PATTERN_LENGTH = 8;
|
||||
public static final int SQLITE_LIMIT_VARIABLE_NUMBER = 9;
|
||||
public static final int SQLITE_LIMIT_TRIGGER_DEPTH = 10;
|
||||
public static final int SQLITE_LIMIT_WORKER_THREADS = 11;
|
||||
|
||||
// open flags
|
||||
public static final int SQLITE_OPEN_READONLY = 1;
|
||||
|
@ -125,8 +125,6 @@ public class Tester1 implements Runnable {
|
||||
@ManualTest /* because testing this for threading is pointless */
|
||||
private void test1(){
|
||||
affirm(sqlite3_libversion_number() == SQLITE_VERSION_NUMBER);
|
||||
affirm(SQLITE_MAX_LENGTH > 0);
|
||||
affirm(SQLITE_MAX_TRIGGER_DEPTH>0);
|
||||
}
|
||||
|
||||
static sqlite3 createNewDb(){
|
||||
@ -1438,6 +1436,17 @@ public class Tester1 implements Runnable {
|
||||
sqlite3_close_v2(db);
|
||||
}
|
||||
|
||||
private void testLimit(){
|
||||
final sqlite3 db = createNewDb();
|
||||
|
||||
int v1, v2;
|
||||
v1 = sqlite3_limit(db, SQLITE_LIMIT_LENGTH, -1);
|
||||
affirm( v1 > 0 );
|
||||
affirm( v1 == sqlite3_limit(db, SQLITE_LIMIT_LENGTH, v1-1) );
|
||||
affirm( v1-1 == sqlite3_limit(db, SQLITE_LIMIT_LENGTH, -1) );
|
||||
sqlite3_close_v2(db);
|
||||
}
|
||||
|
||||
/* Copy/paste/rename this to add new tests. */
|
||||
private void _testTemplate(){
|
||||
final sqlite3 db = createNewDb();
|
||||
@ -1636,7 +1645,7 @@ public class Tester1 implements Runnable {
|
||||
|
||||
final long timeStart = System.currentTimeMillis();
|
||||
int nLoop = 0;
|
||||
switch( SQLITE_THREADSAFE ){ /* Sanity checking */
|
||||
switch( sqlite3_threadsafe() ){ /* Sanity checking */
|
||||
case 0:
|
||||
affirm( SQLITE_ERROR==sqlite3_config( SQLITE_CONFIG_SINGLETHREAD ),
|
||||
"Could not switch to single-thread mode." );
|
||||
@ -1662,7 +1671,7 @@ public class Tester1 implements Runnable {
|
||||
outln("libversion_number: ",
|
||||
sqlite3_libversion_number(),"\n",
|
||||
sqlite3_libversion(),"\n",SQLITE_SOURCE_ID,"\n",
|
||||
"SQLITE_THREADSAFE=",SQLITE_THREADSAFE);
|
||||
"SQLITE_THREADSAFE=",sqlite3_threadsafe());
|
||||
final boolean showLoopCount = (nRepeat>1 && nThread>1);
|
||||
if( showLoopCount ){
|
||||
outln("Running ",nRepeat," loop(s) with ",nThread," thread(s) each.");
|
||||
@ -1713,6 +1722,7 @@ public class Tester1 implements Runnable {
|
||||
sqlite3_shutdown();
|
||||
int nMethods = 0;
|
||||
int nNatives = 0;
|
||||
int nCanonical = 0;
|
||||
final java.lang.reflect.Method[] declaredMethods =
|
||||
SQLite3Jni.class.getDeclaredMethods();
|
||||
for(java.lang.reflect.Method m : declaredMethods){
|
||||
@ -1721,6 +1731,9 @@ public class Tester1 implements Runnable {
|
||||
final String name = m.getName();
|
||||
if(name.startsWith("sqlite3_")){
|
||||
++nMethods;
|
||||
if( m.isAnnotationPresent( org.sqlite.jni.annotation.Canonical.class ) ){
|
||||
++nCanonical;
|
||||
}
|
||||
if( 0!=(mod & java.lang.reflect.Modifier.NATIVE) ){
|
||||
++nNatives;
|
||||
}
|
||||
@ -1728,8 +1741,10 @@ public class Tester1 implements Runnable {
|
||||
}
|
||||
}
|
||||
outln("\tSQLite3Jni.sqlite3_*() methods: "+
|
||||
nNatives+" native methods and "+
|
||||
(nMethods - nNatives)+" Java impls");
|
||||
nNatives+" native methods, "+
|
||||
(nMethods - nNatives)+" Java impls. ",
|
||||
nCanonical," methods flagged as canonical"
|
||||
);
|
||||
outln("\tTotal test time = "
|
||||
+(timeEnd - timeStart)+"ms");
|
||||
}
|
||||
|
@ -20,14 +20,14 @@ package org.sqlite.jni.annotation;
|
||||
different name than its C counterpart. For such cases,
|
||||
(cname=the-C-side-name) is passed to this annotation and a
|
||||
Java-side implementation with a slightly different signature is
|
||||
added to with the canonical name. As of this writing, that applies
|
||||
added with the canonical name. As of this writing, that applies
|
||||
only to {@link org.sqlite.jni.SQLite3Jni#sqlite3_value_text_utf8}
|
||||
and {@link org.sqlite.jni.SQLite3Jni#sqlite3_column_text_utf8}.
|
||||
|
||||
<p>The comment property can be used to add a comment.
|
||||
*/
|
||||
@java.lang.annotation.Documented
|
||||
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.SOURCE)
|
||||
@java.lang.annotation.Retention(java.lang.annotation.RetentionPolicy.RUNTIME)
|
||||
@java.lang.annotation.Target(java.lang.annotation.ElementType.METHOD)
|
||||
public @interface Canonical{
|
||||
/**
|
||||
|
22
manifest
22
manifest
@ -1,5 +1,5 @@
|
||||
C JNI\sbuild\simprovements.\sRename\sa\sJava\sclass.\sGet\sthe\sjar\starget\sworking\sagain.
|
||||
D 2023-09-01T09:43:56.871
|
||||
C Expose\ssqlite3_limit()\sto\sJNI\sand\sremove\sthe\sall\sSQLITE_\smacros\sfrom\sthe\sJava\sinterface\swhich\sare\snot\sdirectly\sexposed\sto\sclient-level\sC\scode\s(SQLITE_MAX_...\sand\sSQLITE_THREADSAFE_...).
|
||||
D 2023-09-01T10:32:31.300
|
||||
F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1
|
||||
F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea
|
||||
F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724
|
||||
@ -237,14 +237,14 @@ F ext/icu/sqliteicu.h fa373836ed5a1ee7478bdf8a1650689294e41d0c89c1daab26e9ae78a3
|
||||
F ext/jni/GNUmakefile c6100f8855f9f533466d75e031a458875003c5b5cc01fe9a34581d55f0048119
|
||||
F ext/jni/README.md 1332b1fa27918bd5d9ca2d0d4f3ac3a6ab86b9e3699dc5bfe32904a027f3d2a9
|
||||
F ext/jni/jar-dist.make 030aaa4ae71dd86e4ec5e7c1e6cd86f9dfa47c4592c070d2e35157e42498e1fa
|
||||
F ext/jni/src/c/sqlite3-jni.c 94092d07a8a5df2cb66f4ac04a28d150ed29361a7aec82776bfdd3f1a3b947e8
|
||||
F ext/jni/src/c/sqlite3-jni.h 3546b35d31fe3c13697edf3a3c35871941283de1d4f189154456ca61fd1282f6
|
||||
F ext/jni/src/c/sqlite3-jni.c 3bcb7998a5a9bf109e7da6b151a4dbe612791fe9c6792ef4b95bbfe8a0144854
|
||||
F ext/jni/src/c/sqlite3-jni.h 383a357c8920e05ea2b6ca7f9548ee04a263319f018ef3daeeaa719727be8b72
|
||||
F ext/jni/src/org/sqlite/jni/AbstractCollationCallback.java 95e88ba04f4aac51ffec65693e878e234088b2f21b387f4e4285c8b72b33e436
|
||||
F ext/jni/src/org/sqlite/jni/AggregateFunction.java 7312486bc65fecdb91753c0a4515799194e031f45edbe16a6373cea18f404dc4
|
||||
F ext/jni/src/org/sqlite/jni/AuthorizerCallback.java e6135be32f12bf140bffa39be7fd1a45ad83b2661ed49c08dbde04c8485feb38
|
||||
F ext/jni/src/org/sqlite/jni/AutoExtensionCallback.java 5e4a75611c026730289d776469d6122cb2699d6970af5f53fe85e74d49930476
|
||||
F ext/jni/src/org/sqlite/jni/BusyHandlerCallback.java d316373b12b3bf1a421f1f7eed08128fa8dd52bb98617ba28c161aaabd71d1ee
|
||||
F ext/jni/src/org/sqlite/jni/CallbackProxy.java 064a8a00e4c63cc501c30504f93ca996d422c5f010067f969b2d0a10f0868153 w ext/jni/src/org/sqlite/jni/SQLite3CallbackProxy.java
|
||||
F ext/jni/src/org/sqlite/jni/CallbackProxy.java 064a8a00e4c63cc501c30504f93ca996d422c5f010067f969b2d0a10f0868153
|
||||
F ext/jni/src/org/sqlite/jni/CollationCallback.java df327348e1a34ee65210208d694d690e5ee0bfe901410122e07caf6c98b2b7c8
|
||||
F ext/jni/src/org/sqlite/jni/CollationNeededCallback.java 07df5fa161a0b81154295258037f662e7c372735c2899c76e81cb3abd9fd3b39
|
||||
F ext/jni/src/org/sqlite/jni/CommitHookCallback.java 77cf8bb4f5548113e9792978f3f8a454614f420fa0ad73939421cbff4e7776f2
|
||||
@ -262,17 +262,17 @@ F ext/jni/src/org/sqlite/jni/ProgressHandlerCallback.java 7b9ff2218129ece98ba60c
|
||||
F ext/jni/src/org/sqlite/jni/ResultCode.java ba701f20213a5f259e94cfbfdd36eb7ac7ce7797f2c6c7fca2004ff12ce20f86
|
||||
F ext/jni/src/org/sqlite/jni/RollbackHookCallback.java d12352c0e22840de484ffa9b11ed5058bb0daca2e9f218055d3c54c947a273c4
|
||||
F ext/jni/src/org/sqlite/jni/SQLFunction.java 544a875d33fd160467d82e2397ac33157b29971d715a821a4fad3c899113ee8c
|
||||
F ext/jni/src/org/sqlite/jni/SQLite3Jni.java af43be2c0795e22ca489d9237697cf743a9338860ba937ea689cd1810bf737ee
|
||||
F ext/jni/src/org/sqlite/jni/SQLite3Jni.java 5a05c67b994d3f431d61203ab1de842d49491714e78cf99ccd5aa5257b66e9ff
|
||||
F ext/jni/src/org/sqlite/jni/ScalarFunction.java 6d387bb499fbe3bc13c53315335233dbf6a0c711e8fa7c521683219b041c614c
|
||||
F ext/jni/src/org/sqlite/jni/TableColumnMetadata.java 54511b4297fa28dcb3f49b24035e34ced10e3fd44fd0e458e784f4d6b0096dab
|
||||
F ext/jni/src/org/sqlite/jni/Tester1.java 3de9259606b40576e8a87dd28b228bbd077cccb518afec101246a14acd258c5f
|
||||
F ext/jni/src/org/sqlite/jni/Tester1.java 95fd3d3c0068cd7ebf2e89bb7db16fba541e6cf872f64f08c1e1350f6585682b
|
||||
F ext/jni/src/org/sqlite/jni/TesterFts5.java 6f135c60e24c89e8eecb9fe61dde0f3bb2906de668ca6c9186bcf34bdaf94629
|
||||
F ext/jni/src/org/sqlite/jni/TraceV2Callback.java beb0b064c1a5f8bfe585a324ed39a4e33edbe379a3fc60f1401661620d3ca7c0
|
||||
F ext/jni/src/org/sqlite/jni/UpdateHookCallback.java 8376f4a931f2d5612b295c003c9515ba933ee76d8f95610e89c339727376e36c
|
||||
F ext/jni/src/org/sqlite/jni/ValueHolder.java f022873abaabf64f3dd71ab0d6037c6e71cece3b8819fa10bf26a5461dc973ee
|
||||
F ext/jni/src/org/sqlite/jni/WindowFunction.java 488980f4dbb6bdd7067d6cb9c43e4075475e51c54d9b74a5834422654b126246
|
||||
F ext/jni/src/org/sqlite/jni/XDestroyCallback.java 50c5ca124ef6c6b735a7e136e7a23a557be367e61b56d4aab5777a614ab46cc2
|
||||
F ext/jni/src/org/sqlite/jni/annotation/Canonical.java e55b82c8259b617ff754ac493fd8b79602631d659b87a858b987540e4c4fdf56
|
||||
F ext/jni/src/org/sqlite/jni/annotation/Canonical.java ff9fc59004303d8ef89c516ede9ef5f51c881e9c9ba982f0ebb1bdd9a18550bc
|
||||
F ext/jni/src/org/sqlite/jni/annotation/NotNull.java d48ebd7ae6bbb78bd47d54431c85e1521c89b1d3864a2b6eafd9c0e1b2341457
|
||||
F ext/jni/src/org/sqlite/jni/annotation/Nullable.java 6f962a98c9a5c6e9d21c50ae8716b16bdfdc934a191608cbb7e12ea588ddb6af
|
||||
F ext/jni/src/org/sqlite/jni/annotation/package-info.java f66bfb621c6494e67c03ed38a9e26a3bd6af99b9f9f6ef79556bcec30a025a22
|
||||
@ -2116,8 +2116,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93
|
||||
F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc
|
||||
F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e
|
||||
F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0
|
||||
P 208b786afe16eafaf0ce791f319a5e05f733a7b71ce1c542e1b83481b013ec38
|
||||
R 2b0398aeaa0204ef877d7a162bfccfd2
|
||||
P d086b7844cace5c997261c97565aeef62aaeeef727ccc7e83f17c54d6217b779
|
||||
R d90a7f8c26c47365fc18117debd88806
|
||||
U stephan
|
||||
Z 4d9595c68497abda167c9e1929e109f6
|
||||
Z f88fe35f4fec8f41c283d1006f7f6aa6
|
||||
# Remove this line to create a well-formed Fossil manifest.
|
||||
|
@ -1 +1 @@
|
||||
d086b7844cace5c997261c97565aeef62aaeeef727ccc7e83f17c54d6217b779
|
||||
5fe5b0a585dbfa06cfca1fea40aea5ea3ccfe8295f41306ad2d5b851ace27203
|
Loading…
Reference in New Issue
Block a user