mirror of
https://github.com/aljazceru/turso.git
synced 2025-12-28 13:34:24 +01:00
Merge 'core/translate: fix rowid affinity' from Preston Thorpe
closes https://github.com/tursodatabase/turso/issues/3478 Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com> Closes #3539
This commit is contained in:
@@ -3761,6 +3761,7 @@ pub fn get_expr_affinity(
|
||||
}
|
||||
Affinity::Blob
|
||||
}
|
||||
ast::Expr::RowId { .. } => Affinity::Integer,
|
||||
ast::Expr::Cast { type_name, .. } => {
|
||||
if let Some(type_name) = type_name {
|
||||
crate::schema::affinity(&type_name.name)
|
||||
|
||||
@@ -12,3 +12,11 @@ do_execsql_test_on_specific_db {:memory:} affinity {
|
||||
{1|integer}
|
||||
{1a|text}
|
||||
}
|
||||
|
||||
do_execsql_test_on_specific_db {:memory:} affinity-rowid {
|
||||
create table t(a integer);
|
||||
insert into t(rowid, a) values (1, 1);
|
||||
select * from t where rowid = '1';
|
||||
select * from t where a = '1';
|
||||
} {1
|
||||
1}
|
||||
|
||||
Reference in New Issue
Block a user