Bug 456681 - queries compatability between bz2.18 and bz3.2
Summary: queries compatability between bz2.18 and bz3.2
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Bugzilla
Classification: Community
Component: Query/Bug List
Version: 3.2
Hardware: All
OS: Linux
low
low
Target Milestone: ---
Assignee: Noura El hawary
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: RHBZ30UpgradeTracker
TreeView+ depends on / blocked
 
Reported: 2008-07-25 15:03 UTC by Noura El hawary
Modified: 2013-06-24 04:04 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2008-07-30 20:15:21 UTC
Embargoed:


Attachments (Terms of Use)
v1 patch to remove format=ft and fix ordering in named queries for 3.2 bz (1.11 KB, patch)
2008-07-28 05:25 UTC, Noura El hawary
no flags Details | Diff
v2 for fixing sql queries (1.63 KB, patch)
2008-07-28 13:10 UTC, Noura El hawary
dkl: review-
Details | Diff

Description Noura El hawary 2008-07-25 15:03:29 UTC
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

Comment 1 Noura El hawary 2008-07-25 15:21:46 UTC
(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





Comment 2 Noura El hawary 2008-07-28 05:25:33 UTC
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

Comment 3 Noura El hawary 2008-07-28 13:10:18 UTC
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 4 David Lawrence 2008-07-28 20:06:55 UTC
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;

Comment 5 Noura El hawary 2008-07-29 04:13:25 UTC
Thanks for the review Dave, I applied your modifications to the patch and
committed to cvs.

Noura

Comment 6 David Lawrence 2008-07-30 20:15:21 UTC
Pushed to partner-bugzilla.redhat.com today.


Note You need to log in before you can comment on or make changes to this bug.