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

MDEV-31334: Consider dates ending in 'T' as malformed #3788

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

FarihaIS
Copy link

@FarihaIS FarihaIS commented Jan 23, 2025

Description

MariaDB 10.6 currently accepts dates that end in 'T' without a warning or error: for example 'insert into t1 values ("2003-02-05T")'. This is an issue as ISO 8601 standards state that a 'T' should be followed by the time of day. Dates that terminate in 'T' should receive the same error in strict mode and warning otherwise as dates that terminate in any other (invalid) character. Commit includes bug fix and tests for dates ending in 'T'.

How can this PR be tested?

Execute the main suite in mysql-test-run. This commit adds a test in that suite.

Basing the PR against the correct MariaDB version

  • This is a new feature and the PR is based against the latest MariaDB development branch

Backward compatibility

This is a new feature introducing stricter date formatting that will consider dates ending in 'T' as malformed and affect backwards compatibility.

Copyright

All new code of the whole pull request, including one or several files that are either new files or modified ones, are contributed under the BSD-new license. I am contributing on behalf of my employer Amazon Web Services, Inc.

@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@vuvova vuvova requested a review from abarkov January 24, 2025 14:22
@cvicentiu cvicentiu added the External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements. label Jan 24, 2025
mysql-test/main/func_extract.result Outdated Show resolved Hide resolved
@cvicentiu
Copy link
Member

cvicentiu commented Jan 24, 2025

@FarihaIS Thank you for the contribution! 👍

I've done a preliminary review and I think you should first try to clarify in the MDEV what the exact specification is.

How should SELECT EXTRACT(<malformed_date>) should work. How it should work for INSERT. How it should behave with STRICT mode vs not strict mode.

Then you should check your patch again and see if it fulfils (and tests) those scenarios.

I'm sure we can get this through with a bit more work. :)

@cvicentiu cvicentiu assigned cvicentiu and unassigned cvicentiu Jan 24, 2025
According to ISO 8601 standard, 'T' should be followed by the time of
day. If a date ends with only 'T', throw an error in strict mode and a
warning in other modes.

All new code of the whole pull request, including one or several files
that are either new files or modified ones, are contributed under the
BSD-new license. I am contributing on behalf of my employer Amazon Web
Services, Inc.
@FarihaIS FarihaIS force-pushed the bugfix/no-dates-with-T-on-end branch from bd2c417 to a8ab18b Compare January 29, 2025 19:19
@FarihaIS FarihaIS requested a review from cvicentiu January 29, 2025 19:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
External Contribution All PRs from entities outside of MariaDB Foundation, Corporation, Codership agreements.
Development

Successfully merging this pull request may close these issues.

3 participants