WordPress.org

Make WordPress Core

Opened 16 months ago

Last modified 16 months ago

#22845 new enhancement

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

Reported by: copesc Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.4.2
Component: General 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 (4)

comment:1 copesc16 months 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.

comment:3 SergeyBiryukov16 months ago

  • Version changed from trunk to 3.4.2

comment:4 copesc16 months 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).

Note: See TracTickets for help on using tickets.