Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gosqlite
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
gosqlite
Commits
6c1f9b97
Commit
6c1f9b97
authored
Dec 19, 2011
by
gwenn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix ScanText and ScanBlob which don't actually return any error.
parent
909044b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
8 deletions
+7
-8
sqlite.go
sqlite.go
+7
-8
No files found.
sqlite.go
View file @
6c1f9b97
...
...
@@ -832,7 +832,7 @@ func (s *Stmt) ScanByIndex(index int, value interface{}) (bool, error) {
switch
value
:=
value
.
(
type
)
{
case
nil
:
case
*
string
:
*
value
,
isNull
,
err
=
s
.
ScanText
(
index
)
*
value
,
isNull
=
s
.
ScanText
(
index
)
case
*
int
:
*
value
,
isNull
,
err
=
s
.
ScanInt
(
index
)
case
*
int64
:
...
...
@@ -844,7 +844,7 @@ func (s *Stmt) ScanByIndex(index int, value interface{}) (bool, error) {
case
*
float64
:
*
value
,
isNull
,
err
=
s
.
ScanFloat64
(
index
)
case
*
[]
byte
:
*
value
,
isNull
,
err
=
s
.
ScanBlob
(
index
)
*
value
,
isNull
=
s
.
ScanBlob
(
index
)
case
*
interface
{}
:
*
value
=
s
.
ScanValue
(
index
)
isNull
=
*
value
==
nil
...
...
@@ -891,7 +891,7 @@ func (s *Stmt) ScanValue(index int) (value interface{}) {
// Returns true when column is null.
// Calls sqlite3_column_text.
// http://sqlite.org/c3ref/column_blob.html
func
(
s
*
Stmt
)
ScanText
(
index
int
)
(
value
string
,
isNull
bool
,
err
error
)
{
func
(
s
*
Stmt
)
ScanText
(
index
int
)
(
value
string
,
isNull
bool
)
{
p
:=
C
.
sqlite3_column_text
(
s
.
stmt
,
C
.
int
(
index
))
if
p
==
nil
{
isNull
=
true
...
...
@@ -1006,7 +1006,7 @@ func (s *Stmt) ScanFloat64(index int) (value float64, isNull bool, err error) {
// Returns true when column is null.
// Calls sqlite3_column_bytes.
// http://sqlite.org/c3ref/column_blob.html
func
(
s
*
Stmt
)
ScanBlob
(
index
int
)
(
value
[]
byte
,
isNull
bool
,
err
error
)
{
func
(
s
*
Stmt
)
ScanBlob
(
index
int
)
(
value
[]
byte
,
isNull
bool
)
{
p
:=
C
.
sqlite3_column_blob
(
s
.
stmt
,
C
.
int
(
index
))
if
p
==
nil
{
isNull
=
true
...
...
@@ -1140,10 +1140,9 @@ func (c *Conn) IntegrityCheck(max int, quick bool) error {
if
!
ok
{
return
errors
.
New
(
"Integrity check failed (no result)"
)
}
var
msg
string
err
=
s
.
Scan
(
&
msg
)
if
err
!=
nil
{
return
err
msg
,
null
:=
s
.
ScanText
(
0
)
if
null
{
return
errors
.
New
(
"Integrity check failed (null result)"
)
}
if
msg
!=
"ok"
{
return
errors
.
New
(
msg
)
...
...
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