I would like to spend 2 blocks, the 1st block with the 1st item and the 2nd block with the 2nd item.

If I limit the output, for the 1st block 1 item and offset 0, I get the 2nd item.

If I do the same for the 2nd block and offset 1, the same will come out (correct and normal here)

Example output of the news. the first 2 news should be output in individual blocks.

this problem arises when the creation date is exactly the same to the second and you sort by creation date (Content: Written on (descending)).
Example
Node 1: 30.01.2020 13:45:23
Node 2: 30.01.2020 13:45:23

Comments

HeavyStoneHead created an issue. See original summary.

swatichouhan012’s picture

Assigned: Unassigned » swatichouhan012
swatichouhan012’s picture

Assigned: swatichouhan012 » Unassigned
Status: Active » Needs review
StatusFileSize
new73.14 KB
new73.07 KB

@HeavyStoneHead I checked issue with your steps but didn't get any issue in view module . i am getting right result as it should be.

Steps which i followed.

step 1 ) created 2 nodes. Node 1 and node 2 both have same creation date "30.01.2020 13:45:23".
Step 2) created a view with 2 different view block Block 1, Block 2.
Step 3) In Block 1 content is in descending order and offset set to 0 with limit 1 ,,, in this case i am getting "Node 2" as result of first block

Step 4 ) in Block 2 content us in desending order and offet set to 1 with limit 1.... Now i am getting "Node 1" as result of second block.

Its working as expected i am adding screenshot here please recheck and make sure both block are should be "Block override inplace of "All Display".

lendude’s picture

Status: Needs review » Postponed (maintainer needs more info)
Issue tags: -views +Needs steps to reproduce

Based on #3, tagging for steps to reproduce on a clean Drupal install.

heavystonehead’s picture

StatusFileSize
new50.89 KB
new109.84 KB
new107.88 KB
new108.27 KB
new142.17 KB
new146.52 KB

I had problems reproducing, especially with a new installation. I think the problem is that you also need a third content that is older

longwave’s picture

Category: Bug report » Support request
Status: Postponed (maintainer needs more info) » Fixed
Issue tags: -Needs steps to reproduce

This is a deterministic sort order problem in MySQL, which is documented at https://dev.mysql.com/doc/refman/5.7/en/limit-optimization.html and also in a number of MySQL bug reports e.g. https://bugs.mysql.com/bug.php?id=72076 - the relevant sentence is:

If multiple rows have identical values in the ORDER BY columns, the server is free to return those rows in any order, and may do so differently depending on the overall execution plan. In other words, the sort order of those rows is nondeterministic with respect to the nonordered columns.

The fix is to add a secondary sort by something that is unique, such as node ID; this will guarantee that there is only one possible order that the results can be returned in.

I don't think we should consider this a bug in Drupal, rather a limitation in the underlying database engine; we can't automatically add a secondary sort as it is possible this is not always wanted.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.