Skip to content

Unexpected result when using STARTSWITH #7544

Closed

Description

@suyZhong

Describe the bug
Consider the following test cases. The STARTSWITH function checks if the string in t0.c0 starts with the character 'a' with case sensitive, and it should be evaluated as true, as shown in the second query. Thus, the third query should return 2 rows.

To Reproduce

DROP TABLE IF EXISTS t0 CASCADE;
DROP TABLE IF EXISTS t1 CASCADE;

CREATE TABLE  t0 (c0 VARCHAR) ;
CREATE TABLE  t1 (c1 BOOLEAN) ;
INSERT INTO t0(c0) VALUES ('a');
INSERT INTO t1(c1) VALUES (true), (true);

SELECT * FROM t0, t1; -- a true, a true
SELECT STARTSWITH(t0.c0, 'a', t1.c1) FROM t0, t1; -- true, true
SELECT * FROM t0, t1 WHERE STARTSWITH(t0.c0, 'a', t1.c1);
-- Expected: a true, a true (2 rows)
-- Actual: a true (1 row)

Expected behavior
As mentioned above.

Screenshots
N/A

Software versions
Build from source:

> docker exec -it monetdb-test mserver5 --version
MonetDB 5 server 11.52.0 (hg id: 53f9d56) (64-bit, 128-bit integers)
This is an unreleased version
Copyright (c) 1993 - July 2008 CWI
Copyright (c) August 2008 - 2023 MonetDB B.V., all rights reserved
Visit https://www.monetdb.org/ for further information
Found 503.5GiB available memory, 128 available cpu cores
Libraries:
Compiled by: @49c6d00b8d79 (x86_64-pc-linux-gnu)
Compilation: /usr/bin/cc 
Linking    : /usr/bin/ld

Issue labeling
Bug

Additional context
Add any other context about the problem here.

Activity

  1. added
    bugSomething isn't working
    on Jul 2, 2024
  2. added a commit that references this issue on Jul 2, 2024
  3. self-assigned this
    on Jul 7, 2024
  4. added this to the NEXTFEATURERELEASE milestone on Jul 7, 2024
  5. added a commit that references this issue on Jul 7, 2024
  6. sjoerdmullender commented on Jul 22, 2024

    @sjoerdmullender
    Member

    The test fails when run single-threaded.

  7. njnes commented on Aug 2, 2024

    @njnes
    Contributor

    we now check all icase values to be equal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions