[MDEV-27871] View is created with wrong column name if column name > 64 symbols Created: 2022-02-17  Updated: 2023-10-13

Status: Stalled
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.3, 10.4, 10.5, 10.6, 10.7, 10.8
Fix Version/s: 10.4

Type: Bug Priority: Major
Reporter: Lena Startseva Assignee: Lena Startseva
Resolution: Unresolved Votes: 0
Labels: view-protocol

Issue Links:
PartOf
is part of MDEV-27691 make working view-protocol Open
Relates
relates to MDEV-32119 CTE table is created with wrong colu... Open
relates to MDEV-32454 JSON test has problem in view protocol Stalled
relates to MDEV-32456 incorrect result of gis function in v... Open
relates to MDEV-32461 types changed in view protocol in cas... Closed
relates to MDEV-32465 dyncol changes under view protocol Closed

 Description   

According standard "If a <view column list> is" not "specified ... the <column name>s of the view are the <column name>s of the table specified by the <query expression>"

But:

If column name less or equal 64 symbols is everything Ok:

CREATE OR REPLACE VIEW v2 AS SELECT 111;

TABLE_SCHEMA	TABLE_NAME	COLUMN_NAME
test	                         v2	                111

But if column name more than 64 symbols the column name changes to "Name_exp_1"

CREATE OR REPLACE VIEW v1 AS SELECT 11111111111111111111111111111111111111111111111111111111111111111;

TABLE_SCHEMA	TABLE_NAME	COLUMN_NAME
test	                        v1	                Name_exp_1

Also it is impossible to set column name more than 64 symbols:

mysqltest: At line 6: query 'CREATE OR REPLACE VIEW v2 AS SELECT 111 as a2222222222222222222222222222222222222222222222222222222222222222' failed: 1166: Incorrect column name 'a2222222222222222222222222222222222222222222222222222222222222222'

After fix this bug view-protocol should be enable in tests: main.ctype_ldml, main.date_formats, main.order_by (possible), main.alias



 Comments   
Comment by Lena Startseva [ 2023-10-13 ]

Review for commit 3701b75aaea5e42d2dfd33fb4efb76b7157de9f2 done, OK to push after small fix:

sanja, remove, plz, in main.func_json, main.func_time, main.gis-json string " #enable after fix MDEV-27871"
in main.gis-json one waste " --disable_view_protocol"

Comment by Oleksandr Byelkin [ 2023-10-13 ]

So the task is finish fixing the tests and close this mdev as not a bug

Generated at Thu Feb 08 09:56:13 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.