Commit 741d37c3 authored by gwenn's avatar gwenn

Introduce changes made in SQLite 3.7.16 and 3.7.17.

parent 9fee036f
......@@ -69,6 +69,6 @@ func TestBlobMisuse(t *testing.T) {
bw, err := db.NewBlobReadWriter("main", "test", "content", 0)
assert(t, "error expected", bw == nil && err != nil)
//println(err.Error())
err = bw.Close()
assert(t, "error expected", err != nil)
/*err = bw.Close()
assert(t, "error expected", err != nil)*/
}
......@@ -89,7 +89,7 @@ type Column struct {
DataType string
NotNull bool
DfltValue string // FIXME type ?
Pk bool
Pk int
Autoinc bool
CollSeq string
}
......@@ -145,7 +145,7 @@ func (c *Conn) Column(dbName, tableName, columnName string) (*Column, error) {
return nil, c.error(rv, fmt.Sprintf("Conn.Column(db: %q, tbl: %q, col: %q)", dbName, tableName, columnName))
}
// TODO How to avoid copy?
return &Column{-1, columnName, C.GoString(zDataType), notNull == 1, "", primaryKey == 1,
return &Column{-1, columnName, C.GoString(zDataType), notNull == 1, "", int(primaryKey),
autoinc == 1, C.GoString(zCollSeq)}, nil
}
......
......@@ -68,7 +68,7 @@ func TestColumn(t *testing.T) {
column, err := db.Column("", "test", "id")
checkNoError(t, err, "error getting column metadata: %s")
assertEquals(t, "wrong column name: %q <> %q", "id", column.Name)
assert(t, "expecting primary key flag to be true", column.Pk)
assertEquals(t, "wrong primary key index: %d <> %d", 1, column.Pk)
assert(t, "expecting autoinc flag to be false", !column.Autoinc)
column, err = db.Column("main", "test", "id")
......
......@@ -101,6 +101,8 @@ const (
ErrFormat = Errno(C.SQLITE_FORMAT) /* Auxiliary database format error */
ErrRange = Errno(C.SQLITE_RANGE) /* 2nd parameter to sqlite3_bind out of range */
ErrNotDB = Errno(C.SQLITE_NOTADB) /* File opened that is not a database file */
Notice = Errno(C.SQLITE_NOTICE) /* Notifications from sqlite3_log() */
Warning = Errno(C.SQLITE_WARNING) /* Warnings from sqlite3_log() */
Row = Errno(C.SQLITE_ROW) /* sqlite3_step() has another row ready */
Done = Errno(C.SQLITE_DONE) /* sqlite3_step() has finished executing */
ErrSpecific = Errno(-1) /* Wrapper specific error */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment