Innodb crash on JOIN query when "join_buffer_size" > "join_buffer_space_limit"
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| MariaDB |
Fix Released
|
Critical
|
Igor Babaev | ||
Bug Description
I don't how to describe the problem but the query below crashes innodb (xtradb). It does not happening on mysql 5.1 & 5.5
I'm using 5.3.3-MariaDB-
Query:
SELECT DISTINCT
B.TYPE_SID,
B.ID BANNER_ID,
B.WEIGHT BANNER_WEIGHT,
B.SHOWS_
B.FIX_CLICK,
B.FIX_SHOW,
B.KEYWORDS BANNER_KEYWORDS,
DATE_FORMAT(
DATE_FORMAT(
DATE_FORMAT(
B.FLYUNIFORM FLYUNIFORM,
B.MAX_SHOW_COUNT MAX_SHOW_COUNT,
B.SHOW_COUNT SHOW_COUNT,
C.ID CONTRACT_ID,
C.WEIGHT CONTRACT_WEIGHT,
C.KEYWORDS CONTRACT_KEYWORDS
FROM
b_adv_type T
INNER JOIN b_adv_banner B ON (
B.ACTIVE='Y'
and B.TYPE_SID = T.SID
and B.STATUS_SID = 'PUBLISHED'
and (B.FOR_NEW_GUEST is null or B.FOR_NEW_
and (ifnull(
and (ifnull(
and (ifnull(
and (B.DATE_
and (B.DATE_
INNER JOIN b_adv_banner_2_site BS ON (
BS.BANNER_ID = B.ID
and BS.SITE_ID = 'en')
INNER JOIN b_adv_contract C ON (
C.ID = B.CONTRACT_ID
and C.ACTIVE='Y'
and (ifnull(
and (ifnull(
and (ifnull(
and (C.DATE_
and (C.DATE_
INNER JOIN b_adv_contract_
CS.CONTRACT_ID = B.CONTRACT_ID
and CS.SITE_ID = 'en')
INNER JOIN b_adv_contract_
CT.CONTRACT_ID = C.ID
and (CT.TYPE_SID = 'ALL' or CT.TYPE_SID = T.SID))
INNER JOIN b_adv_banner_
BW.BANNER_ID = B.ID
and BW.C_WEEKDAY=
and BW.C_HOUR = '11')
INNER JOIN b_adv_contract_
CW.CONTRACT_ID = C.ID
and CW.C_WEEKDAY=
and CW.C_HOUR = '11')
LEFT JOIN b_adv_banner_
(UG1.BANNER_ID = B.ID
and UG1.GROUP_ID in (1,2) and UG1.GROUP_ID<>2)
)
LEFT JOIN b_adv_banner_2_page BP1 ON (
BP1.BANNER_ID = B.ID
and BP1.SHOW_
LEFT JOIN b_adv_banner_2_page BP2 ON (
BP2.BANNER_ID = B.ID
and BP2.SHOW_
and '/club/index.php' like concat(BP2.PAGE, '%'))
LEFT JOIN b_adv_contract_
CP1.CONTRACT_ID = C.ID
and CP1.SHOW_
LEFT JOIN b_adv_contract_
CP2.CONTRACT_ID = C.ID
and CP2.SHOW_
and '/club/index.php' like concat(CP2.PAGE, '%'))
LEFT JOIN b_adv_banner_
LEFT JOIN b_adv_banner_
(
(B.STAT_TYPE is null OR length(
AND BC.COUNTRY_ID='UA'
) OR (
B.STAT_
AND BC.COUNTRY_ID='UA'
AND BC.REGION=''
) OR (
B.STAT_TYPE='CITY'
AND BC.CITY_ID='2'
)
)
WHERE
T.ACTIVE = 'Y'
and (
B.STAT_COUNT is null
or B.STAT_COUNT = 0
or BC.BANNER_ID is not null
)
and BP2.ID is null
and CP2.ID is null
and (BP1.ID is null or '/club/index.php' like concat(BP1.PAGE, '%'))
and (CP1.ID is null or '/club/index.php' like concat(CP1.PAGE, '%'))
and (BA.STAT_ADV_ID is null or BA.STAT_ADV_ID='0')
and (BC.COUNTRY_ID is null or BC.COUNTRY_ID='UA')
and
(
(B.SHOW_USER_GROUP = 'Y' and UG1.GROUP_ID is not null)
or
(B.SHOW_USER_GROUP <> 'Y' and UG1.GROUP_ID is null)
)
ORDER BY B.TYPE_SID desc, C.ID desc
This query is used in most popular russian CMS (bitrix) upon user login. I would like to provide more info if needed
| Changed in maria: | |
| status: | New → Confirmed |
| importance: | Undecided → High |
| Changed in maria: | |
| status: | Confirmed → In Progress |
| Changed in maria: | |
| importance: | High → Critical |
| Changed in maria: | |
| status: | In Progress → Fix Committed |
| Changed in maria: | |
| status: | Fix Committed → Fix Released |

Downgraded to 5.2.10- MariaDB- mariadb107~ squeeze- log without re-creating tables - now this query works fine