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

mariadb timezone error with named timezones #10612

Closed
seally1186 opened this issue Mar 23, 2019 · 4 comments
Closed

mariadb timezone error with named timezones #10612

seally1186 opened this issue Mar 23, 2019 · 4 comments
Labels
dependency For issues and PRs. Things that are related to one or more dependencies. dialect: mariadb For issues and PRs. Things that involve MariaDB (and do not involve all dialects).

Comments

@seally1186
Copy link

seally1186 commented Mar 23, 2019

What are you doing?

Using mariadb with a named timezone and doing any query:

const sequelize = new Sequelize("mariadb://...", { timezone: "America/Los_Angeles" });
sequelize.query("SELECT 1");

What is actually happening?

SequelizeConnectionError: timezone format error. must be 'local'/'Z' or ±HH:MM. was 'America/Los_Angeles'
    at lib.createConnection.then.catch.err (/var/project/node_modules/sequelize/lib/dialects/mariadb/connection-manager.js:122:19)

It looks like connection-manager.js is handling the timezone (via momentTz), but it's also passing the timezone string directly to the mariadb library, which rejects it.

Dialect: mariadb
Dialect version: mariadb@2.0.3
Database version: N/A
Sequelize version: 5.1.1 and master
Tested with latest release: Yes

@knoxcard
Copy link
Contributor

@rusher - check this out...any ideas?

@rusher
Copy link
Contributor

rusher commented Mar 25, 2019

As indicate by error message, Timezone support is currently limited to "local'/'Z' or ±HH:MM. That's something that will be handled in next version (in about 2 weeks)

@knoxcard
Copy link
Contributor

knoxcard commented Mar 25, 2019

@rusher - Thanks for the quick replies, as always, much appreciated!

@sushantdhiman sushantdhiman added dependency For issues and PRs. Things that are related to one or more dependencies. dialect: mariadb For issues and PRs. Things that involve MariaDB (and do not involve all dialects). labels Mar 26, 2019
@sushantdhiman
Copy link
Contributor

I believe this #10705 will fix this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependency For issues and PRs. Things that are related to one or more dependencies. dialect: mariadb For issues and PRs. Things that involve MariaDB (and do not involve all dialects).
Projects
None yet
Development

No branches or pull requests

4 participants