sept 08 2008

Le bug corrigé

Publié par Bertrand à 21:04 dans Non classé

Voici la trace de debug générée par le plugin PDO. La requete rejouée dans sqlite manager me donnait 0. En fait pour sqlite il semblerait que ‘08′=08 retourne false alors que la même requête avec jste l’année consdérait que ‘2008′=2008. Peut être un bug de ma version de sqlite.

Raw query:	SELECT  count(*) FROM  wp_posts  WHERE 1=1  AND YEAR(wp_posts.post_date)=2008 AND MONTH(wp_posts.post_date)=08 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish')  ORDER BY wp_posts.post_date DESC 
Rewritten: SELECT  count(*) FROM  wp_posts  WHERE 1=1  AND strftime('%Y',wp_posts.post_date) =2008 AND strftime('%m',wp_posts.post_date) =08 AND wp_posts.post_type = 'post' AND (wp_posts.post_status = 'publish')  ORDER BY wp_posts.post_date DESC 
WITH Placeholders: SELECT  count(*) FROM  wp_posts  WHERE 1=1  AND strftime( ? ,wp_posts.post_date) =2008 AND strftime( ? ,wp_posts.post_date) =08 AND wp_posts.post_type =  ?  AND (wp_posts.post_status =  ? )  ORDER BY wp_posts.post_date DESC  
Prepare:	SELECT  count(*) FROM  wp_posts  WHERE 1=1  AND strftime( ? ,wp_posts.post_date) =2008 AND strftime( ? ,wp_posts.post_date) =08 AND wp_posts.post_type =  ?  AND (wp_posts.post_status =  ? )  ORDER BY wp_posts.post_date DESC 
Executing:	 Array
(
    [0] => %Y
    [1] => %m
    [2] => post
    [3] => publish
)

Poster le premier commentaire

Poster une réponse


Hébergement 1&1 Dual essentiel 32 requêtes en 0,342 secondes.