Body: <p>Drupal 7, CiviCRM 4.7.27, using the standard report "Donation summary report (Repeat)", I'm getting an unexpected SQL error </p>
  
  <pre><code>Incorrect integer value: 'my custom source string' for column 'source' at row 1
  </code></pre>
  
  <p>This is a bit weird, since the source field is from the contributions table (it's doing some kind of subquery).</p>
  
  <p>Anyone else seeing this? I thinking it's some kind of sql escaping problem.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-11T18:23:22.230Z
Comments.Text: What version of MySQL/MariaDB/Percona are you running? Have you tried the demo instance yet?
Comments.UserDisplayName: Jon G - Megaphone Tech
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-12T15:36:24.493Z
Comments.Text: 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.
Comments.UserDisplayName: Alan Dixon
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-12-13T17:12:09.240Z
Comments.Text: I fixed a problem just last week that sounds somewhat related: https://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!
Comments.UserDisplayName: Jon G - Megaphone Tech
Tags: <civireport><sql>
Title: Donation summary report (Repeat) gives error Incorrect integer value: 'text string' for column 'source' at row 1
ThreadText: # Donation summary report (Repeat) gives error Incorrect integer value: 'text string' for column 'source' at row 1
  
  (Asked by: username_0 on 2017-12-11)
  
  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.
  
  **Tags:** civireport, sql
  
  > **Comments:**
  > **username_1**: What version of MySQL/MariaDB/Percona are you running? Have you tried the demo instance yet?  
  > **username_0**: 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.  
  > **username_1**: I fixed a problem just last week that sounds somewhat related: https://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!  
  
  ---
  
  ## 0 answers
  
  