Skip to content
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

db schemes - db_unixodbc, usrloc: MariaDB partition is a reserved word and not quoted #3742

Closed
space88man opened this issue Feb 2, 2024 · 4 comments

Comments

@space88man
Copy link
Contributor

space88man commented Feb 2, 2024

Description

partition is now a reserved word in MariaDB 10.
the column name is correctly quoted with native libmysqlclient/libmariadb so works

the column name is not quoted with unixodbc+(libmyodbc8|libmaodbc) and so fails

unixodbc will fail when enabled for registrar / usrloc

Troubleshooting

try unquoted insert

-- fails unixodbc+libmaodbc
insert into location (partition) values (1000);

-- works native libmysqlclient|libmariadb
insert into location (`partition`) values (1000);

Reproduction

  1. config enable usrloc / registrar with unixodbc + MySQL/MariaDB connector

Debugging Data

SQL insert into statement fails

@space88man space88man changed the title db_unixodbc: MariaDB partition is a reserved word and not quoted db_unixodbc, usrloc: MariaDB partition is a reserved word and not quoted Feb 2, 2024
@henningw henningw changed the title db_unixodbc, usrloc: MariaDB partition is a reserved word and not quoted db schemes - db_unixodbc, usrloc: MariaDB partition is a reserved word and not quoted Feb 2, 2024
@space88man
Copy link
Contributor Author

Technically can be solved using unixodbc quote_char param ; but we could consider renaming partition

@henningw
Copy link
Contributor

henningw commented Feb 2, 2024

Thanks for the report, I will take care of it. Probably its easier to use the same approach as for the mysql/mariadb, just quote it. Otherwise all the people need to change their databases at upgrade.

@miconda
Copy link
Member

miconda commented Feb 2, 2024

The quote_char param has this role, it is hard to avoid all keywords on various databases and changing the schema is not really recommended, in the future there can be other keywords that will conflict with existing names.

The only constraint is that all DBs used with db_unixodbc at the same time have to support same quoting character. A possible enhancement here would be to be able to specify the quoting char via the db url.

@space88man
Copy link
Contributor Author

Thanks @miconda - closing now as not a bug.

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

No branches or pull requests

3 participants