M
M
Multigame2015-03-26 11:53:35
PHP
Multigame, 2015-03-26 11:53:35

Bitrix. Requires adding all fields to the grouping, how to be?

Good afternoon.
I'm trying to drag Bitrix to another server. When transferring, he starts frantically swearing at sql queries. The general vector of complaints is that not all fields of the sample are present in the GROUP BY clause. The database itself naturally processes requests, the problem is somewhere at the Bitrix-ORM level.
Error Example

MySQL Query Error: 
SELECT CAT_CG.ID, CAT_CGL.NAME as CATALOG_GROUP_NAME, IF(CAT_CGG.ID IS NULL, 'N', 'Y') as CATALOG_CAN_ACCESS, IF(CAT_CGG1.ID IS NULL, 'N', 'Y') as CATALOG_CAN_BUY 
FROM b_catalog_group CAT_CG 
LEFT JOIN b_catalog_group2group CAT_CGG ON (CAT_CG.ID = CAT_CGG.CATALOG_GROUP_ID AND CAT_CGG.GROUP_ID IN (2) AND CAT_CGG.BUY <> 'Y') 
LEFT JOIN b_catalog_group2group CAT_CGG1 ON (CAT_CG.ID = CAT_CGG1.CATALOG_GROUP_ID AND CAT_CGG1.GROUP_ID IN (2) AND CAT_CGG1.BUY = 'Y') 
LEFT JOIN b_catalog_group_lang CAT_CGL ON (CAT_CG.ID = CAT_CGL.CATALOG_GROUP_ID AND CAT_CGL.LANG = 'ru') 
WHERE CAT_CG.ID IN (1) GROUP BY CAT_CG.ID 
['bitrix.CAT_CGL.NAME' isn't in GROUP BY]

Of course, you can climb in and add fields to the grouping everywhere ... but perhaps there are more adequate solutions?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Rainbird, 2015-03-26
@Multigame

And this can not be due to the ONLY_FULL_GROUP_BY difference on the servers?
https://dev.mysql.com/doc/refman/5.0/en/sql-mode.h...
ONLY_FULL_GROUP_BY has been enabled by default since MySQL 5.7.5

A
Alexey Emelyanov, 2015-03-26
@babarun

Describe the transfer process. Are you doing a sql dump or are you using the built-in backup mechanism?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question