Forums / General Questions / Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

Views: 7,509

Results 1 to 20 of 44
4 Jun 2016, 11:43 AM
#1
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

....don't even know what to ask.... but I'm getting this logs.

What should I be looking for ? this DUPLICATE KEY UPDATE where is it coming from ?

[04-Jun-2016 10:17:22 Europe/Lisbon] 
PHP Fatal error:  1048:Column 'value' cannot be null :: insert into sessions (sesskey, expiry, `value`)
            values ('skc7lplhr8mpjptu72b700uhh3', 1465033282, null)
            ON DUPLICATE KEY UPDATE `value`=null, expiry=1465033282 ==> (as called by) /home/xxxxxxxxxx/xxxx/includes/functions/sessions.php on line 69 <== in /home/xxxxxxxxxx/xxxx/includes/classes/db/mysql/query_factory.php on line 167

Thanks

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

4 Jun 2016, 12:41 PM
#2
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

In some of the earlier versions of ZC, there was the possibility of a race condition existing (the sessions table being updated at the same time that the same session was to again be updated/insert) to prevent that race condition the session storage function was modified to use the update option for the operation. The alternative proposed was to use the replace command; however, that was found to perform two operations basically of removing the previous if found and then store the new data as compared to the update that would just revise the data.

As to why the value portion of the data is null... That's something that at the moment doesn't come to mind as to why/how it could be. Generally speaking though the suggestion would be to review the server logs for the 5 minutes before to 5 minutes after that error to see what was going on at the time and try to identify what actions were occurring.

Could you also provide information (already requested in the posting tips) such as php version, server information, mysql database version info, etc...

As to specifically from where in the code it is coming: includes/functions/sessions.php on line 6

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

4 Jun 2016, 12:50 PM
#3
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

PHP Version: 5.6.18 (Zend: 2.6.0)
Database: MySQL 5.5.49-cll

I only have one log now.
I' still in the process of migrating from my local machine to the server, and some issues still came up, and I've deleted a lot of log files.
But for now, just this log file.

Could I truncate the sessions table , to see if this has something to do with the "migration" ?

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

4 Jun 2016, 12:52 PM
#4
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

mc12345678:

for the 5 minutes before to 5 minutes after that error to see what was going on at the time and try to identify what actions were occurring.

So 5 minutes, the the session goes down, that's why you're saying 5 minutes ?

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

4 Jun 2016, 1:00 PM
#5
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

I should had posted the entire log...lazy me.

....hum, and forgot to mentioned , that the site is on maintanance, and that IP is not mine...
So, anyway, just one log file until now.

[04-Jun-2016 10:17:22 Europe/Lisbon] 

Request URI: /historia/historia-geral/a-vida-quotidiana-da-mulher-na-roma-antiga, IP address: 173.252.115.165

#1  trigger_error() called at [/xxxxxxx/xxxxxxx/public_html/includes/classes/db/mysql/query_factory.php:167]
#2  queryFactory->show_error() called at [/xxxxxxx/xxxxxxx/public_html/includes/classes/db/mysql/query_factory.php:139]
#3  queryFactory->set_error() called at [/xxxxxxx/xxxxxxx/public_html/includes/classes/db/mysql/query_factory.php:266]
#4  queryFactory->Execute() called at [/xxxxxxx/xxxxxxx/public_html/includes/functions/sessions.php:69]
#5  _sess_write()
#6  session_write_close() called at [/xxxxxxx/xxxxxxx/public_html/includes/functions/functions_general.php:45]
#7  zen_redirect() called at [/xxxxxxx/xxxxxxx/public_html/includes/init_includes/init_customer_auth.php:97]
#8  require(/xxxxxxx/xxxxxxx/public_html/includes/init_includes/init_customer_auth.php) called at [/home/xxxxxxx/xxxxxxx/includes/autoload_func.php:48]
#9  require(/xxxxxxx/xxxxxxx/public_html/includes/autoload_func.php) called at [/xxxxxxx/xxxxxxx/public_html/includes/application_top.php:170]
#10 require(/xxxxxxx/xxxxxxx/public_html/includes/application_top.php) called at [/xxxxxxx/xxxxxxx/public_html/index.php:26]

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

4 Jun 2016, 1:21 PM
#6
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

That's Facebook checking you out!

Now I'm wondering if that log you're receiving is because it's a robot visit during Maintenance Mode. What I'd suggest, just to capture some information if this occurs in the future, is to update your copy of /includes/init_includes/init_customer_auth.php (around line 97), adding the line in red:

  case ($down_for_maint_flag && DOWN_FOR_MAINTENANCE_TYPE == 'strict'):
    // if DFM is in strict mode, then block access to all pages:
    zen_redirect(zen_href_link(DOWN_FOR_MAINTENANCE_FILENAME));
  break;

  case ((DOWN_FOR_MAINTENANCE == 'true') && !in_array($_GET['main_page'], array(FILENAME_LOGOFF, FILENAME_PRIVACY, FILENAME_CONTACT_US, FILENAME_CONDITIONS, FILENAME_SHIPPING))):
    // on special pages, if DFM mode is "relaxed", allow access to these pages
    if ($down_for_maint_flag && DOWN_FOR_MAINTENANCE_TYPE == 'relaxed') {
      [B]trigger_error (var_export ($_SESSION, true), E_USER_WARNING);[/B]
      zen_redirect(zen_href_link(DOWN_FOR_MAINTENANCE_FILENAME));  // <-- This is the "old" line 97
    }
  break;

That teeny addition will create a PHP Warning in a myDEBUG*.log file, including the line where it came from so that you can easily find it in the future, that contains the contents of the session at the time the redirect is requested.

If you find such a log that is followed by the database error, we'll have some more information to determine what is going on!

4 Jun 2016, 2:07 PM
#7
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

ok , I've added to the file.
Thanks

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

4 Jun 2016, 2:33 PM
#8
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

mesnitu:

ok , I've added to the file.
Thanks
Excellent! If you find one of those logs again, we'll have some additional information that can be used to fully diagnose the issue.

4 Jun 2016, 2:35 PM
#9
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

mesnitu:

So 5 minutes, the the session goes down, that's why you're saying 5 minutes ?

5 minutes on each side (when reviewing the server access logs) has been the suggested time as I recall for chasing down an "access" issue that gets logged like this. It also gives an idea of what is/was going on during that time in a bigger view. In this case, since lat9 identified the "visitor" as a bot of sorts, would likely see that "random" pages were being visited. Had that part not been known, it would be an indicator that the visitor had some "familiarity" with what was on the site and was just trying to get to something. This would be different than say a customer that is more likely to try the product then maybe a login or other "readily" available options that might be displayed on a main screen.

The frequent thought is also that the error was logged at the exact time when the visitor was seen in the logs and on a busy site, that may hide what is truly going on.

Looks like going down the right path though to resolving this. :)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

4 Jun 2016, 3:28 PM
#10
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

Well, I've placed the site online and pinged with sitemap, and a lot of logs were generated
They are all related with that trigger erro, and crawl bots:

[04-Jun-2016 16:10:05 Europe/Lisbon] Request URI: /index.php?main_page=index&manufacturers_id=47&sort=3a&page=3, IP address: 66.249.64.193
#1  trigger_error() called at [/xxxxxx/xxxxxx/xxxxxx/includes/init_includes/init_customer_auth.php:97]
#2  require(/xxxxxx/xxxxxx/xxxxxx/includes/init_includes/init_customer_auth.php) called at [/home/xxxxxx/xxxxxx/includes/autoload_func.php:48]
#3  require(/home/xxxxxx/xxxxxx/includes/autoload_func.php) called at [/home/xxxxxx/xxxxxx/includes/application_top.php:170]
#4  require(/home/xxxxxx/xxxxxx/includes/application_top.php) called at [/home/xxxxxx/xxxxxx/index.php:26]

[04-Jun-2016 16:10:05 Europe/Lisbon] PHP Warning:  array (
  'customers_host_address' => 'crawl-66-249-64-193.googlebot.com',
  'cartID' => '',
  'cart' => 
  shoppingCart::__set_state(array(
     'contents' => 
    array (
    ),
     'total' => 0,
     'weight' => 0,
     'content_type' => false,
     'free_shipping_item' => 0,
     'free_shipping_weight' => 0,
     'free_shipping_price' => 0,
     'download_count' => 0,
     'total_before_discounts' => 0,
     'display_debug_messages' => false,
     'flag_duplicate_msgs_set' => false,
  )),
  'language' => 'portugues',
  'languages_id' => '2',
  'languages_code' => 'pt',
  'securityToken' => 'f9962743c5b1697d9230e826a0c43950',
  'check_valid' => 'true',
  'navigation' => 
  navigationHistory::__set_state(array(
     'path' => 
    array (
      0 => 
      array (
        'page' => 'index',
        'mode' => 'NONSSL',
        'get' => 
        array (
          'manufacturers_id' => '47',
          'sort' => '3a',
          'page' => '3',
        ),
        'post' => 
        array (
        ),
      ),
    ),
     'snapshot' => 
    array (
    ),
  )),
  'currency' => 'EUR',
) in /home/xxxxxx/xxxxxx/includes/init_includes/init_customer_auth.php on line 97

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

4 Jun 2016, 3:47 PM
#11
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

Was the store maintained online or was it put back in maintenance mode?

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

4 Jun 2016, 4:06 PM
#12
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

@mesnitu, now that you've captured that information, you should remove that trigger_error call from that file.

4 Jun 2016, 4:07 PM
#13
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

mc12345678:

Was the store maintained online or was it put back in maintenance mode?
If you'd look at the code posted above, that log will be generated only when the site is in maintenance mode.

4 Jun 2016, 4:20 PM
#14
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

@mesnitu, I just noticed that the log you posted had the session information, but no associated PHP error; that's what I'm looking for: a log that identifies the database error accompanied by that additional session-data.

4 Jun 2016, 4:28 PM
#15
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

The site is online now....
I stupid deleted the logs :blush: , but that was it , I've pasted the complete report....

If anything else cames up, I'll post it here.

Thanks

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

4 Jun 2016, 5:38 PM
#16
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

lat9:

If you'd look at the code posted above, that log will be generated only when the site is in maintenance mode.
Yes, that's what I would expect though not at the code to see where it actually got inserted, if it was applied (by choice) elsewhere, etc... The description was put online then got error which doesn't match the expectation. Especially didn't match the expectation of the trigger error being on line 97...... (if the store was back online.)

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...

5 Jun 2016, 7:20 AM
#17
mesnitu avatar

mesnitu

Totally Zenned

Join Date:
Aug 2014
Location:
Lisbon
Posts:
597
Plugin Contributions:
0

Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

Well, with the site now online, today I got 3 of this logs.

...nothing happens, but here they are.
I've made a upgrade from 151 to 155.... perhaps its best to truncate this table ? Perhaps some "garbage" is there ?

Thanks

[04-Jun-2016 23:04:24 Europe/Lisbon] 
Request URI: /index.php?main_page=product_bookx_info&cPath=34_119&products_id=1692&zenid=5h5d8rl9dpq0ijuhajjuqbmtm5, IP address: 82.155.133.129
#1  trigger_error() called at [/home/xxxxxx/xxxxxx/includes/classes/db/mysql/query_factory.php:167]
#2  queryFactory->show_error() called at [/home/xxxxxx/xxxxxx/includes/classes/db/mysql/query_factory.php:139]
#3  queryFactory->set_error() called at [/home/xxxxxx/xxxxxx/includes/classes/db/mysql/query_factory.php:266]
#4  queryFactory->Execute() called at [/home/xxxxxx/xxxxxx/includes/functions/sessions.php:69]
#5  _sess_write()
#6  session_write_close() called at [/home/xxxxxx/xxxxxx/includes/application_bottom.php:16]
#7  require(/home/xxxxxx/xxxxxx/includes/application_bottom.php) called at [/xxxxxx/xxxxxx/public_html/index.php:105]

[04-Jun-2016 23:04:24 Europe/Lisbon] 
PHP Fatal error:  1048:Column 'value' cannot be null :: insert into sessions (sesskey, expiry, `value`)
            values ('5h5d8rl9dpq0ijuhajjuqbmtm5', 1465079304, null)
            ON DUPLICATE KEY UPDATE `value`=null, expiry=1465079304 ==> (as called by) /home/xxxxxx/xxxxxx/includes/functions/sessions.php on line 69 <== in /home/xxxxxx/xxxxxx/includes/classes/db/mysql/query_factory.php on line 167

“Though the problems of the world are increasingly complex, the solutions remain embarrassingly simple.” ― Bill Mollison

7 Jan 2017, 5:15 PM
#18
lat9 avatar

lat9

Administrator

Join Date:
Sep 2009
Location:
Stuart, FL
Posts:
14,119
Plugin Contributions:
56

Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

Circling back on this one.

Since a session is not *normally *created for spiders (under the control of Configuration->Sessions->Prevent Spider Sessions), if a store's SQL mode is set for STRICT_TRANS_TABLES, then the $val passed into the _sess_write function (present in /includes/functions/sessions.php) is going to be null when a spider's session has ended.

Examining the database class' *bindVars *method, using a *string *bindType can result in a **null **value being returned, which is a "bad thing" in this case, since the value field can't be null per the *sessions *database-table's configuration.

  function _sess_write($key, $val) {
    global $db;
    if (!is_object($db)) return;
    $val = base64_encode($val);

    global $SESS_LIFE;
    $expiry = time() + $SESS_LIFE;

    $sql = "insert into " . TABLE_SESSIONS . " (sesskey, expiry, `value`)
            values (:zkey, :zexpiry, :zvalue)
            ON DUPLICATE KEY UPDATE `value`=:zvalue, expiry=:zexpiry";
    $sql = $db->bindVars($sql, ':zkey', $key, 'string');
    $sql = $db->bindVars($sql, ':zexpiry', $expiry, 'integer');
    $sql = $db->bindVars($sql, ':zvalue', $val, 'string');
    $result = $db->Execute($sql);

    return (!empty($result) && !empty($result->resource));
  }

I suggest changing that function to use the *stringIgnoreNull *type instead, since that bindType will always result in a quoted string:

  function _sess_write($key, $val) {
    global $db;
    if (!is_object($db)) return;
    $val = base64_encode($val);

    global $SESS_LIFE;
    $expiry = time() + $SESS_LIFE;

    $sql = "insert into " . TABLE_SESSIONS . " (sesskey, expiry, `value`)
            values (:zkey, :zexpiry, :zvalue)
            ON DUPLICATE KEY UPDATE `value`=:zvalue, expiry=:zexpiry";
    $sql = $db->bindVars($sql, ':zkey', $key, 'string');
    $sql = $db->bindVars($sql, ':zexpiry', $expiry, 'integer');
    $sql = $db->bindVars($sql, ':zvalue', $val, '[B]stringIgnoreNull[/B]');
    $result = $db->Execute($sql);

    return (!empty($result) && !empty($result->resource));
  }
7 Jan 2017, 11:16 PM
#19
website_rob avatar

website_rob

Inactive

Join Date:
Oct 2006
Location:
Alberta, Canada
Posts:
4,572
Plugin Contributions:
0

Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

Might want to flesh that out a bit. I tried your code with MySQL in STRICT_TRANS_TABLES mode and got a broken page with the error msg.

var-type undefined: stringIgnoreNull

The learning is in the doing.

Potent Products

8 Jan 2017, 6:59 AM
#20
mc12345678 avatar

mc12345678

Totally Zenned

Join Date:
Jul 2012
Posts:
16,908
Plugin Contributions:
2

Re: Fatal error: 1048:Column 'value' cannot be null :: insert into sessions (sesskey, ex

lat9:

Circling back on this one.

Since a session is not *normally *created for spiders (under the control of Configuration->Sessions->Prevent Spider Sessions), if a store's SQL mode is set for STRICT_TRANS_TABLES, then the $val passed into the _sess_write function (present in /includes/functions/sessions.php) is going to be null when a spider's session has ended.

Examining the database class' *bindVars *method, using a *string *bindType can result in a **null **value being returned, which is a "bad thing" in this case, since the value field can't be null per the *sessions *database-table's configuration.

function _sess_write($key, $val) {
global $db;
if (!is_object($db)) return;
$val = base64_encode($val);

global $SESS_LIFE;
$expiry = time() + $SESS_LIFE;

$sql = "insert into " . TABLE_SESSIONS . " (sesskey, expiry, `value`)
        values (:zkey, :zexpiry, :zvalue)
        ON DUPLICATE KEY UPDATE `value`=:zvalue, expiry=:zexpiry";
$sql = $db->bindVars($sql, ':zkey', $key, 'string');
$sql = $db->bindVars($sql, ':zexpiry', $expiry, 'integer');
$sql = $db->bindVars($sql, ':zvalue', $val, 'string');
$result = $db->Execute($sql);

return (!empty($result) && !empty($result->resource));

}

> I suggest changing that function to use the *stringIgnoreNull *type instead, since that bindType will always result in a quoted string:
> ```
  function _sess_write($key, $val) {
    global $db;
    if (!is_object($db)) return;
    $val = base64_encode($val);

    global $SESS_LIFE;
    $expiry = time() + $SESS_LIFE;

    $sql = "insert into " . TABLE_SESSIONS . " (sesskey, expiry, `value`)
            values (:zkey, :zexpiry, :zvalue)
            ON DUPLICATE KEY UPDATE `value`=:zvalue, expiry=:zexpiry";
    $sql = $db->bindVars($sql, ':zkey', $key, 'string');
    $sql = $db->bindVars($sql, ':zexpiry', $expiry, 'integer');
    $sql = $db->bindVars($sql, ':zvalue', $val, '[B]stringIgnoreNull[/B]');
    $result = $db->Execute($sql);

    return (!empty($result) && !empty($result->resource));
  }

I've been trying to understand this since I read it several hours ago. I'm guessing that some amount of testing went into it, but I've been having difficulty following the above discussion as I have tried to lay out below even if the solution stops the error that was reported/described.

Not sure if it's the description of how this occurs or the recommended solution that doesn't seem right, but if the $val of null is passed into _sess_write (as a non-string), then base64_encode(null) is going to error and $val is not going to get set, and presumably a different error message would result. If the incoming $val is "null" (as a string) then it would get base64_encoded and therefore the result would not include the preg_match string of NULL because it would be encoded and the storage of that encoded value would not cause an error because it would be a string.

The next thing is that in order for the bindVars function to see $val = "null" would be that the $val passed into the function would have to have been the base64_decode of "null" which is not the same as passing null into the _sess_write function (pointing out that the above describes the condition differently).

Working back from that (the fact that the $val going to bindVars would contain the text of 'NULL'), the val coming into the function would have to be base64_decode('NULL') (instead of just null as described above), which doesn't exactly make sense unless that is some sort of default behavior of the session not having been started.

The other thing though is that if SESSION_FORCE_COOKIE_USE is set to true and a cookie becomes setable, then the session could be started and the whole spiders block thing doesn't do anything.

Why though would it be desired to save a null session value if the session was never started (assuming spiders are ignored and cookie use is not forced to true) and based on the expected action of not storing/maintaining a session and not expecting the session to be restored? Wouldn't the expectation be that both the read and write session code get rewritten to bypass that null condition/situation? In the write function before encoding the value take an action like, if $val == base64_decode('NULL') then return;

and on _sess_read add $value->fields['value'] != 'NULL' to the test of whether to base64_decode the value or not, though that would mean that the entire session got stored as 'NULL' rather than as an encoded series of data pairs using key | value similar to:

securityToken|s:32:"00000000000000000000000000000000";customers_host_address|s:12:"xx.xx.xxx.xx";ip_blocker_pass|b:0;cartID|s:0:"";cart|O:12:"shoppingCart":11:{s:8:"contents";a:0:{}s:5:"total";i:0;s:6:"weight";i:0;s:12:"content_type";b:0;s:18:"free_shipping_item";i:0;s:20:"free_shipping_weight";i:0;s:19:"free_shipping_price";i:0;s:14:"download_count";i:0;s:22:"total_before_discounts";i:0;s:22:"display_debug_messages";b:0;s:23:"flag_duplicate_msgs_set";b:0;}check_valid|s:4:"true";navigation|O:17:"navigationHistory":2:{s:4:"path";a:1:{i:0;a:4:{s:4:"page";s:12:"product_info";s:4:"mode";s:6:"NONSSL";s:3:"get";a:3:{s:5:"cPath";s:1:"0";s:11:"products_id";s:1:"3";s:5:"zenid";s:32:"00000000000000000000000000000000";}s:4:"post";a:0:{}}}s:8:"snapshot";a:4:{s:4:"page";s:12:"product_info";s:4:"mode";s:6:"NONSSL";s:3:"get";a:3:{s:5:"cPath";s:1:"0";s:11:"products_id";s:1:"3";s:5:"zenid";s:32:"00000000000000000000000000000000";}s:4:"post";a:0:{}}}language|s:7:"english";languages_id|s:1:"1";languages_code|s:2:"en";currency|s:3:"USD";today_is|s:10:"2017-01-07";updateExpirations|b:1;session_counter|b:1;customers_ip_address|s:12:"xx.xx.xxx.xx";

I mean, I think I can see where the suggestion of using the ignore null version of bindVars could be a good idea, but I don't see that it was fully/accurately described in the previous message.

Website Rob:

Might want to flesh that out a bit. I tried your code with MySQL in STRICT_TRANS_TABLES mode and got a broken page with the error msg.

var-type undefined: stringIgnoreNull

Do/did you have the appropriate version 1.5.5 of ZC installed? The datatype was added in 1.5.5a with preparation to transition to using 'NULL' in zen_db_input, but that was rolled back from version c to version d take 2 which was issued a few days after the first notification of version d.

in includes/classes/db/mysql/query_factory.php there is a section within the function getBindVarValue() related to strings with the following:

      case 'string':
        if (preg_match('/NULL/', $value)) return 'null';
        return '\'' . $this->prepare_input($value) . '\'';
      break;
      case 'stringIgnoreNull':
        return '\'' . $this->prepare_input($value) . '\'';
        break;
      case 'noquotestring':
        return $this->prepare_input($value);
      break;

The first provides the results described as needing to be "undone".

Previously there were just two string related actions:

      case 'string':
        return '\'' . $this->prepare_input($value) . '\'';
      break;
      case 'noquotestring':
        return $this->prepare_input($value);
      break;

ZC Installation/Maintenance Support <- Site
Contribution for contributions welcome...