1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

JNI: rename sqlite3_errmsg16() to sqlite3_errmsg(), as the 16 suffix is superfluous there.

FossilOrigin-Name: df25b21689de84b7b8c940df39461d3d88f592f0ba2dddcfcbb0bebcea6ee7da
This commit is contained in:
stephan
2023-09-30 14:48:21 +00:00
parent 0018ef15a3
commit 41c6232e54
8 changed files with 25 additions and 25 deletions

View File

@ -3359,7 +3359,7 @@ S3JniApi(sqlite3_errcode(),jint,1errcode)(
return pDb ? sqlite3_errcode(pDb) : SQLITE_MISUSE;
}
S3JniApi(sqlite3_errmsg16(),jstring,1errmsg16)(
S3JniApi(sqlite3_errmsg(),jstring,1errmsg)(
JniArgsEnvClass, jobject jpDb
){
sqlite3 * const pDb = PtrGet_sqlite3(jpDb);

View File

@ -1349,10 +1349,10 @@ JNIEXPORT jint JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1errcode
/*
* Class: org_sqlite_jni_SQLite3Jni
* Method: sqlite3_errmsg16
* Method: sqlite3_errmsg
* Signature: (Lorg/sqlite/jni/sqlite3;)Ljava/lang/String;
*/
JNIEXPORT jstring JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1errmsg16
JNIEXPORT jstring JNICALL Java_org_sqlite_jni_SQLite3Jni_sqlite3_1errmsg
(JNIEnv *, jclass, jobject);
/*

View File

@ -68,7 +68,7 @@ class SQLTesterException extends RuntimeException {
class DbException extends SQLTesterException {
DbException(sqlite3 db, int rc, boolean closeDb){
super("DB error #"+rc+": "+sqlite3_errmsg16(db),true);
super("DB error #"+rc+": "+sqlite3_errmsg(db),true);
if( closeDb ) sqlite3_close_v2(db);
}
DbException(sqlite3 db, int rc){
@ -458,7 +458,7 @@ public class SQLTester {
private void appendDbErr(sqlite3 db, StringBuilder sb, int rc){
sb.append(org.sqlite.jni.ResultCode.getEntryForInt(rc)).append(' ');
final String msg = escapeSqlValue(sqlite3_errmsg16(db));
final String msg = escapeSqlValue(sqlite3_errmsg(db));
if( '{' == msg.charAt(0) ){
sb.append(msg);
}else{
@ -932,7 +932,7 @@ class RunCommand extends Command {
final int rc = t.execSql(db, false, ResultBufferMode.NONE,
ResultRowMode.ONELINE, sql);
if( 0!=rc && t.isVerbose() ){
String msg = sqlite3_errmsg16(db);
String msg = sqlite3_errmsg(db);
ts.verbose1(argv[0]," non-fatal command error #",rc,": ",
msg,"\nfor SQL:\n",sql);
}

View File

@ -940,7 +940,7 @@ final class SQLite3Jni {
public static native int sqlite3_errcode(@NotNull sqlite3 db);
@Canonical
public static native String sqlite3_errmsg16(@NotNull sqlite3 db);
public static native String sqlite3_errmsg(@NotNull sqlite3 db);
@Canonical
public static native int sqlite3_error_offset(@NotNull long ptrToDb);

View File

@ -146,7 +146,7 @@ public class Tester1 implements Runnable {
sqlite3 db = out.take();
if( 0!=rc ){
final String msg =
null==db ? sqlite3_errstr(rc) : sqlite3_errmsg16(db);
null==db ? sqlite3_errstr(rc) : sqlite3_errmsg(db);
sqlite3_close(db);
throw new RuntimeException("Opening db failed: "+msg);
}
@ -197,7 +197,7 @@ public class Tester1 implements Runnable {
if(SQLITE_ROW==rc || SQLITE_DONE==rc) rc = 0;
if( 0!=rc && throwOnError){
throw new RuntimeException("db op failed with rc="
+rc+": "+sqlite3_errmsg16(db));
+rc+": "+sqlite3_errmsg(db));
}
return rc;
}
@ -343,7 +343,7 @@ public class Tester1 implements Runnable {
stmt = sqlite3_prepare(db, "intentional error");
affirm( null==stmt );
affirm( 0!=sqlite3_errcode(db) );
affirm( 0==sqlite3_errmsg16(db).indexOf("near \"intentional\"") );
affirm( 0==sqlite3_errmsg(db).indexOf("near \"intentional\"") );
sqlite3_finalize(stmt);
stmt = sqlite3_prepare(db, "/* empty input*/\n-- comments only");
affirm( null==stmt );
@ -736,7 +736,7 @@ public class Tester1 implements Runnable {
rc = sqlite3_step(stmt);
sqlite3_finalize(stmt);
affirm( 0 != rc );
affirm( sqlite3_errmsg16(db).indexOf("an xFinal") > 0 );
affirm( sqlite3_errmsg(db).indexOf("an xFinal") > 0 );
SQLFunction funcSc = new ScalarFunction(){
@Override public void xFunc(sqlite3_context cx, sqlite3_value[] args){
@ -750,7 +750,7 @@ public class Tester1 implements Runnable {
rc = sqlite3_step(stmt);
sqlite3_finalize(stmt);
affirm( 0 != rc );
affirm( sqlite3_errmsg16(db).indexOf("an xFunc") > 0 );
affirm( sqlite3_errmsg(db).indexOf("an xFunc") > 0 );
rc = sqlite3_create_function(db, "mysca", 1, -1, funcSc);
affirm( SQLITE_FORMAT==rc, "invalid encoding value." );
sqlite3_close_v2(db);

View File

@ -104,7 +104,7 @@ public class TesterFts5 {
}
});
if( rc!=SQLITE_OK ){
throw new RuntimeException(sqlite3_errmsg16(db));
throw new RuntimeException(sqlite3_errmsg(db));
}
/* Convert to array and return */