From dev-return-21970-archive-asf-public=cust-asf.ponee.io@netbeans.apache.org Sun Jun 6 16:00:53 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 CEEB1180658 for ; Sun, 6 Jun 2021 18:00:52 +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 E81E13ED6C for ; Sun, 6 Jun 2021 16:00:51 +0000 (UTC) Received: (qmail 74760 invoked by uid 500); 6 Jun 2021 16:00:51 -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 74742 invoked by uid 99); 6 Jun 2021 16:00:51 -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; Sun, 06 Jun 2021 16:00:51 +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 869D7C0454 for ; Sun, 6 Jun 2021 16:00:50 +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 vALpPI05SBSo for ; Sun, 6 Jun 2021 16:00:49 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=209.85.217.48; helo=mail-vs1-f48.google.com; envelope-from=ebresie@gmail.com; receiver= Received: from mail-vs1-f48.google.com (mail-vs1-f48.google.com [209.85.217.48]) by mx1-ec2-va.apache.org (ASF Mail Server at mx1-ec2-va.apache.org) with ESMTPS id 5F7CCBD223 for ; Sun, 6 Jun 2021 16:00:49 +0000 (UTC) Received: by mail-vs1-f48.google.com with SMTP id s22so7579619vsl.10 for ; Sun, 06 Jun 2021 09:00:49 -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=r6eL/PopA/EiEUI4V5g58UBBG6lsIXN3SB/e5RolLOQ=; b=fNgwRAeVxGOsGh3wB5A7lBzRBUCR93EWvt+Qwt3R3GsUTiHJO0M43OYE0VyjzBivu3 ZHXfjt5wOJYZCnyjecmFXnvAAy3ghxX9k8FogyxQFk2Kt+Lw38dF5FU53nMpf/NPQy7c LlaTlMgQWZvWdnQBAGw8adjuZ+YVD+d68dzq11vpW9S5bXMixOfUYDyh4xa8TKP0xBy+ 6yz80ug1eOH0pbAmKIfqdlfonol3zRmFyZ6EKb1XG6mFL+avGnNdAQ6gMwn3FxcfZrmp 4NEeZIK6UxX5WeQjb2AJvffuuzg/sPqTjjbKMb/IjjR1ESZgGjzTx+KxxUY066BwpQVY KxYQ== 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=r6eL/PopA/EiEUI4V5g58UBBG6lsIXN3SB/e5RolLOQ=; b=t35USzxnVoZY3dq8e+eclM6NLSjINoQUUNBhcepLolUQRaIrJTYjURtGyAx46nBDQH XGm+d7lV52tFfhzEmfr4naL5eJM7Uydg44+/lZN2u9Rj58v/umEGr7e6SZU8tXk/Dbg/ 8h3eZcwJtyfqqddW7zavYMCm1rMjVFkojpF6E8/an1kO6W/e3IUQh62i7/gCGambdfFp SP0nyZF62Azw4Hxzf6JCfPPmkrQl62wBxzP0taW/wNXpSli2vGID9CniEYrNxwhqjPMx xTQ7W3JuhXhhYIfHLnucPp0sqoaubWOO6vxw+d2pSfNyfUWZDZtx6PWb0zM3i54o4Dz2 6Rdw== X-Gm-Message-State: AOAM531LcgQLt3B5k1jyU0GKo3WCpuGjQJ3YNcq5ug+WfggGwET8sJFh igihNaA+I4HjV9lUgJBfX1+NPel9lhRaNQRG2JPNINHD0KI= X-Google-Smtp-Source: ABdhPJxlmEULq+QR4zcFXPYLfaQS3jiT3x+3TDxlgEVvO7EaYm3AXlwROLTzTHYSa7Rh0BovOGsqDO0U92nA8GuY99A= X-Received: by 2002:a05:6102:2222:: with SMTP id d2mr7187311vsb.11.1622995248572; Sun, 06 Jun 2021 09:00:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Eric Bresie Date: Sun, 6 Jun 2021 11:00:37 -0500 Message-ID: Subject: Re: SQL Autocompletion - Quoter Refactoring breaks quoter check To: Netbeans Developer List Content-Type: multipart/alternative; boundary="000000000000436cd105c41b0776" --000000000000436cd105c41b0776 Content-Type: text/plain; charset="UTF-8" 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 would 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 to > 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 of > the changes to include the "SQL Explorer" project. This seems to make it a > little more complicated than needed. Should this refactoring be captured > 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/without a > connection context. > > However, when running the "SQL99-Quoting check" > "testQuoteIdentifierContainingQuotingChar()", it fails on > assertEquals(quoted, quoter.quoteAlways(unquoted)); due to "quoted" = ""test > *""*xx"" vs quoteAlways(unquoted) = ""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 > --000000000000436cd105c41b0776--