Skip to content

Mysql: Add SRID column option #1852

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

MohamedAbdeen21
Copy link
Contributor

Add support for Mysql geometric SRID {int} column option in create table statements.

@MohamedAbdeen21
Copy link
Contributor Author

MohamedAbdeen21 commented May 15, 2025

I give up on the CI. I understand the error, but idk why it's showing specifically on this PR.

Clippy passes locally, I guess that the CI doesn't use a fixed cargo/clippy version, and that these warnings were introduced recently.

Edit: Yup, can see a toolchain update was introduced today. Pulling that and running Clippy shows the same warnings ...
Edit 2: Trying to fix the 30 smth errors. This will be a big API change where many fields will be wrapped in Box and hundreds of tests will be updated. Can we just ignore these size warnings and fix the other 2?

Comment on lines +16579 to +16593
fn test_mysql_srid_create_table() {
let sql = r#"CREATE TABLE t (a geometry SRID 4326)"#;
let ast: Vec<Statement> = Parser::parse_sql(&MySqlDialect {}, sql).unwrap();

assert_eq!(ast.len(), 1);
if let Statement::CreateTable(v) = &ast[0] {
assert_eq!(
v.columns[0].options[0].option,
ColumnOption::Srid(Box::new(Expr::value(Value::Number(
"4326".parse().unwrap(),
false
))))
);
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we instead extend one of the create table tests in either common or mysql tests file? (essentially this test ideally would live in one of those files I think)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants