I added repeater to web part zone. In page types I added two pages(CMS.MenuItem, Custom_page - custom page). After thet in columns I added specific column names from each page types. After that kentico doesn't reolve columns which isn't in one of the table.
For ex: Custom_page has column: HelloWorld. This column exist in Custom_page but doesn't in CMS.MenuItem. So after saving it shows server error: invalid column name 'HelloWorld'.
In kentico debug => sqlqueries, I noticed that it inserts both columns in both queries:
SELECT *
FROM (
(
SELECT [NodeLinkedNodeSiteID], [NodeSiteID], [NodeAliasPath], [HelloWorld] //etc.. for CMS.MenuItem
)
UNION ALL
(
SELECT [NodeLinkedNodeSiteID], [NodeSiteID], [NodeAliasPath], [HelloWorld] //etc.. for Custom_page
)
) AS SubData
but in proper variant it should be like:
SELECT *
FROM (
(
SELECT [NodeLinkedNodeSiteID], [NodeSiteID], [NodeAliasPath], [Custom_page ] //etc.. for CMS.MenuItem
)
UNION ALL
(
SELECT [NodeLinkedNodeSiteID], [NodeSiteID], [NodeAliasPath], NULL AS [Custom_page ] etc.. //etc.. for Custom_page
)
) AS SubData