Make WordPress Core

Opened 11 years ago

Last modified 5 years ago

#22845 assigned enhancement

On 32-bit systems, with post IDs higher than PHP_INT_MAX (2147483647) wordpress does not run fine

Reported by: copesc's profile copesc Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4.2
Component: Posts, Post Types Keywords: needs-patch
Focuses: Cc:

Description

Logging all the MySQL queries I discovered that the queries that should pick my posts were all doing something like this:

SELECT post_id, meta_key, meta_value FROM wp_postmeta WHERE post_id IN (2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647,2147483647)

This 2147483647 number clearly has something in it: it's the PHP_INT_MAX value on 32-bit operating systems, while on 64-bit machines it's 9223372036854775807 http://php.net/manual/en/language.types.integer.php

So, the problem is divided in 2 parts: I run on a 32 bit system, and I have my IDs a bit too high.

I know that 2147483647 is a bit high for a post ID, but I discovered this the hard way.
Now, I would have preferred an error message in the administrator interface. Do you think it's a good idea?

Change History (8)

#1 @copesc
11 years ago

The error message should only point you to upgrade to a 64-bit hosting / hardware, or to try to normalize the POST ids numbers.

#2 @ocean90
11 years ago

Related: #16445

#3 @SergeyBiryukov
11 years ago

  • Version changed from trunk to 3.4.2

#4 @copesc
11 years ago

Just an addition, this same problem will prevent an user from posting new blog posts, and no helpful message is outputted.

I forgot to reset the auto_increment value of the wp_posts table after sanitizing it, and I had no chance to publish the blog post, just 'Submit for Review’ and ‘Save Draft', but none of them working in the way you'd expect (e.g. not working).

#5 @wonderboymusic
10 years ago

  • Milestone changed from Awaiting Review to Future Release

#6 @chriscct7
8 years ago

  • Owner set to chriscct7
  • Status changed from new to assigned

#7 @SergeyBiryukov
8 years ago

  • Component changed from General to Posts, Post Types

#8 @chriscct7
8 years ago

  • Owner chriscct7 deleted
Note: See TracTickets for help on using tickets.