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

feature: The tianmu storage engine does not support union query for fields whose data types are datetime and timestamp #1114

Closed
haitaoguan opened this issue Dec 13, 2022 · 2 comments · Fixed by #1177
Assignees
Labels
A-feature feature with good idea prio: high High priority

Comments

@haitaoguan
Copy link
Collaborator

mysql> create table t1(a datetime);
Query OK, 0 rows affected (0.02 sec)

mysql> create table t2(b timestamp);
Query OK, 0 rows affected (0.01 sec)

mysql> insert into t1 values('2020-12-23 00:00:00');
Query OK, 1 row affected (0.00 sec)

mysql> insert into t2 values('2022-04-18 00:00:00');
Query OK, 1 row affected (0.00 sec)

mysql> select * from t1 union select * from t2;
ERROR 1105 (HY000): The query includes syntax that is not supported by the storage engine. Tianmu: UNION of non-matching columns (column no 0) .
@haitaoguan haitaoguan added A-feature feature with good idea prio: high High priority labels Dec 13, 2022
@isredstar
Copy link
Collaborator

ACK

@isredstar isredstar self-assigned this Dec 13, 2022
@isredstar
Copy link
Collaborator

bool is_timestamp1 = (this->vc_type.GetTypeName() == common::ColumnType::TIMESTAMP);
bool is_timestamp2 = (vc->Type().GetTypeName() == common::ColumnType::TIMESTAMP);
if (is_timestamp1 ^ is_timestamp2)
return false;  // cannot compare timestamp with anything different than
                  // timestamp

@wisehead wisehead added this to the stonedb_5.7_v1.0.2 milestone Dec 22, 2022
isredstar added a commit to isredstar/stonedb that referenced this issue Dec 30, 2022
…or fields whose data types are datetime and timestamp(stoneatom#1114)
isredstar added a commit to isredstar/stonedb that referenced this issue Jan 3, 2023
…or fields whose data types are datetime and timestamp(stoneatom#1114)
isredstar added a commit to isredstar/stonedb that referenced this issue Jan 10, 2023
…or fields whose data types are datetime and timestamp(stoneatom#1114)
@mergify mergify bot closed this as completed in #1177 Jan 10, 2023
mergify bot pushed a commit that referenced this issue Jan 10, 2023
…or fields whose data types are datetime and timestamp(#1114)
mergify bot pushed a commit that referenced this issue Jan 10, 2023
…or fields whose data types are datetime and timestamp(#1114)
mergify bot pushed a commit that referenced this issue Jan 10, 2023
…or fields whose data types are datetime and timestamp(#1114)
konghaiya pushed a commit to konghaiya/stonedb that referenced this issue Mar 7, 2023
…or fields whose data types are datetime and timestamp(stoneatom#1114)
konghaiya pushed a commit to konghaiya/stonedb that referenced this issue Mar 7, 2023
…or fields whose data types are datetime and timestamp(stoneatom#1114)
konghaiya pushed a commit to konghaiya/stonedb that referenced this issue Mar 7, 2023
…or fields whose data types are datetime and timestamp(stoneatom#1114)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-feature feature with good idea prio: high High priority
Projects
None yet
3 participants