Join GitHub today
Issue with product paging - total number match but some product missing while others duplicate in different page #2851
I have multiple taxonomies, one of which only have a root taxon with the same name as the taxonomy.
Looking into the log, for different page with same taxon, the difference in db query is only the "OFFSET" value.
If I run the query directly against the DB, here is the result (showing product ids only):
See the result in page 2 are not sorted in product id and there are 7 out of 12 products from page 1 !
source 'https://rubygems.org' ruby '1.9.3' gem 'rails', '3.2.11' # Bundle edge Rails instead: # gem 'rails', :git => 'git://github.com/rails/rails.git' gem 'pg' # Gems used only for assets and not required # in production environments by default. group :assets do gem 'sass-rails', '~> 3.2.3' gem 'coffee-rails', '~> 3.2.1' # See https://github.com/sstephenson/execjs#readme for more supported runtimes # gem 'therubyracer', :platforms => :ruby gem 'uglifier', '>= 1.0.3' end gem 'jquery-rails' # To use ActiveModel has_secure_password # gem 'bcrypt-ruby', '~> 3.0.0' # To use Jbuilder templates for JSON # gem 'jbuilder' # Use unicorn as the app server # gem 'unicorn' # Deploy with Capistrano # gem 'capistrano' # To use debugger # gem 'debugger' # Using spree gem 'spree', '1.2.4' gem 'spree_auth_devise', :github => 'spree/spree_auth_devise', :branch => '1-2-stable' gem 'spree_static_content', :git => 'git://github.com/spree/spree_static_content.git', :branch => '1-2-stable' gem 'spree_gateway', :git => 'git://github.com/spree/spree_gateway.git', :branch => "1-1-stable" # make sure to include after spree gem 'spree_paypal_express', :git => 'git://github.com/spree/spree_paypal_express.git', :branch => "1-2-stable" gem "spree_product_zoom", :git => "git://github.com/spree/spree_product_zoom.git" gem 'thin'
I really don't know.
On 2013-4-29, at 16:46, "Ryan Bigg" email@example.com wrote:
Hi£¬Ryan£¬I really dont know what made this happen. But as I said I can get the same products when i run the query directly against DB. So seems to me it's not a spree issue but a DB state issue. Maybe I can send you my DB data to your private email£¿
On 2013-4-30, at 17:37, "Ryan Bigg" firstname.lastname@example.org wrote:
Hi, Ryan,I couldn't verify directly use my app due to dependency problem.But from the query result it seems the issue is fixed.Can you tell me how and when I can get the fix using official git.I was using 1.2.4 and don't want to jump too much.Thanks a lot.
Date: Mon, 6 May 2013 00:19:13 -0700
Hey @colokoala, could you please try my 1-2-stable branch?
gem 'spree', :github => "radar/spree", :branch => "1-2-stable"
It looks to me like I've fixed it there and just want you to confirm for me.
added a commit
May 8, 2013
The fix should be available on the current git right now.
On Wed, May 8, 2013 at 4:34 PM, colokoala email@example.com
Not a spree user, but isn't this issue due to the fact that SQL doesn't guarantee consistent ordering of results? According to this: http://www.postgresql.org/docs/9.2/static/queries-limit.html
You will get this issue unless ORDER BY is used. Does DISTINCT ON fix this or hide the issue?