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

[Bug] (nereids) Unable to recognize default value function in the insert statement #36652

Closed
3 tasks done
liutang123 opened this issue Jun 21, 2024 · 0 comments
Closed
3 tasks done

Comments

@liutang123
Copy link
Contributor

Search before asking

  • I had searched in the issues and found no similar issues.

Version

2.0.11

What's Wrong?

When insert a table with default value funcation column like a datetime column with CURRENT_TIMESTAMP default value function in InsertAsSelect stmt, an exception will be thrown:

ERROR 1105 (HY000): AnalysisException, msg: date/datetime literal [CURRENT_TIMESTAMP] is invalid

What You Expected?

The insert stmt should be executed correctly.

How to Reproduce?

set enable_nereids_planner = true;
set enable_fallback_to_original_planner = false;

CREATE TABLE `t1` (
  `v1` INT NULL,
  `v2` datetime NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=OLAP
UNIQUE KEY(`v1`)
COMMENT '物流仓库状态监控'
DISTRIBUTED BY HASH(`v1`) BUCKETS 2;

CREATE TABLE t2 (
  `v1` DECIMAL(10, 1) NULL DEFAULT "0.1"
) ENGINE=OLAP
UNIQUE KEY(v1)
DISTRIBUTED BY HASH(`v1`) BUCKETS 2;

explain insert into t1(v1) select t2.v1 as v1 from t2 ;

Anything Else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

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

No branches or pull requests

1 participant