Answers.Body: <p>As Chris says, the problem is due to <a href="https://docs.civicrm.org/user/en/4.7/advanced-configuration/change-logging/" rel="nofollow noreferrer">CiviCRM's Data Logging feature</a> having a problem with column names that are MySQL reserved words. As John says, in this case it's the column named <code>desc</code>.</p>
  
  <p>I think this is a bug in Civi logging rather than in the extension: it's allowed in MySQL to have a column name that is a reserved word, provided it is properly escaped when referred to. Civi logging should deal with that.</p>
  
  <p>I have filed an issue: <a href="https://issues.civicrm.org/jira/browse/CRM-20443" rel="nofollow noreferrer">SQL syntax error creating logging triggers if column name is reserved word</a> and tested a fix against 4.6.27, which from a quick look at the code should apply to 4.7 too - I'm going to test that and create a pull request. If you test the fix, please leave a comment on the issue with your results.</p>
  
  <p>Update 20 Jun 2017: I've now replicated the problem with the latest 4.6 &amp; 4.7 (master) code and verified that the fix (suitably adapted) works for both versions. Created PRs for 4.6 &amp; 4.7 . The 4.7 one has been merged and the issue marked fixed.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-18T17:00:34.703Z
Answers.LastActivityDate: 2017-06-20T09:18:13.917Z
Answers.LastEditDate: 2017-06-20T09:18:13.917Z
Answers.UserDisplayName: davejenx
Answers.Body: <p>I put in a pull request to rename that column: <a href="https://github.com/ypranay/org.civicrm.civirebux/pull/7" rel="nofollow noreferrer">https://github.com/ypranay/org.civicrm.civirebux/pull/7</a></p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-14T16:21:55.607Z
Answers.LastActivityDate: 2017-04-14T16:21:55.607Z
Answers.UserDisplayName: David Hayes
Answers.Body: <p>It seems there is some buggy functionality in CiviRebux that prevents an installation on some servers.</p>
  
  <p><a href="https://github.com/ypranay/org.civicrm.civirebux/issues/4" rel="nofollow noreferrer">@ypranay</a>: "Seems that the error is because of the settings of the MySQL server on which your site is hosted. Depending on the server, the SQL syntax will have to be changed."</p>
  
  <p>No solution has been found yet.</p>
  
  <p>Most recent error/issue report by @petednz:</p>
  
  <ul>
  <li><a href="https://github.com/ypranay/org.civicrm.civirebux/issues/6" rel="nofollow noreferrer">https://github.com/ypranay/org.civicrm.civirebux/issues/6</a></li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-02-24T17:29:55.373Z
Answers.LastActivityDate: 2017-02-24T17:29:55.373Z
Answers.UserDisplayName: Laryn
Answers.Body: <p>From what is described above, it sounds like CiviRebux may be incompatible with <a href="https://docs.civicrm.org/user/en/4.7/advanced-configuration/change-logging/" rel="nofollow noreferrer">CiviCRM's Data Logging feature</a>.</p>
  
  <p>If the option "Logging" is enabled at <code>civicrm/admin/setting/misc</code> then you're going to run into these issues when trigger generation is called on any tables created by CiviRebux which use MySQL reserved words as column names.</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-10T11:00:51.950Z
Answers.LastActivityDate: 2017-04-10T11:00:51.950Z
Answers.UserDisplayName: Chris Burgess
Answers.Body: <p>Based on nothing, "desc" doesn't seem like a likely column name, and it's where the error occurs.</p>
  
  <p>Does this match the name of a column in your database?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-03-21T21:47:00.600Z
Answers.LastActivityDate: 2017-03-21T21:47:00.600Z
Answers.UserDisplayName: JohnFF
Body: <p>Has anyone successfully gotten CiviRebux installed and working? <strong>UPDATE: If you have CiviRebux running, would you be willing to post a comment with the version of MySQL that your server is running?</strong></p>
  
  <p>The <a href="https://civicrm.org/blog/ypranay/introducing-civirebux-native-report-building-extension-for-civicrm" rel="nofollow noreferrer">blog post</a> and <a href="https://vimeo.com/177771921" rel="nofollow noreferrer">video demo</a> look great but I have not had any luck getting it to function. I run into a <a href="https://github.com/ypranay/org.civicrm.civirebux/issues/4" rel="nofollow noreferrer">fatal syntax error</a>:</p>
  
  <pre><code>[code] =&gt; -2
  [message] =&gt; DB Error: syntax error
  [mode] =&gt; 16
  [debug_info] =&gt; CREATE TRIGGER civicrm_civirebux_configuration_after_insert after insert ON civicrm_civirebux_configuration FOR EACH ROW BEGIN  IF ( @civicrm_disable_logging IS NULL OR @civicrm_disable_logging = 0 ) THEN INSERT INTO log_civicrm_civirebux_configuration (id, name, renderer, aggregator, vals, rows, cols, time, desc, type, log_conn_id, log_user_id, log_action) VALUES ( NEW.id, NEW.name, NEW.renderer, NEW.aggregator, NEW.vals, NEW.rows, NEW.cols, NEW.time, NEW.desc, NEW.type, CONNECTION_ID(), @civicrm_user_id, 'insert'); END IF; END [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, type, log_conn_id, log_user_id, log_action) VALUES ( NEW.id, NEW.name, NEW' at line 1]
  [type] =&gt; DB_Error
  [user_info] =&gt; CREATE TRIGGER civicrm_civirebux_configuration_after_insert after insert ON civicrm_civirebux_configuration FOR EACH ROW BEGIN  IF ( @civicrm_disable_logging IS NULL OR @civicrm_disable_logging = 0 ) THEN INSERT INTO log_civicrm_civirebux_configuration (id, name, renderer, aggregator, vals, rows, cols, time, desc, type, log_conn_id, log_user_id, log_action) VALUES ( NEW.id, NEW.name, NEW.renderer, NEW.aggregator, NEW.vals, NEW.rows, NEW.cols, NEW.time, NEW.desc, NEW.type, CONNECTION_ID(), @civicrm_user_id, 'insert'); END IF; END [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, type, log_conn_id, log_user_id, log_action) VALUES ( NEW.id, NEW.name, NEW' at line 1]
  [to_string] =&gt; [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="CREATE TRIGGER civicrm_civirebux_configuration_after_insert after insert ON civicrm_civirebux_configuration FOR EACH ROW BEGIN  IF ( @civicrm_disable_logging IS NULL OR @civicrm_disable_logging = 0 ) THEN INSERT INTO log_civicrm_civirebux_configuration (id, name, renderer, aggregator, vals, rows, cols, time, desc, type, log_conn_id, log_user_id, log_action) VALUES ( NEW.id, NEW.name, NEW.renderer, NEW.aggregator, NEW.vals, NEW.rows, NEW.cols, NEW.time, NEW.desc, NEW.type, CONNECTION_ID(), @civicrm_user_id, 'insert'); END IF; END [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, type, log_conn_id, log_user_id, log_action) VALUES ( NEW.id, NEW.name, NEW' at line 1]"]
  )
  </code></pre>
  
  <p><em>Versions:</em></p>
  
  <ul>
  <li>PHP 5.5.38</li>
  <li>MySQL 5.5.52-cll</li>
  </ul>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-10-13T14:39:57.957Z
Comments.Text: Which version of Civi are you using? I had that (or similar) on 4.6, then discovered it's 4.7 minimum.
Comments.UserDisplayName: Andrew West
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-10-17T18:42:43.687Z
Comments.Text: I'm pretty sure the site I tested on was 4.7 but will try again to be sure.
Comments.UserDisplayName: Laryn
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-02-13T22:42:23.550Z
Comments.Text: Just tested again and the issue still occurs -- and it's definitely 4.7 :)
Comments.UserDisplayName: Laryn
Tags: <extension>
Title: Has anyone gotten CiviRebux working?
ThreadText: # Has anyone gotten CiviRebux working?
  
  (Asked by: username_0 on 2016-10-13)
  
  Has anyone successfully gotten CiviRebux installed and working? **UPDATE: If you have CiviRebux running, would you be willing to post a comment with the version of MySQL that your server is running?**
  
  The [blog post](https://civicrm.org/blog/ypranay/introducing-civirebux-native-report-building-extension-for-civicrm) and [video demo](https://vimeo.com/177771921) look great but I have not had any luck getting it to function. I run into a [fatal syntax error](https://github.com/ypranay/org.civicrm.civirebux/issues/4):
  
  ```
  [code] => -2
  [message] => DB Error: syntax error
  [mode] => 16
  [debug_info] => CREATE TRIGGER civicrm_civirebux_configuration_after_insert after insert ON civicrm_civirebux_configuration FOR EACH ROW BEGIN  IF ( @civicrm_disable_logging IS NULL OR @civicrm_disable_logging = 0 ) THEN INSERT INTO log_civicrm_civirebux_configuration (id, name, renderer, aggregator, vals, rows, cols, time, desc, type, log_conn_id, log_user_id, log_action) VALUES ( NEW.id, NEW.name, NEW.renderer, NEW.aggregator, NEW.vals, NEW.rows, NEW.cols, NEW.time, NEW.desc, NEW.type, CONNECTION_ID(), @civicrm_user_id, 'insert'); END IF; END [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, type, log_conn_id, log_user_id, log_action) VALUES ( NEW.id, NEW.name, NEW' at line 1]
  [type] => DB_Error
  [user_info] => CREATE TRIGGER civicrm_civirebux_configuration_after_insert after insert ON civicrm_civirebux_configuration FOR EACH ROW BEGIN  IF ( @civicrm_disable_logging IS NULL OR @civicrm_disable_logging = 0 ) THEN INSERT INTO log_civicrm_civirebux_configuration (id, name, renderer, aggregator, vals, rows, cols, time, desc, type, log_conn_id, log_user_id, log_action) VALUES ( NEW.id, NEW.name, NEW.renderer, NEW.aggregator, NEW.vals, NEW.rows, NEW.cols, NEW.time, NEW.desc, NEW.type, CONNECTION_ID(), @civicrm_user_id, 'insert'); END IF; END [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, type, log_conn_id, log_user_id, log_action) VALUES ( NEW.id, NEW.name, NEW' at line 1]
  [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="CREATE TRIGGER civicrm_civirebux_configuration_after_insert after insert ON civicrm_civirebux_configuration FOR EACH ROW BEGIN  IF ( @civicrm_disable_logging IS NULL OR @civicrm_disable_logging = 0 ) THEN INSERT INTO log_civicrm_civirebux_configuration (id, name, renderer, aggregator, vals, rows, cols, time, desc, type, log_conn_id, log_user_id, log_action) VALUES ( NEW.id, NEW.name, NEW.renderer, NEW.aggregator, NEW.vals, NEW.rows, NEW.cols, NEW.time, NEW.desc, NEW.type, CONNECTION_ID(), @civicrm_user_id, 'insert'); END IF; END [nativecode=1064 ** You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'desc, type, log_conn_id, log_user_id, log_action) VALUES ( NEW.id, NEW.name, NEW' at line 1]"]
  )
  
  ```
  
  *Versions:*
  
  * PHP 5.5.38
  * MySQL 5.5.52-cll
  
  **Tags:** extension
  
  > **Comments:**
  > **username_1**: Which version of Civi are you using? I had that (or similar) on 4.6, then discovered it's 4.7 minimum.  
  > **username_0**: I'm pretty sure the site I tested on was 4.7 but will try again to be sure.  
  > **username_0**: Just tested again and the issue still occurs -- and it's definitely 4.7 :)  
  
  ---
  
  ## 5 answers
  
  ### Answer by username_2 on 2017-04-18. Score: 5 | Accepted answer
  
  As username_4 says, the problem is due to [CiviCRM's Data Logging feature](https://docs.civicrm.org/user/en/4.7/advanced-configuration/change-logging/) having a problem with column names that are MySQL reserved words. As John says, in this case it's the column named `desc`.
  
  I think this is a bug in Civi logging rather than in the extension: it's allowed in MySQL to have a column name that is a reserved word, provided it is properly escaped when referred to. Civi logging should deal with that.
  
  I have filed an issue: [SQL syntax error creating logging triggers if column name is reserved word](https://issues.civicrm.org/jira/browse/CRM-20443) and tested a fix against 4.6.27, which from a quick look at the code should apply to 4.7 too - I'm going to test that and create a pull request. If you test the fix, please leave a comment on the issue with your results.
  
  Update 20 Jun 2017: I've now replicated the problem with the latest 4.6 & 4.7 (master) code and verified that the fix (suitably adapted) works for both versions. Created PRs for 4.6 & 4.7 . The 4.7 one has been merged and the issue marked fixed.
  
  
  ---
  
  ### Answer by username_3 on 2017-04-14. Score: 2
  
  I put in a pull request to rename that column: <https://github.com/ypranay/org.civicrm.civirebux/pull/7>
  
  
  ---
  
  ### Answer by username_0 on 2017-02-24. Score: 1
  
  It seems there is some buggy functionality in CiviRebux that prevents an installation on some servers.
  
  [@ypranay](https://github.com/ypranay/org.civicrm.civirebux/issues/4): "Seems that the error is because of the settings of the MySQL server on which your site is hosted. Depending on the server, the SQL syntax will have to be changed."
  
  No solution has been found yet.
  
  Most recent error/issue report by @petednz:
  
  * <https://github.com/ypranay/org.civicrm.civirebux/issues/6>
  
  
  ---
  
  ### Answer by username_4 on 2017-04-10. Score: 0
  
  From what is described above, it sounds like CiviRebux may be incompatible with [CiviCRM's Data Logging feature](https://docs.civicrm.org/user/en/4.7/advanced-configuration/change-logging/).
  
  If the option "Logging" is enabled at `civicrm/admin/setting/misc` then you're going to run into these issues when trigger generation is called on any tables created by CiviRebux which use MySQL reserved words as column names.
  
  
  ---
  
  ### Answer by username_5 on 2017-03-21. Score: -1
  
  Based on nothing, "desc" doesn't seem like a likely column name, and it's where the error occurs.
  
  Does this match the name of a column in your database?
  
  
  ---
  
  