Skip to content

column already exists with a different column type when adding decimal(...) column #6750

@ice-cronus

Description

@ice-cronus

To reproduce

Create a simple trades table
execute

ALTER TABLE trades ADD COLUMN IF NOT EXISTS market_cap_usd DECIMAL(48, 18);

It applies schema
Execute same query one more time (expected to be no-op as it exists)
But you will get

column already exists with a different column type [current type=DECIMAL(48, 18), requested type=DECIMAL
``` instead.

Leads to 
https://github.com/questdb/questdb/blob/769456e9109ad3e9fd873bb0fea710ba7a2bbcd5/core/src/main/java/io/questdb/griffin/SqlCompilerImpl.java#L963
and
https://github.com/questdb/questdb/blob/master/core/src/main/java/io/questdb/cairo/ColumnType.java#L984

looks like 1st link should cut (...) in comparsion

### QuestDB version:

9.2.0

### OS, in case of Docker specify Docker and the Host OS:

Docker, ubuntu 20.04

### File System, in case of Docker specify Host File System:

ext4

### Full Name:

Nikolay

### Affiliation:

https://ice.io/

### Have you followed Linux, MacOs kernel configuration steps to increase Maximum open files and Maximum virtual memory areas limit?

- [x] Yes, I have

### Additional context

_No response_

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions