few issues found in the saved queries between BZ 2.18 and 3.2: 1- in 2.18 we have ordering bugs by Bug Number Ascending and Bug Number Descending which is a redhat customization , in 3.2 there is only ordering bug Bug Number which is Ascending , this will make saved queries from 2.18 fail in 3.2 to sole we either: - fix saved queries from 2.18 by deleting the strings "+Ascending" and "+Descending" from the saved queries strings - Add the redhat ordering customization to 3.2 2- also in 2.18 there is in the savequeries query format that is called "ft" which doesn't exist in 3.2, so also all saved queries with format=ft will fail in 3.2 , solution: - remove "format=ft" string from all saved quries strings in 2.18. - or ?? Noura
(In reply to comment #0) > few issues found in the saved queries between BZ 2.18 and 3.2: > > 1- in 2.18 we have ordering bugs by Bug Number Ascending and Bug Number > Descending which is a redhat customization , in 3.2 there is only ordering bug > Bug Number which is Ascending , this will make saved queries from 2.18 fail in 3.2 > to sole we either: > - fix saved queries from 2.18 by deleting the strings "+Ascending" and > "+Descending" from the saved queries strings > - Add the redhat ordering customization to 3.2 > > As Discussed with Dave: 1- leave the drop down in query.cgi the way it is. 2- change all Bug Number Ascending to just Bug Number 3- and change Descending to bugs.bug_id+desc > 2- also in 2.18 there is in the savequeries query format that is called "ft" > which doesn't exist in 3.2, so also all saved queries with format=ft will fail > in 3.2 , solution: > - remove "format=ft" string from all saved quries strings in 2.18. > - or ?? remove
Created attachment 312751 [details] v1 patch to remove format=ft and fix ordering in named queries for 3.2 bz patch to the script update_cf_queries.pl that will : 1- remove &format=ft from named queries strings. 2- replace order=Bug Number Ascending with order=Bug Number 3- replace oder-Bug Number Descending with order=bugs.bug_id desc so far i have tested by applying queries from the commandline and testing the queries after conversion on partner-bugzilla and all went good, will do the actual real testing with today's migration for bz-web2 Noura
Created attachment 312768 [details] v2 for fixing sql queries found out one more query string the needs removing query_format=ft, also added all those condition to the sql query that picks up invalid conditions. tested on bz-web2 and seems to be working fine Noura
Comment on attachment 312768 [details] v2 for fixing sql queries >Index: update_cf_queries.pl >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/redhat/update_cf_queries.pl,v >retrieving revision 1.1 >diff -p -u -r1.1 update_cf_queries.pl >--- update_cf_queries.pl 2 May 2008 15:33:29 -0000 1.1 >+++ update_cf_queries.pl 28 Jul 2008 13:07:21 -0000 >@@ -32,7 +32,7 @@ else { > or die "Couldn't connect database: " . DBI->errstr; > > my @custom_fields >- = qw/'%devel_whiteboard%' '%qa_whiteboard%' '%internal_whiteboard%' '%fixed_in%' '%cust_facing%' '%issuetracker%'/; >+ = qw/'%devel_whiteboard%' '%qa_whiteboard%' '%internal_whiteboard%' '%fixed_in%' '%cust_facing%' '%issuetracker%' '%Ascending%' '%Descending%' '%format=ft%' '%query_format=ft%'/; > > my $condition = join( " OR query LIKE ", @custom_fields ); > >@@ -54,7 +54,7 @@ else { > "UPDATE namedqueries SET query = ? WHERE userid = ? AND name = ?" > ); > $update_query_sth->execute( $new_query, $userid, $name ); >- >+ print "$userid, $name\n\n"; > $count++; > } > >@@ -115,6 +115,16 @@ sub convert_query { > my $new_query = canonicalise_query($cgi); > $new_query =~ s/=$_/=cf_$_/g foreach @custom_fields; > >+ # remove format "&format=ft" from the query string >+ $new_query =~ s/&format=ft//g; >+ $new_query =~ s/&query_format=ft//g; Make the '&' optional just in case the format or query_format is at the beginning of the stored query string. $new_query =~ s/&?format=ft//g; $new_query =~ s/&?query_format=ft//g; >+ >+ # change Bug Number Ascending to just Bug Number >+ $new_query =~ s/Bug%20Number%20Ascending/Bug%20Number/g; Need to also account for '+' instead of just '%20'. $new_query =~ s/Bug(%20|\+)Number(%20|\+)Ascending/Bug%20Number/g; >+ # change Bug Number Descending to bugs.bug_id+desc >+ $new_query =~ s/Bug%20Number%20Descending/bugs\.bug_id%20desc/g; $new_query =~ s/Bug(%20|\+)Number(%20|\+)Descending/bugs\.bug_id%20desc/g;
Thanks for the review Dave, I applied your modifications to the patch and committed to cvs. Noura
Pushed to partner-bugzilla.redhat.com today.