System.Data.SQLite

Check-in [afeca954f4]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Add 'interopError' function to the SQLite interop assembly.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: afeca954f488db6cc4980e46baf05ead69bff916
User & Date: mistachkin 2018-02-08 00:43:02.352
Context
2018-02-08
00:50
Override the System.Object members for the SQLiteException class to improve its ToString return value. Pursuant to [53962f9eff]. check-in: 37dcaf8f5d user: mistachkin tags: trunk
00:43
Add 'interopError' function to the SQLite interop assembly. check-in: afeca954f4 user: mistachkin tags: trunk
00:38
Add new error codes from the SQLite core library. check-in: 3e8430b58b user: mistachkin tags: trunk
Changes
Unified Diff Ignore Whitespace Patch
Changes to SQLite.Interop/src/generic/interop.c.
1149
1150
1151
1152
1153
1154
1155


















1156
1157
1158
1159
1160
1161
1162
#if defined(INTEROP_TEST_EXTENSION)
#if !SQLITE_OS_WIN
#include <unistd.h>
#endif

#include "../core/sqlite3ext.h"
SQLITE_EXTENSION_INIT1



















/*
** The interopTest() SQL function returns its first argument or raises an
** error if there are not enough arguments.
*/
SQLITE_PRIVATE void interopTestFunc(
  sqlite3_context *context,







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
#if defined(INTEROP_TEST_EXTENSION)
#if !SQLITE_OS_WIN
#include <unistd.h>
#endif

#include "../core/sqlite3ext.h"
SQLITE_EXTENSION_INIT1

/*
** The interopError() SQL function treats its first argument as an integer
** error code to return.
*/
SQLITE_PRIVATE void interopErrorFunc(
  sqlite3_context *context,
  int argc,
  sqlite3_value **argv
){
  int rc;
  if( argc!=1 ){
    sqlite3_result_error(context, "need exactly one argument", -1);
    return;
  }
  rc = sqlite3_value_int(argv[0]);
  sqlite3_result_error_code(context, rc);
}

/*
** The interopTest() SQL function returns its first argument or raises an
** error if there are not enough arguments.
*/
SQLITE_PRIVATE void interopTestFunc(
  sqlite3_context *context,
1215
1216
1217
1218
1219
1220
1221



1222
1223

1224
1225
1226
1227
1228
1229
1230
SQLITE_API int interop_test_extension_init(
  sqlite3 *db,
  char **pzErrMsg,
  const sqlite3_api_routines *pApi
){
  int rc;
  SQLITE_EXTENSION_INIT2(pApi)



  rc = sqlite3_create_function(db, "interopTest", -1, SQLITE_ANY, 0,
      interopTestFunc, 0, 0);

  if( rc==SQLITE_OK ){
    rc = sqlite3_create_function(db, "interopSleep", 1, SQLITE_ANY, 0,
        interopSleepFunc, 0, 0);
  }
  return rc;
}
#endif /* SQLITE_OS_WIN */







>
>
>
|
|
>







1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
SQLITE_API int interop_test_extension_init(
  sqlite3 *db,
  char **pzErrMsg,
  const sqlite3_api_routines *pApi
){
  int rc;
  SQLITE_EXTENSION_INIT2(pApi)
  rc = sqlite3_create_function(db, "interopError", -1, SQLITE_ANY, 0,
      interopErrorFunc, 0, 0);
  if( rc==SQLITE_OK ){
    rc = sqlite3_create_function(db, "interopTest", -1, SQLITE_ANY, 0,
        interopTestFunc, 0, 0);
  }
  if( rc==SQLITE_OK ){
    rc = sqlite3_create_function(db, "interopSleep", 1, SQLITE_ANY, 0,
        interopSleepFunc, 0, 0);
  }
  return rc;
}
#endif /* SQLITE_OS_WIN */