Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
N
node-sqlite3
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
俞永鹏
node-sqlite3
Commits
debc81b4
Commit
debc81b4
authored
Feb 21, 2011
by
Konstantin Käfer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
correctly check bind arguments
parent
92d0e9c9
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
3 deletions
+17
-3
macros.h
src/macros.h
+2
-0
statement.cc
src/statement.cc
+15
-3
No files found.
src/macros.h
View file @
debc81b4
...
@@ -136,6 +136,8 @@ const char* sqlite_code_string(int code);
...
@@ -136,6 +136,8 @@ const char* sqlite_code_string(int code);
static int EIO_After##name(eio_req *req);
static int EIO_After##name(eio_req *req);
#define STATEMENT_BEGIN(type) \
#define STATEMENT_BEGIN(type) \
assert(baton); \
assert(baton->stmt); \
assert(!baton->stmt->locked); \
assert(!baton->stmt->locked); \
assert(!baton->stmt->finalized); \
assert(!baton->stmt->finalized); \
assert(baton->stmt->prepared); \
assert(baton->stmt->prepared); \
...
...
src/statement.cc
View file @
debc81b4
...
@@ -302,9 +302,13 @@ Handle<Value> Statement::Get(const Arguments& args) {
...
@@ -302,9 +302,13 @@ Handle<Value> Statement::Get(const Arguments& args) {
Statement
*
stmt
=
ObjectWrap
::
Unwrap
<
Statement
>
(
args
.
This
());
Statement
*
stmt
=
ObjectWrap
::
Unwrap
<
Statement
>
(
args
.
This
());
Baton
*
baton
=
stmt
->
Bind
<
RowBaton
>
(
args
);
Baton
*
baton
=
stmt
->
Bind
<
RowBaton
>
(
args
);
if
(
baton
==
NULL
)
{
return
ThrowException
(
Exception
::
Error
(
String
::
New
(
"Data type is not supported"
)));
}
else
{
stmt
->
Schedule
(
EIO_BeginGet
,
baton
);
stmt
->
Schedule
(
EIO_BeginGet
,
baton
);
return
args
.
This
();
return
args
.
This
();
}
}
}
void
Statement
::
EIO_BeginGet
(
Baton
*
baton
)
{
void
Statement
::
EIO_BeginGet
(
Baton
*
baton
)
{
...
@@ -368,9 +372,13 @@ Handle<Value> Statement::Run(const Arguments& args) {
...
@@ -368,9 +372,13 @@ Handle<Value> Statement::Run(const Arguments& args) {
Statement
*
stmt
=
ObjectWrap
::
Unwrap
<
Statement
>
(
args
.
This
());
Statement
*
stmt
=
ObjectWrap
::
Unwrap
<
Statement
>
(
args
.
This
());
Baton
*
baton
=
stmt
->
Bind
<
Baton
>
(
args
);
Baton
*
baton
=
stmt
->
Bind
<
Baton
>
(
args
);
if
(
baton
==
NULL
)
{
return
ThrowException
(
Exception
::
Error
(
String
::
New
(
"Data type is not supported"
)));
}
else
{
stmt
->
Schedule
(
EIO_BeginRun
,
baton
);
stmt
->
Schedule
(
EIO_BeginRun
,
baton
);
return
args
.
This
();
return
args
.
This
();
}
}
}
void
Statement
::
EIO_BeginRun
(
Baton
*
baton
)
{
void
Statement
::
EIO_BeginRun
(
Baton
*
baton
)
{
...
@@ -425,9 +433,13 @@ Handle<Value> Statement::All(const Arguments& args) {
...
@@ -425,9 +433,13 @@ Handle<Value> Statement::All(const Arguments& args) {
Statement
*
stmt
=
ObjectWrap
::
Unwrap
<
Statement
>
(
args
.
This
());
Statement
*
stmt
=
ObjectWrap
::
Unwrap
<
Statement
>
(
args
.
This
());
Baton
*
baton
=
stmt
->
Bind
<
RowsBaton
>
(
args
);
Baton
*
baton
=
stmt
->
Bind
<
RowsBaton
>
(
args
);
if
(
baton
==
NULL
)
{
return
ThrowException
(
Exception
::
Error
(
String
::
New
(
"Data type is not supported"
)));
}
else
{
stmt
->
Schedule
(
EIO_BeginAll
,
baton
);
stmt
->
Schedule
(
EIO_BeginAll
,
baton
);
return
args
.
This
();
return
args
.
This
();
}
}
}
void
Statement
::
EIO_BeginAll
(
Baton
*
baton
)
{
void
Statement
::
EIO_BeginAll
(
Baton
*
baton
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment