From dev-return-22026-archive-asf-public=cust-asf.ponee.io@netbeans.apache.org Fri Jun 18 21:46:50 2021 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mxout1-ec2-va.apache.org (mxout1-ec2-va.apache.org [3.227.148.255]) by mx-eu-01.ponee.io (Postfix) with ESMTPS id 3756718064E for ; Fri, 18 Jun 2021 23:46:50 +0200 (CEST) Received: from mail.apache.org (mailroute1-lw-us.apache.org [207.244.88.153]) by mxout1-ec2-va.apache.org (ASF Mail Server at mxout1-ec2-va.apache.org) with SMTP id 48C4743A3A for ; Fri, 18 Jun 2021 21:46:49 +0000 (UTC) Received: (qmail 13150 invoked by uid 500); 18 Jun 2021 21:46:48 -0000 Mailing-List: contact dev-help@netbeans.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@netbeans.apache.org Delivered-To: mailing list dev@netbeans.apache.org Received: (qmail 13133 invoked by uid 99); 18 Jun 2021 21:46:48 -0000 Received: from spamproc1-he-fi.apache.org (HELO spamproc1-he-fi.apache.org) (95.217.134.168) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 18 Jun 2021 21:46:48 +0000 Received: from localhost (localhost [127.0.0.1]) by spamproc1-he-fi.apache.org (ASF Mail Server at spamproc1-he-fi.apache.org) with ESMTP id A859EC049B for ; Fri, 18 Jun 2021 21:46:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamproc1-he-fi.apache.org X-Spam-Flag: NO X-Spam-Score: -0.001 X-Spam-Level: X-Spam-Status: No, score=-0.001 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.2, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, WEIRD_QUOTING=0.001] autolearn=disabled Authentication-Results: spamproc1-he-fi.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-ec2-va.apache.org ([116.203.227.195]) by localhost (spamproc1-he-fi.apache.org [95.217.134.168]) (amavisd-new, port 10024) with ESMTP id ZsmcXsQsEauE for ; Fri, 18 Jun 2021 21:46:46 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.221.174; helo=mail-vk1-f174.google.com; envelope-from=ebresie@gmail.com; receiver= Received: from mail-vk1-f174.google.com (mail-vk1-f174.google.com [209.85.221.174]) by mx1-ec2-va.apache.org (ASF Mail Server at mx1-ec2-va.apache.org) with ESMTPS id 70652BC48A for ; Fri, 18 Jun 2021 21:46:46 +0000 (UTC) Received: by mail-vk1-f174.google.com with SMTP id n131so2450025vke.1 for ; Fri, 18 Jun 2021 14:46:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=j8u0GG1+Hv/mx26gjCKwUQNGXlPhvV2deeBWIZjEGPI=; b=IaWSh0KaZZLx1e47sLsg6AagLYiuF2YQWpLe9YrwZtfCLT2hMDAf/zf0SkkEi9vwwQ AKH+MCliWr4SjkxLbMB4oQn6wH+3N4w+UizB2UH30cWtwXvN1dxnaS6tiEVWCev64nlt B0vR0bgFpStoyKbRA2+D1GqVliPuBHyBzlDVA+cMJ9GB+tYdIlb46gNr/64ZduFrxx1l cdLI1FPv8RCaBtoentBQjMTvgPoxKCQAYFUCtCORvAsSp+rZL5RufNw+iMwsBAH/LETQ 2cAZrK20bor2KSfkBBRZ6bq4i/w2cBj2FgHZKnxh6RbO73UBeIN4hWR+QCm/5RZUP+WC M8HA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=j8u0GG1+Hv/mx26gjCKwUQNGXlPhvV2deeBWIZjEGPI=; b=j54C7wmQTeLH2Gydn8UqBStOdP3Aq0IKVZvTphHb03SpA8/bkjaKdFf3cF6/onGei2 ++NveyQwxaq2ukbzLao8hVCybuccNynfRECprGd/32mvOxfCqY0vyTTEpGKt1H2Wo7Ts ge3FLZEDmBfSGXfww4tH6wbwaGrfyxRlYFqrYD2u3FgC8FuexX9WxEhrutodAMsFNSGe 58vhw5Oe3xP5TDc7D/GCdsowcrc+8FMwX7G4y+tjenIcERmPJ+AqIWl9MLtYq2wsF2Fq 1WoW0hQUcsUvql6/v9eEf4dVvMOrZ3pRKSevHkwwl5vMoKYrDIqs8gZOv7HhPs1jFZhj 1RGw== X-Gm-Message-State: AOAM532mpRBM1isDgGPgQhnxKjrNyJ40yFPmjylZnlfankAmE7c9TZW4 A9wKkiDkTW71JHX+GmvkexYVRA4FbAJ1tFEnKMNbNjn29mM= X-Google-Smtp-Source: ABdhPJy744fvpXAkB+0ozcfMmSaPFP9F0iY294zJvx3Dn2aqYQgfqdP6FgHSxyF1xift6EGuht+Eox+CsA88kb7yHYw= X-Received: by 2002:a1f:2d10:: with SMTP id t16mr8628240vkt.20.1624052799231; Fri, 18 Jun 2021 14:46:39 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Eric Bresie Date: Fri, 18 Jun 2021 16:46:28 -0500 Message-ID: Subject: Re: SQL Autocompletion - Quoter Refactoring breaks quoter check To: Netbeans Developer List Content-Type: multipart/alternative; boundary="00000000000031db8705c5114250" --00000000000031db8705c5114250 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Can anyone respond to this? As is, the PR from my perspective fixes the problem. The last change requested in the PR was made multiple times in multiple ways with the request was against an =E2=80=9Cout of date=E2=80=9D version = of files so not sure if the PR discussion is ready or able to be closed down. I believe re-architecting sql autocomplete functionality for connection vs connection less session to address quoting and/or sql standard quotes issue is probably out of scope of this ticket. If that is really preferred then maybe a new ticket to address that with more specific would be better for that. What do I need to do to get this accepted for inclusion? Eric On Sun, Jun 6, 2021 at 11:00 AM Eric Bresie wrote: > Okay...I've concluded my connectionless refactoring is breaking more unit > tests than preferred and is not a good viable option. > > I've reverted back to the state as of the last commit for the PR and woul= d > like some guidance from someone more well versed than I on how to handle > this. > > Assume can either > (1) take it as is in the PR and maybe write a new ticket on the refactor > aspect (Refactor SQL quoter to handle connection or connection less cases= ) > or > (2) if someone more well verses in the sql code can provide suggestions > for a new approach I would be welcome to. > > Some help/suggestion/mentoring is appreciated. > > Eric Bresie > ebresie@gmail.com > > > On Sat, May 15, 2021 at 11:59 AM Eric Bresie wrote: > >> As part of NETBEANS-189 / https://github.com/apache/netbeans/pull/2820, >> >> The basic PR I believe addresses the main concern of the ticket to allow >> autocomplete when no connection is set yet. These changes are limited t= o >> the SQL Editor project. >> >> However, requested PR review change suggests refactoring and better >> handling "connected" vs "unconnected" cases a little better rather than = in >> the lower level handling when connections aren't available. >> >> So I'm trying to refactor the SqlIdentifier to account for connected and >> nonconnected DB sessions for quoting purposes. This expands the scope o= f >> the changes to include the "SQL Explorer" project. This seems to make i= t a >> little more complicated than needed. Should this refactoring be capture= d >> as a separate bug? >> >> While trying to work something out for the refactoring... >> >> I'm moving some methods out from DatabaseMetaDataQuoter into the >> "SQLIdentifier.Quoter" to be shareable where applicable for use in >> "non-connected" cases. And also brought in one of the unit test classes >> "NonASCIIQuoter" in as wellwith hopes some of this is usable with/withou= t a >> connection context. >> >> However, when running the "SQL99-Quoting check" >> "testQuoteIdentifierContainingQuotingChar()", it fails on >> assertEquals(quoted, quoter.quoteAlways(unquoted)); due to "quoted" =3D = ""test >> *""*xx"" vs quoteAlways(unquoted) =3D ""test*"*xx"" which don't match. >> >> I think the root of this is the "quoteAlways" calling to alreadyQuoted() >> which seems to check ends and no quotes within. >> >> In this case there may be a "." type scenario. Assume >> there is a full identifier which in some context are broken up into >> "sub-identifiers [tokens]" each of which may need to handled separately >> (i.e. each token checked as opposed to the whole identifier being check) >> but now it's handled as the "whole" identifier. >> >> This test worked prior to all the refactoring so assume it's related to >> some of the changes but I'm just wondering if this highlights a new bug >> that maybe was not accounted for previously. >> >> Should it account for "internal quotes" as well? >> >> Hope this makes sense >> >> Eric Bresie >> ebresie@gmail.com >> > -- Eric Bresie ebresie@gmail.com --00000000000031db8705c5114250--