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

Fixed size string concatenation with integer results in fixed size string of size 0 #6583

Closed
monetdb-team opened this issue Nov 30, 2020 · 0 comments

Comments

@monetdb-team
Copy link

@monetdb-team monetdb-team commented Nov 30, 2020

Date: 2018-04-19 10:08:06 +0200
From: @swingbit
To: SQL devs <>
Version: 11.27.13 (Jul2017-SP4)
CC: @njnes

Last updated: 2018-06-20 11:02:18 +0200

Comment 26381

Date: 2018-04-19 10:08:06 +0200
From: @swingbit

User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/65.0.3325.181 Safari/537.36
Build Identifier:

sql>trace select '12345' || 678;
+------+
| L2 |
+======+
| 1234 |
: 5678 :
+------+
1 tuple (3.652ms)
+------+--------------------------------------------------------------------------------------------------------+
| usec | statement |
+======+========================================================================================================+
| 98 | X_3=0@0:void := querylog.define("trace select \'12345\' || 678;":str, "sequential_pipe":str, 9:int); |
| 167 | sql.resultSet(".L2":str, "L2":str, "char":str, 0:int, 0:int, 3:int, "12345678":str); |
+------+--------------------------------------------------------------------------------------------------------+

I assume that integer 678 is cast to a (fixed size) string before concatenation.
However, sql.resultSet shows a size 0.
Notice also how the result is oddly formatted.

Reproducible: Always

Comment 26388

Date: 2018-04-20 11:00:45 +0200
From: MonetDB Mercurial Repository <>

Changeset b3f10488c2e7 made by Pedro Ferreira pedro.ferreira@monetdbsolutions.com in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=b3f10488c2e7

Changeset description:

Added test for bug #6583

Comment 26394

Date: 2018-04-20 17:27:02 +0200
From: MonetDB Mercurial Repository <>

Changeset 12a61dac9008 made by Niels Nes niels@cwi.nl in the MonetDB repo, refers to this bug.

For complete details, see https//devmonetdborg/hg/MonetDB?cmd=changeset;node=12a61dac9008

Changeset description:

fixes for bug #6583 and 6584

Comment 26395

Date: 2018-04-20 17:28:23 +0200
From: @njnes

the general charachter types of the concat function turn the result in a
char(0), which is now handled by the output (result set) code using the same code as varchar(0)

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

Successfully merging a pull request may close this issue.

None yet
1 participant