diff --git a/core/translate/expr.rs b/core/translate/expr.rs index b6207f9c7..e110523f3 100644 --- a/core/translate/expr.rs +++ b/core/translate/expr.rs @@ -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) diff --git a/testing/affinity.test b/testing/affinity.test index 9a08003cd..1c32d4e4d 100755 --- a/testing/affinity.test +++ b/testing/affinity.test @@ -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}