()
| 465 | |
| 466 | #[test] |
| 467 | fn ts_rank_cd_is_unsupported() { |
| 468 | use crate::parser::statement::parse_sql; |
| 469 | let sql = "SELECT ts_rank_cd(body, to_tsquery('rust')) FROM t"; |
| 470 | let stmts = parse_sql(sql).expect("parse ok"); |
| 471 | let Statement::Query(q) = &stmts[0] else { |
| 472 | panic!("expected query"); |
| 473 | }; |
| 474 | let sqlparser::ast::SetExpr::Select(sel) = q.body.as_ref() else { |
| 475 | panic!("expected select body"); |
| 476 | }; |
| 477 | let raw = match &sel.projection[0] { |
| 478 | SelectItem::UnnamedExpr(e) => e, |
| 479 | SelectItem::ExprWithAlias { expr, .. } => expr, |
| 480 | other => panic!("unexpected projection: {other:?}"), |
| 481 | }; |
| 482 | let err = convert_expr(raw).unwrap_err(); |
| 483 | assert!( |
| 484 | matches!(err, SqlError::Unsupported { .. }), |
| 485 | "ts_rank_cd should be Unsupported, got {err:?}" |
| 486 | ); |
| 487 | let msg = format!("{err}"); |
| 488 | assert!( |
| 489 | msg.contains("ts_rank_cd"), |
| 490 | "error should mention ts_rank_cd: {msg}" |
| 491 | ); |
| 492 | } |
| 493 | |
| 494 | #[test] |
| 495 | fn to_tsquery_lowers_to_pg_to_tsquery() { |
nothing calls this directly
no test coverage detected