mirror of
https://github.com/tursodatabase/limbo.git
synced 2025-12-23 08:21:09 +00:00
Fix bug with column being considered rowid alias based on 'primary_key'
This commit is contained in:
parent
925bd62cbc
commit
b062a5f528
1 changed files with 3 additions and 3 deletions
|
|
@ -113,18 +113,18 @@ pub fn bind_column_references(
|
|||
crate::bail_parse_error!("Column {} is ambiguous", id.0);
|
||||
}
|
||||
let col = table.columns().get(col_idx.unwrap()).unwrap();
|
||||
match_result = Some((tbl_idx, col_idx.unwrap(), col.primary_key));
|
||||
match_result = Some((tbl_idx, col_idx.unwrap(), col.is_rowid_alias));
|
||||
}
|
||||
}
|
||||
if match_result.is_none() {
|
||||
crate::bail_parse_error!("Column {} not found", id.0);
|
||||
}
|
||||
let (tbl_idx, col_idx, is_primary_key) = match_result.unwrap();
|
||||
let (tbl_idx, col_idx, is_rowid_alias) = match_result.unwrap();
|
||||
*expr = ast::Expr::Column {
|
||||
database: None, // TODO: support different databases
|
||||
table: tbl_idx,
|
||||
column: col_idx,
|
||||
is_rowid_alias: is_primary_key,
|
||||
is_rowid_alias,
|
||||
};
|
||||
Ok(())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue