horaedb icon indicating copy to clipboard operation
horaedb copied to clipboard

Create/insert with case-sensitive table name success, but not found while select.

Open Rachelint opened this issue 2 years ago • 3 comments

Describe this problem

Create/insert a table named like "DeMo" will success. But when I select something in this table, error of "table not found" will be returned.

Steps to reproduce

  • Create table:
CREATE TABLE DeMo (
    `timestamp` timestamp NOT NULL,
    `arch` string TAG,
    `datacenter` string TAG,
    `value` int,
    timestamp KEY (timestamp)) ENGINE=Analytic
WITH(
	 enable_ttl='false'
);
  • Insert something:
INSERT INTO DeMo
    (`timestamp`, `arch`, `datacenter`, `value`)
VALUES
    (1658304762, 'x86-64', 'china', 100),
  • Select something:
SELECT * FROM DeMo;

Expected behavior

No response

Additional Information

No response

Rachelint avatar Aug 26 '22 06:08 Rachelint

:face_with_spiral_eyes:

ShiKaiWi avatar Aug 26 '22 09:08 ShiKaiWi

😵‍💫

I think we can only support case-insensitive now?

Rachelint avatar Aug 26 '22 09:08 Rachelint

This reference says whether the identifiers are case-sensitive depends on the OS because of the mysql implementation. And there is no a worry for CeresDB's implementation, so let's make all the identifiers case-sensitive.

ShiKaiWi avatar Sep 08 '22 02:09 ShiKaiWi

This 'bug' is introduced by https://github.com/apache/arrow-datafusion/issues/1746.

Maybe this is not a bug, and just quote the ident by ` if we want to make the table names case sensitive:

SELECT * FROM DeMo;

ShiKaiWi avatar Oct 09 '22 07:10 ShiKaiWi

Yeah, it's a feature, not bug. I think we should:

  • Add a testcase
  • Update document, https://docs.ceresdb.io/sql/identifier.html

jiacai2050 avatar Oct 09 '22 07:10 jiacai2050