Commit 90ebb789 authored by gwenn's avatar gwenn

Test all expressions have no type affinity.

parent 9c0a2fe0
......@@ -205,3 +205,17 @@ func TestColumnTypeAffinity(t *testing.T) {
assert.Equal(t, Textual, s.ColumnTypeAffinity(4), "affinity")
assert.Equal(t, None, s.ColumnTypeAffinity(5), "affinity")
}
func TestExpressionTypeAffinity(t *testing.T) {
db := open(t)
defer checkClose(db, t)
checkNoError(t, db.FastExec("CREATE TABLE test (i INT, f REAL, n NUM, b BLOB, t TEXT, v);"), "%s")
s, err := db.Prepare("SELECT abs(i), f * 2, n / 2, lower(t) FROM test")
checkNoError(t, err, "%s")
defer checkFinalize(s, t)
assert.Equal(t, None, s.ColumnTypeAffinity(0), "affinity")
assert.Equal(t, None, s.ColumnTypeAffinity(1), "affinity")
assert.Equal(t, None, s.ColumnTypeAffinity(2), "affinity")
assert.Equal(t, None, s.ColumnTypeAffinity(3), "affinity")
}
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