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

numeric values at the front of strings determines whether CAST works successfully #3424

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments
Labels
bug Something isn't working normal SQL

Comments

@monetdb-team
Copy link

Date: 2014-01-22 16:15:26 +0100
From: Anthony Damico <>
To: SQL devs <>
Version: 11.17.9 (Jan2014)

Last updated: 2014-05-22 09:52:23 +0200

Comment 19489

Date: 2014-01-22 16:15:26 +0100
From: Anthony Damico <>

User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/20100101 Firefox/26.0
Build Identifier:

if a CAST AS INTEGER statement gets used on a string that starts out with numbers, the CAST will (improperly?) succeed?

Reproducible: Always

Steps to Reproduce:

this is what you would expect:

select cast('a00asdf1' as INTEGER);
conversion of string 'a00asdf1' to type int failed.

this seems like it should not happen

select cast('00asdf1' as INTEGER);
+--------------+
| single_value |
+==============+
| 0 |
+--------------+

Actual Results:

strings that have both numbers and letters get CAST to the leading numbers

Expected Results:

if there are any letters in the string, that should prevent a CAST( xxx AS INTEGER ) from working?

thanks! monetdb rocks

Comment 19773

Date: 2014-04-24 18:43:40 +0200
From: MonetDB Mercurial Repository <>

Changeset 4708187f2a27 made by Sjoerd Mullender sjoerd@acm.org in the MonetDB repo, refers to this bug.

For complete details, see http//devmonetdborg/hg/MonetDB?cmd=changeset;node=4708187f2a27

Changeset description:

Refuse cast from string when not whole string converted.
This fixes bug #3424.
Also added test.
@monetdb-team monetdb-team added bug Something isn't working normal SQL labels Nov 30, 2020
@sjoerdmullender sjoerdmullender added this to the Ancient Release milestone Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working normal SQL
Projects
None yet
Development

No branches or pull requests

2 participants