Skip to content

[fix](nereids) Fix not check column name when create or alter view - #42206

Merged
morrySnow merged 1 commit into
apache:masterfrom
seawinde:fix_view_column_name_not_check
Oct 23, 2024
Merged

[fix](nereids) Fix not check column name when create or alter view#42206
morrySnow merged 1 commit into
apache:masterfrom
seawinde:fix_view_column_name_not_check

Conversation

@seawinde

@seawindeseawinde commented Oct 21, 2024

Copy link
Copy Markdown
Member

Proposed changes

This is brought by #32743

set enable_unicode_name_support = true;
If run create view sql should fail beausel_shipdate column name contains invalid char '(' and ')', but now success
this pr fix this and throw exception
ERROR 1105 (HY000): errCode = 2, detailMessage = Incorrect column name '(日期)'. Column regex is '^[_a-zA-Z@0-9\s/][.a-zA-Z0-9_+-/?@#$%^&*"\s,:]{0,255}$'

CREATEVIEWview1ASSELECT"零售公司", l_shipdate as'(日期)', l_receiptdate as k2
FROM lineitem;

and if run create view sql as following, should success:

CREATEVIEWview2ASSELECT"零售公司", l_shipdate as'日期', l_receiptdate as k2
FROM lineitem;

and the schema of view2 should be

mysql>desc view2;
+-------------+-------------+------+-------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-------+---------+-------+
| __literal_0 | varchar(16) | No | false | NULL | |
| 日期 | date | No | false | NULL | |
| k2 | date | No | false | NULL | |
+-------------+-------------+------+-------+---------+-------+3 rows inset (0.01 sec)

@doris-robot

Copy link
Copy Markdown

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR

Since 2024-03-18, the Document has been moved to doris-website.
See Doris Document.

@seawinde

Copy link
Copy Markdown
MemberAuthor

run buildall

@github-actions

Copy link
Copy Markdown
Contributor

PR approved by anyone and no changes requested.

@github-actionsgithub-actionsBot added the approved Indicates a PR has been approved by one committer. label Oct 23, 2024
@github-actions

Copy link
Copy Markdown
Contributor

PR approved by at least one committer and no changes requested.

@morrySnow
morrySnow merged commit 2bcaa5b into apache:masterOct 23, 2024
seawinde added a commit to seawinde/doris that referenced this pull request Oct 23, 2024
…pache#42206)
This is brought by apache#32743
set enable_unicode_name_support = true;
If run create view sql should fail beausel_shipdate column name contains
invalid char '(' and ')', but now success
this pr fix this and throw exception
`ERROR 1105 (HY000): errCode = 2, detailMessage = Incorrect column name
'(日期)'. Column regex is
'^[_a-zA-Z@0-9\s/][.a-zA-Z0-9_+-/?@#$%^&*"\s,:]{0,255}$'`
CREATE VIEW view1
AS
SELECT "零售公司", l_shipdate as '(日期)', l_receiptdate as k2
FROM lineitem;
and if run create view sql as following, should success:
CREATE VIEW view2
AS
SELECT "零售公司", l_shipdate as '日期', l_receiptdate as k2
FROM lineitem;
and the schema of view2 should be
mysql> desc view2;
+-------------+-------------+------+-------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-------+---------+-------+
| __literal_0 | varchar(16) | No | false | NULL | |
| 日期 | date | No | false | NULL | |
| k2 | date | No | false | NULL | |
+-------------+-------------+------+-------+---------+-------+
3 rows in set (0.01 sec)
seawinde added a commit to seawinde/doris that referenced this pull request Oct 23, 2024
…pache#42206)
This is brought by apache#32743
set enable_unicode_name_support = true;
If run create view sql should fail beausel_shipdate column name contains
invalid char '(' and ')', but now success
this pr fix this and throw exception
`ERROR 1105 (HY000): errCode = 2, detailMessage = Incorrect column name
'(日期)'. Column regex is
'^[_a-zA-Z@0-9\s/][.a-zA-Z0-9_+-/?@#$%^&*"\s,:]{0,255}$'`
CREATE VIEW view1
AS
SELECT "零售公司", l_shipdate as '(日期)', l_receiptdate as k2
FROM lineitem;
and if run create view sql as following, should success:
CREATE VIEW view2
AS
SELECT "零售公司", l_shipdate as '日期', l_receiptdate as k2
FROM lineitem;
and the schema of view2 should be
mysql> desc view2;
+-------------+-------------+------+-------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-------+---------+-------+
| __literal_0 | varchar(16) | No | false | NULL | |
| 日期 | date | No | false | NULL | |
| k2 | date | No | false | NULL | |
+-------------+-------------+------+-------+---------+-------+
3 rows in set (0.01 sec)
morrySnow pushed a commit that referenced this pull request Oct 24, 2024
HappenLee pushed a commit to HappenLee/incubator-doris that referenced this pull request Apr 24, 2026
…pache#42206)
This is brought by apache#32743
set enable_unicode_name_support = true;
If run create view sql should fail beausel_shipdate column name contains
invalid char '(' and ')', but now success
this pr fix this and throw exception
`ERROR 1105 (HY000): errCode = 2, detailMessage = Incorrect column name
'(日期)'. Column regex is
'^[_a-zA-Z@0-9\s/][.a-zA-Z0-9_+-/?@#$%^&*"\s,:]{0,255}$'`
CREATE VIEW view1
AS
SELECT "零售公司", l_shipdate as '(日期)', l_receiptdate as k2
FROM lineitem;
and if run create view sql as following, should success:
CREATE VIEW view2
AS
SELECT "零售公司", l_shipdate as '日期', l_receiptdate as k2
FROM lineitem;
and the schema of view2 should be
mysql> desc view2;
+-------------+-------------+------+-------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-------------+-------------+------+-------+---------+-------+
| __literal_0 | varchar(16) | No | false | NULL | |
| 日期 | date | No | false | NULL | |
| k2 | date | No | false | NULL | |
+-------------+-------------+------+-------+---------+-------+
3 rows in set (0.01 sec)
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedIndicates a PR has been approved by one committer.cirdev/2.1.7-mergeddev/3.0.3-mergedp0_breviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants

@seawinde@doris-robot@feiniaofeiafei@morrySnow@gavinchou@yiguolei