CiviCRM Community Forums (archive)

*

News:

Have a question about CiviCRM?
Get it answered quickly at the new
CiviCRM Stack Exchange Q+A site

This forum was archived on 25 November 2017. Learn more.
How to get involved.
What to do if you think you've found a bug.



  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Error on Import - could not duplicate
Pages: [1]

Author Topic: Error on Import - could not duplicate  (Read 1266 times)

FatherShawn

  • Ask me questions
  • ****
  • Posts: 372
  • Karma: 25
    • C3 Design
  • CiviCRM version: 4.2.11
  • CMS version: Drupal 7.23
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Error on Import - could not duplicate
March 23, 2009, 03:31:44 pm
I encountered an database error importing a test case of contributions.  It did not duplicate on the joomla demo.

I'd appreciate ideas about what's going on on my install.  Here are the details:
Quote
Sorry. A non-recoverable error has occurred.
DB Error: syntax error

Database Error Code: 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 ')' at line 8, 1064

Return to home page.

Error Details:

Array
(
    [callback] => Array
        (
           
  • => CRM_Core_Error
  • [1] => handle
            )

        {code} => -2
       
[message] => DB Error: syntax error
    [mode] => 16
    [debug_info] =>
DELETE     g
FROM       civicrm_group_contact_cache g
INNER JOIN civicrm_contact c ON c.id = g.contact_id
WHERE      g.group_id IN (
    SELECT id
    FROM   civicrm_group
    WHERE  TIMESTAMPDIFF(MINUTE, cache_date, NOW()) >   
)
 [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 ')' at line 8]
    [type] => DB_Error
    [user_info] =>
DELETE     g
FROM       civicrm_group_contact_cache g
INNER JOIN civicrm_contact c ON c.id = g.contact_id
WHERE      g.group_id IN (
    SELECT id
    FROM   civicrm_group
    WHERE  TIMESTAMPDIFF(MINUTE, cache_date, NOW()) >   
)
 [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 ')' at line 8]
    [to_string] => [db_error: message="DB Error: syntax error" code=-2 mode=callback callback=CRM_Core_Error::handle prefix="" info="
DELETE     g
FROM       civicrm_group_contact_cache g
INNER JOIN civicrm_contact c ON c.id = g.contact_id
WHERE      g.group_id IN (
    SELECT id
    FROM   civicrm_group
    WHERE  TIMESTAMPDIFF(MINUTE, cache_date, NOW()) >   
)
 [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 ')' at line 8]"]
)
Lead Developer, C3 Design.
Twitter: @FatherShawn

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Error on Import - could not duplicate
March 23, 2009, 05:04:10 pm

this is fixed in 2.2.1. the patch is:

Code: [Select]
--- CRM/Contact/BAO/GroupContactCache.php       (revision 20322)
+++ CRM/Contact/BAO/GroupContactCache.php       (working copy)
@@ -137,7 +137,7 @@
 
         $config = CRM_Core_Config::singleton( );
         $smartGroupCacheTimeout =
-            isset( $config->smartGroupCacheTimeout ) ? $config->smartGroupCacheTimeout : 0;
+            isset( $config->smartGroupCacheTimeout ) && is_numeric(  $config->smartGroupCacheTimeout ) ? $config->smartGroupCacheTimeout : 0;
 
         if ( ! isset( $groupID ) ) {
             $query = "

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

FatherShawn

  • Ask me questions
  • ****
  • Posts: 372
  • Karma: 25
    • C3 Design
  • CiviCRM version: 4.2.11
  • CMS version: Drupal 7.23
  • MySQL version: 5.5.32
  • PHP version: 5.3.10
Re: Error on Import - could not duplicate
March 23, 2009, 05:28:24 pm
Wow- You guys are so awesome!
Lead Developer, C3 Design.
Twitter: @FatherShawn

danielmccollum

  • Guest
Re: Error on Import - could not duplicate
May 11, 2009, 12:08:57 pm
I am getting the same error when I load and run 2.2.2 on Joomla 1.5.10. Is this still an issue? I have installed on other sites without an issue, but now I am getting an error on this install. I am installing to a subdomain, so not sure if that should matter.

Daniel
Joomla 1.5.10
PHP 5.2.5
MYSQL 4.1.22

Donald Lobo

  • Administrator
  • I’m (like) Lobo ;)
  • *****
  • Posts: 15963
  • Karma: 470
    • CiviCRM site
  • CiviCRM version: 4.2+
  • CMS version: Drupal 7, Joomla 2.5+
  • MySQL version: 5.5.x
  • PHP version: 5.4.x
Re: Error on Import - could not duplicate
May 11, 2009, 02:46:50 pm

note that u require mysql 5.x for civicrm. you seem to be using an old version of mysql

lobo
A new CiviCRM Q&A resource needs YOUR help to get started. Visit our StackExchange proposed site, sign up and vote on 5 questions

danielmccollum

  • Guest
Re: Error on Import - could not duplicate
May 11, 2009, 02:48:36 pm
Since I was using the same hoster as my previous Civi deployments, I assumed it was the same MYSQL version, 5.x. Apparently not all their servers are on 5.x. Thanks for the clarification.

Pages: [1]
  • CiviCRM Community Forums (archive) »
  • Old sections (read-only, deprecated) »
  • Support »
  • Using CiviCRM »
  • Using CiviContribute (Moderator: Donald Lobo) »
  • Error on Import - could not duplicate

This forum was archived on 2017-11-26.