I would prefer an INSERT ... ON DUPLICATE KEY ... for MySQL.
Longer syntax, but does performs an UPDATE if the insert fails versus always doing a DELETE + INSERT (if I remember correctly).
I would prefer an INSERT ... ON DUPLICATE KEY ... for MySQL.
Longer syntax, but does performs an UPDATE if the insert fails versus always doing a DELETE + INSERT (if I remember correctly).
After 10 days without generating the MyDebug file, I was beginning to think that all was fine though I did not schedule a PCI scan on the first of the month which historically I see the file generated many times during a scan.
Overnight, the 100K MyDebug file was generated.
Rick
RixStix (dot) com
aka: ChainWeavers (dot) com
Just to close the loop here ...
We've opted for ON DUPLICATE KEY UPDATE for ZC v1.6.0:
https://github.com/zencart/zencart/pull/244/files
and
https://github.com/zencart/zencart/pull/245/files
(Text in red is stuff that was removed. Text in green is stuff that was added/changed.
Basically, remove all the lines that are shown as starting with a "-", and replace/add all lines that are shown as starting with a "+". The red and green are just clarifying guides.)
.
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.
I don't wish to be a pain, but is this really the best of the possible solutions?
What happens when two visitors get given the same sessionID, but only one can be entered into the database, wouldn't the "on duplicate key" effectively cause customer#2 to 'steal' the SessionID assigned to customer#1?
On the other hand, the 'insert ignore' will cause customer#2's insert to fail, which I assume will result in a new sessionID being generated for them, and customer#1's sessionID would remain unchanged.
I'm not seeing any benefits with the 'on duplicate key update' in this particular scenario.
Just my 2cents worth.
Cheers
RodG
The place in sessions.php where the "ON DUPLICATE KEY UPDATE" occurs is only called at the END of a script or when PHP needs to write / update the existing session in the database. The same code block also updates the expiry information for the session). Validation and session creation happen earlier in the process.
The change in "sessions.php" basically replaces an existing "select; insert if not in database, update if in database" with a "insert in database, if cannot insert then update instead". By removing the first "select" and using the "on duplicate update", we remove a race condition - typically experienced when people use "multiple windows or tabs" in the browser.
The glass is not half full. The glass is not half empty. The glass is simply too big!
Where are the Zen Cart Debug Logs? Where are the HTTP 500 / Server Error Logs?
Zen Cart related projects maintained by lhûngîl : Plugin / Module Tracker
I may be misunderstanding something but there are 2 similar threads but offer different solutions.
1 edits sessions.php
1 edits cache.php
The edit to sessions.php did not appear to make any difference in the log files generated.
The edit to cache.php did have an effect. ie: the log files are no longer generated.
Can someone clear my clouded head? Are they intended to resolve different 1062: duplicate entry log files or are they 2 different attempts to resolve the same issue? Or are they both required to resolve the same issue?
Rick
RixStix (dot) com
aka: ChainWeavers (dot) com
Similar issue, two different cases.
.
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.
Do you think this note warrants inclusion in the 1.5.4 fixes thread?
http://www.zen-cart.com/showthread.p...s)-with-v1-5-4
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
.
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.