block UPDATEs on partition key values for now

This commit is contained in:
Alex Garcia 2024-11-13 12:59:54 -08:00
parent 21b11e1e83
commit 03f29d581d
3 changed files with 60 additions and 3 deletions

View file

@ -215,3 +215,31 @@
}),
})
# ---
# name: test_updates[1. Initial dataset]
OrderedDict({
'sql': 'select * from v',
'rows': list([
OrderedDict({
'rowid': 1,
'p': 'a',
'a': b'\x11\x11\x11\x11',
}),
OrderedDict({
'rowid': 2,
'p': 'a',
'a': b'""""',
}),
OrderedDict({
'rowid': 3,
'p': 'a',
'a': b'3333',
}),
]),
})
# ---
# name: test_updates[2. update #1]
dict({
'error': 'OperationalError',
'message': 'UPDATE on partition key columns are not supported yet. ',
})
# ---

View file

@ -53,6 +53,27 @@ def test_types(db, snapshot):
)
def test_updates(db, snapshot):
db.execute(
"create virtual table v using vec0(p text partition key, a float[1], chunk_size=8)"
)
db.execute(
"insert into v(rowid, p, a) values (?, ?, ?)", [1, "a", b"\x11\x11\x11\x11"]
)
db.execute(
"insert into v(rowid, p, a) values (?, ?, ?)", [2, "a", b"\x22\x22\x22\x22"]
)
db.execute(
"insert into v(rowid, p, a) values (?, ?, ?)", [3, "a", b"\x33\x33\x33\x33"]
)
assert exec(db, "select * from v") == snapshot(name="1. Initial dataset")
assert exec(db, "update v set p = ? where rowid = ?", ["new", 1]) == snapshot(
name="2. update #1"
)
class Row:
def __init__(self):
pass