Opened 15 years ago
Closed 15 years ago
#17459 closed defect (bug) (invalid)
wp_insert_post doesn't catch query failure
| Reported by: | lonnylot | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Query | Version: | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
When we insert the post into the DB in wp-includes/post.php on line 2565 we check to see if the return is === false. $wpdb->insert will NEVER return false. It will only return -1 or the number of affected rows.
Change History (4)
#1
@
15 years ago
- Milestone Awaiting Review
- Resolution → invalid
- Status new → closed
Version 0, edited 15 years ago by
(next)
#2
@
15 years ago
- Milestone → Awaiting Review
- Resolution invalid
- Status closed → reopened
$wpdb->insert() can return false, but it can also return mysql_affected_rows(), which on failure is -1.
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
This is simply not true. $wpdb->insert() returns FALSE on error.
-1 is usually returned in an AJAX request, so something else is going on in your case.
Please use the support forums: http://wordpress.org/support/