Skip to content

Fix SQL error in firing chart data due to only_full_group_by - #106

Open
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/firing-chart-sql-error
Open

Fix SQL error in firing chart data due to only_full_group_by#106
sentry[bot] wants to merge 1 commit into
masterfrom
seer/fix/firing-chart-sql-error

Conversation

@sentry

@sentry sentry Bot commented Jul 11, 2026

Copy link
Copy Markdown

This PR resolves a yii\db\Exception: SQLSTATE[42000]: Syntax error or access violation: 1055 error occurring in CandidateWorkHistory::getFiringChartData.

The error was caused by selecting the end_date column without an aggregate function while grouping by MONTH(end_date), YEAR(end_date). This violates MySQL's only_full_group_by SQL mode, which is enabled by default in modern MySQL versions.

The fix involves changing the SELECT clause from end_date, COUNT(*) as total to MIN(end_date) as end_date, COUNT(*) as total. By applying MIN() to end_date, the query now complies with only_full_group_by. The alias as end_date ensures that existing downstream logic that processes the end_date column remains unaffected.

Fixes STUDENTHUB-BACKEND-3
Fixes TECH-2026

@linear-code

linear-code Bot commented Jul 11, 2026

Copy link
Copy Markdown

TECH-2026

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants