Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2006
    Location
    Melbourne, Australia
    Posts
    30
    Plugin Contributions
    0

    Default [Done v1.3.8] Database Cache Bug

    There appears to be a reproducible problem with the way Zen Cart 1.3.6 handles the database cache. I discovered this while trying to write a custom shipping module. I have included a generic shipping module that should be able to reproduce the problem.

    --- THE PROBLEM ---
    When a shipping module is installed that enters a large number of keys (more than 250) into the “Configuration” table, accessing any of the products pages in the catalog returns the following errors.

    Warning: Variable passed to each() is not an array or object in /home/turfmach/public_html/catalog_test/includes/classes/db/mysql/query_factory.php on line 114
    Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/turfmach/public_html/catalog_test/includes/classes/db/mysql/query_factory.php:114) in /home/turfmach/public_html/catalog_test/includes/functions/sessions.php on line 102
    Warning: Cannot modify header information - headers already sent by (output started at /home/turfmach/public_html/catalog_test/includes/classes/db/mysql/query_factory.php:114) in /home/turfmach/public_html/catalog_test/includes/init_includes/init_templates.php on line 78
    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 'EXPECTED_PRODUCTS_SORT limit MAX_DISPLAY_UPCOMING_PRODUCT' at line 9 in:
    [select p.products_id, pd.products_name, products_date_available as date_expected from products p, products_description pd, products_to_categories p2c, categories c where p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and c.parent_id = '1' and p.products_date_available >=20061107 and p.products_id = pd.products_id and p.products_status = 1 and pd.language_id = '1' order by EXPECTED_PRODUCTS_FIELD EXPECTED_PRODUCTS_SORT limit MAX_DISPLAY_UPCOMING_PRODUCTS]
    These errors are only returned when the SQL_CACHE_METHOD in the following files are set to “database”.
    catalog/includes/configure.php
    catalog/admin/includes/configure.php

    When set to “none” or “file” everything works fine.

    I have tested this on a fresh install of Zen Cart v1.3.6

    I suspect that there may be a problem with the “Execute” function in query_factory.php.

    --- TO TEST ---
    1. Install Zen Cart v1.3.6 using database cache
    2. Unzip and copy the attached files to their corresponding directories
    3. Configure "Country" and "Postcode" in Admin > Configuration > Shipping/Packaging
    4. Install MyCourier in Admin > Modules > Shipping
    5. Go to the catalog and browse to any products page and the above errors should occur

    These errors can be removed by either:
    1. Uninstalling MyCourier
    2. Changing the SQL_CACHE_METHOD to "none" or "file"
    3. Using fewer keys in the shipping module (In my testing less than about 230 keys and the errors disappear. But this seems to vary)
    Attached Files Attached Files

  2. #2
    Join Date
    Jun 2003
    Posts
    33,715
    Plugin Contributions
    0

    Default Re: Database Cache Bug

    What version of php are you using?
    Please do not PM for support issues: a private solution doesn't benefit the community.

    Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.

  3. #3
    Join Date
    Sep 2004
    Posts
    745
    Plugin Contributions
    4

    Default Re: Database Cache Bug

    Just a comment regarding this error...

    Code:
    Warning: Variable passed to each() is not an array or object in /home/turfmach/public_html/catalog_test/includes/classes/db/mysql/query_factory.php on line 114
    We are using the 'file' method, yet every one in a while (maybe once a week) we get an errorlog write such as the above. I have never been able to track down where this comes from and not certain it is related to your problem but thought I should mention it.

    We are using Windows 2000, MySQL 5.0.21, Apache/2.2.2 (Win32) mod_ssl/2.2.2 OpenSSL/0.9.8b mod_jk/1.2.15 PHP/5.1.4

    Jeff

  4. #4
    Join Date
    Aug 2006
    Location
    Melbourne, Australia
    Posts
    30
    Plugin Contributions
    0

    Default Re: Database Cache Bug

    PHP Version: 4.4.2 (Zend: 1.3.0)
    MySQL 5.0.24-standard
    Server OS: Linux 2.6.9-42.0.3.ELsmp

  5. #5
    Join Date
    Aug 2006
    Location
    Melbourne, Australia
    Posts
    30
    Plugin Contributions
    0

    Default Re: Database Cache Bug

    Hi JeffD, thanks for your comments.

    I'm not familiar with the "errorlog" you mentioned. Are you referring to the one in cPanel or does Zen Cart have its own error log?

  6. #6
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default Re: Database Cache Bug

    As of v1.3.x, Zen Cart does not manage an errorlog.
    The reference is most likely to the Apache errorlog (which, yes, is accessible via cPanel on cPanel-equipped hosts).
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Sep 2004
    Posts
    745
    Plugin Contributions
    4

    Default Re: Database Cache Bug

    Actually the errorlog I was referencing was the PHP errors log which can be enabled by setting the path and name of the file in the php.ini file, and then enabling the flag.

    Jeff

  8. #8
    Join Date
    Jan 2006
    Posts
    224
    Plugin Contributions
    0

    Default Re: Database Cache Bug

    I salute you for this bug contribution. I have used database session cacheing for all my shops till I upgrade to 1.36 and heck, I was at deadend with these strange errors. Changed to file cacheing and all the problem's gone. The error is exactly the same. I dont know what is happening behind nor can I trouble shoot, but your bug report definitely solved my problem

  9. #9
    Join Date
    Jan 2004
    Posts
    66,419
    Blog Entries
    7
    Plugin Contributions
    277

    Default Re: Database Cache Bug

    The *real* fix/resolution is here:
    http://www.zen-cart.com/forum/showth...357#post378357
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. Replies: 1
    Last Post: 23 Sep 2012, 10:57 PM
  2. [Done v1.5.0] Bug: PRODUCTS_VIRTUAL_DEFAULT
    By RodG in forum Bug Reports
    Replies: 1
    Last Post: 30 Mar 2011, 04:16 AM
  3. [Done v1.3.9a] UTF-8 session and cache problems
    By a_berezin in forum Bug Reports
    Replies: 1
    Last Post: 30 Nov 2009, 05:04 PM
  4. [Done v1.3.8] Database cache bug and fix
    By bouncingltd in forum Bug Reports
    Replies: 19
    Last Post: 14 Jul 2009, 03:26 PM
  5. Is this a bug? Browser cache shipping problem
    By Pauls in forum Managing Customers and Orders
    Replies: 1
    Last Post: 17 May 2006, 04:10 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR