Drupal 7, CiviCRM 4.7.27, using the standard report "Donation summary report (Repeat)", I'm getting an unexpected SQL error

Incorrect integer value: 'my custom source string' for column 'source' at row 1

This is a bit weird, since the source field is from the contributions table (it's doing some kind of subquery).

Anyone else seeing this? I thinking it's some kind of sql escaping problem.

  • What version of MySQL/MariaDB/Percona are you running? Have you tried the demo instance yet? – Jon G - Megaphone Tech Dec 11 '17 at 18:23
  • MariaDB 5.5.58 I don't think it's a general problem, but some kind of escaping problem that comes up when certain strings are used in one of the fields. The client was using hash marks in unexpected places, I'm guessing that's where the problem lies, but I haven't been able to dig any further down. – Alan Dixon Dec 12 '17 at 15:36
  • I fixed a problem just last week that sounds somewhat related: issues.civicrm.org/jira/browse/CRM-21531. If you suspect SQL escaping, it's probably best to capture the exact SQL query that does this? Also be mindful that you may be looking at a potential SQL injection; consider if it's exploitable and report appropriately! – Jon G - Megaphone Tech Dec 13 '17 at 17:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.