()
| 213 | |
| 214 | #[tokio::test] |
| 215 | async fn test_insert_select_with_decimal() { |
| 216 | let ctx = setup_test_db().await; |
| 217 | |
| 218 | // Create source data |
| 219 | ctx.execute( |
| 220 | "INSERT INTO accounts (id, name, balance, credit_limit) VALUES |
| 221 | (1, 'Source', '1000.00', '5000.00')" |
| 222 | ).await.unwrap(); |
| 223 | |
| 224 | // Insert with calculations |
| 225 | let result = ctx.execute( |
| 226 | "INSERT INTO accounts (name, balance, credit_limit) |
| 227 | SELECT name || '_copy', balance * 0.5, credit_limit * 0.5 |
| 228 | FROM accounts WHERE id = 1" |
| 229 | ).await.unwrap(); |
| 230 | |
| 231 | assert_eq!(result.rows_affected, 1); |
| 232 | |
| 233 | // Verify the insert |
| 234 | let result = ctx.query("SELECT COUNT(*) FROM accounts").await.unwrap(); |
| 235 | assert_eq!(result.rows.len(), 1); |
| 236 | } |
| 237 | |
| 238 | #[tokio::test] |
| 239 | async fn test_decimal_precision_preservation() { |
nothing calls this directly
no test coverage detected