Explore Enterprise Education Gitee Premium Gitee AI AI teammates
Fetch the repository succeeded.
Create your Gitee Account
Explore and code with more than 14 million developers,Free private repositories !:)
Sign up
Already have an account? Sign in
文件
master
Branches (1397)
Tags (163)
master
unique-in-opt
vtab-limit-fix
compound-subquery-affinity
vector-in-fix
fts5-tokenize-blob
reuse-schema-3.45
bedrock
wal2
begin-concurrent
mistake
wal2-3.45
begin-concurrent-3.45
branch-3.45
branch-3.44
btree-ovfl-cache
pushdown-subquery
pushdown-IN-table
reuse-schema
branch-3.28
release
version-3.45.3
version-3.45.2
version-3.45.1
vesion-3.45.1
version-3.45.0
version-3.44.2
version-3.44.1
major-release
version-3.44.0
version-3.43.2
version-3.43.1
version-3.43.0
version-3.42.0
version-3.41.2
version-3.41.1
version-3.41.0
version-3.40.1
version-3.40.0
version-3.39.4
master
Branches (1397)
Tags (163)
master
unique-in-opt
vtab-limit-fix
compound-subquery-affinity
vector-in-fix
fts5-tokenize-blob
reuse-schema-3.45
bedrock
wal2
begin-concurrent
mistake
wal2-3.45
begin-concurrent-3.45
branch-3.45
branch-3.44
btree-ovfl-cache
pushdown-subquery
pushdown-IN-table
reuse-schema
branch-3.28
release
version-3.45.3
version-3.45.2
version-3.45.1
vesion-3.45.1
version-3.45.0
version-3.44.2
version-3.44.1
major-release
version-3.44.0
version-3.43.2
version-3.43.1
version-3.43.0
version-3.42.0
version-3.41.2
version-3.41.1
version-3.41.0
version-3.40.1
version-3.40.0
version-3.39.4
Clone or Download
Clone/Download
Prompt
To download the code, please copy the following command and execute it in the terminal
To ensure that your submitted code identity is correctly recognized by Gitee, please execute the following command.
When using the SSH protocol for the first time to clone or push code, follow the prompts below to complete the SSH configuration.
1 Generate RSA keys.
2 Obtain the content of the RSA public key and configure it in SSH Public Keys
To use SVN on Gitee, please visit the usage guide
When using the HTTPS protocol, the command line will prompt for account and password verification as follows. For security reasons, Gitee recommends configure and use personal access tokens instead of login passwords for cloning, pushing, and other operations.
Username for 'https://gitee.com': userName
Password for 'https://userName@gitee.com': # Private Token
master
Branches (1397)
Tags (163)
master
unique-in-opt
vtab-limit-fix
compound-subquery-affinity
vector-in-fix
fts5-tokenize-blob
reuse-schema-3.45
bedrock
wal2
begin-concurrent
mistake
wal2-3.45
begin-concurrent-3.45
branch-3.45
branch-3.44
btree-ovfl-cache
pushdown-subquery
pushdown-IN-table
reuse-schema
branch-3.28
release
version-3.45.3
version-3.45.2
version-3.45.1
vesion-3.45.1
version-3.45.0
version-3.44.2
version-3.44.1
major-release
version-3.44.0
version-3.43.2
version-3.43.1
version-3.43.0
version-3.42.0
version-3.41.2
version-3.41.1
version-3.41.0
version-3.40.1
version-3.40.0
version-3.39.4
sqlite
/
src
/
test9.c
sqlite
/
src
/
test9.c
test9.c 4.93 KB
Copy Edit Raw Blame History
mistachkin authored 2016年07月29日 01:11 +08:00 . Make sure the SQLITE_TCLAPI macro is always defined.
/*
** 2007 March 29
**
** The author disclaims copyright to this source code. In place of
** a legal notice, here is a blessing:
**
** May you do good and not evil.
** May you find forgiveness for yourself and forgive others.
** May you share freely, never taking more than you give.
**
*************************************************************************
**
** This file contains obscure tests of the C-interface required
** for completeness. Test code is written in C for these cases
** as there is not much point in binding to Tcl.
*/
#include "sqliteInt.h"
#if defined(INCLUDE_SQLITE_TCL_H)
# include "sqlite_tcl.h"
#else
# include "tcl.h"
#endif
#include <stdlib.h>
#include <string.h>
/*
** c_collation_test
*/
static int SQLITE_TCLAPI c_collation_test(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
Tcl_Obj *CONST objv[] /* Command arguments */
){
const char *zErrFunction = "N/A";
sqlite3 *db;
int rc;
if( objc!=1 ){
Tcl_WrongNumArgs(interp, 1, objv, "");
return TCL_ERROR;
}
/* Open a database. */
rc = sqlite3_open(":memory:", &db);
if( rc!=SQLITE_OK ){
zErrFunction = "sqlite3_open";
goto error_out;
}
rc = sqlite3_create_collation(db, "collate", 456, 0, 0);
if( rc!=SQLITE_MISUSE ){
sqlite3_close(db);
zErrFunction = "sqlite3_create_collation";
goto error_out;
}
sqlite3_close(db);
return TCL_OK;
error_out:
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "Error testing function: ", zErrFunction, 0);
return TCL_ERROR;
}
/*
** c_realloc_test
*/
static int SQLITE_TCLAPI c_realloc_test(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
Tcl_Obj *CONST objv[] /* Command arguments */
){
void *p;
const char *zErrFunction = "N/A";
if( objc!=1 ){
Tcl_WrongNumArgs(interp, 1, objv, "");
return TCL_ERROR;
}
p = sqlite3_malloc(5);
if( !p ){
zErrFunction = "sqlite3_malloc";
goto error_out;
}
/* Test that realloc()ing a block of memory to a negative size is
** the same as free()ing that memory.
*/
p = sqlite3_realloc(p, -1);
if( p ){
zErrFunction = "sqlite3_realloc";
goto error_out;
}
return TCL_OK;
error_out:
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "Error testing function: ", zErrFunction, 0);
return TCL_ERROR;
}
/*
** c_misuse_test
*/
static int SQLITE_TCLAPI c_misuse_test(
ClientData clientData, /* Pointer to sqlite3_enable_XXX function */
Tcl_Interp *interp, /* The TCL interpreter that invoked this command */
int objc, /* Number of arguments */
Tcl_Obj *CONST objv[] /* Command arguments */
){
const char *zErrFunction = "N/A";
sqlite3 *db = 0;
sqlite3_stmt *pStmt;
int rc;
if( objc!=1 ){
Tcl_WrongNumArgs(interp, 1, objv, "");
return TCL_ERROR;
}
/* Open a database. Then close it again. We need to do this so that
** we have a "closed database handle" to pass to various API functions.
*/
rc = sqlite3_open(":memory:", &db);
if( rc!=SQLITE_OK ){
zErrFunction = "sqlite3_open";
goto error_out;
}
sqlite3_close(db);
rc = sqlite3_errcode(db);
if( rc!=SQLITE_MISUSE ){
zErrFunction = "sqlite3_errcode";
goto error_out;
}
pStmt = (sqlite3_stmt*)1234;
rc = sqlite3_prepare(db, 0, 0, &pStmt, 0);
if( rc!=SQLITE_MISUSE ){
zErrFunction = "sqlite3_prepare";
goto error_out;
}
assert( pStmt==0 ); /* Verify that pStmt is zeroed even on a MISUSE error */
pStmt = (sqlite3_stmt*)1234;
rc = sqlite3_prepare_v2(db, 0, 0, &pStmt, 0);
if( rc!=SQLITE_MISUSE ){
zErrFunction = "sqlite3_prepare_v2";
goto error_out;
}
assert( pStmt==0 );
#ifndef SQLITE_OMIT_UTF16
pStmt = (sqlite3_stmt*)1234;
rc = sqlite3_prepare16(db, 0, 0, &pStmt, 0);
if( rc!=SQLITE_MISUSE ){
zErrFunction = "sqlite3_prepare16";
goto error_out;
}
assert( pStmt==0 );
pStmt = (sqlite3_stmt*)1234;
rc = sqlite3_prepare16_v2(db, 0, 0, &pStmt, 0);
if( rc!=SQLITE_MISUSE ){
zErrFunction = "sqlite3_prepare16_v2";
goto error_out;
}
assert( pStmt==0 );
#endif
return TCL_OK;
error_out:
Tcl_ResetResult(interp);
Tcl_AppendResult(interp, "Error testing function: ", zErrFunction, 0);
return TCL_ERROR;
}
/*
** Register commands with the TCL interpreter.
*/
int Sqlitetest9_Init(Tcl_Interp *interp){
static struct {
char *zName;
Tcl_ObjCmdProc *xProc;
void *clientData;
} aObjCmd[] = {
{ "c_misuse_test", c_misuse_test, 0 },
{ "c_realloc_test", c_realloc_test, 0 },
{ "c_collation_test", c_collation_test, 0 },
};
int i;
for(i=0; i<sizeof(aObjCmd)/sizeof(aObjCmd[0]); i++){
Tcl_CreateObjCommand(interp, aObjCmd[i].zName,
aObjCmd[i].xProc, aObjCmd[i].clientData, 0);
}
return TCL_OK;
}
Loading...
Report
Report success
We will send you the feedback within 2 working days through the letter!
Please fill in the reason for the report carefully. Provide as detailed a description as possible.
Please select a report type
Cancel
Send
误判申诉

此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。

如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。

取消
提交

About

fork from https://github.com/sqlite/sqlite.git
No labels
unknown license
unknown open source license
Cancel

Releases

No release

Contributors

All

Activities

can not load any more
Edit
About
Homepage
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/source-code-sync/sqlite.git
git@gitee.com:source-code-sync/sqlite.git
source-code-sync
sqlite
sqlite
master
Going to Help Center

Search

Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register

AltStyle によって変換されたページ (->オリジナル) /