From user-return-12378-archive-asf-public=cust-asf.ponee.io@cayenne.apache.org Thu May 2 18:27:09 2019 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [207.244.88.153]) by mx-eu-01.ponee.io (Postfix) with SMTP id A710218067E for ; Thu, 2 May 2019 20:27:08 +0200 (CEST) Received: (qmail 17084 invoked by uid 500); 2 May 2019 18:27:07 -0000 Mailing-List: contact user-help@cayenne.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cayenne.apache.org Delivered-To: mailing list user@cayenne.apache.org Received: (qmail 17072 invoked by uid 99); 2 May 2019 18:27:07 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 02 May 2019 18:27:07 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 3BFE1C1D84 for ; Thu, 2 May 2019 18:27:07 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.299 X-Spam-Level: ** X-Spam-Status: No, score=2.299 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=2, KAM_NUMSUBJECT=0.5, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id xE1apbHutKtu for ; Thu, 2 May 2019 18:27:05 +0000 (UTC) Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 6D91E5FAE7 for ; Thu, 2 May 2019 18:27:05 +0000 (UTC) Received: by mail-lj1-f194.google.com with SMTP id r72so3075540ljb.9 for ; Thu, 02 May 2019 11:27:05 -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=Z3YcSEK/KROIZlqPADJZEuXr+AFiWDiGP3HUNCRWNTk=; b=LYP3uPGhSG3+pYsS3OSYB6sKw4dHbPZFIWoG2BgGrtm3993zT+VUpV/IK3ra/Nw2Pa NGWRrmDZUZsLGEe3/4DRRYF/SGznIur2cXj8R6j6aP6Fz6quLBIc1fRujxRgYwE9KiBi Qi3Y5M3BpaFpo9RQzvtbCus0tIyNrcZFazsCc1YUmMVDpBLd0ao9pM83Z5n6zI0DTunM JsvdkvXbOZGmS2cLlLutgX9gmH4I7rSC6TP5oyv6mq8fCfXbzM3R873+cbVrYpxWlZPK MIJFgM7jB9fVZPjbaj8Rto1x8uq4zBx/uMPI77TiHxoxmFJltwOw1+dyDsyIQ4RdDAm0 geUA== 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=Z3YcSEK/KROIZlqPADJZEuXr+AFiWDiGP3HUNCRWNTk=; b=eK2v6z/5U57ORXUW58tq8Fujs887d6sAEhuaPIazqADyxmhdmUnPDBEcWr0wfrDHWH DL+SrkwYsg6/ylzbsLKdw5bMw3xOSOKQrOIzi+ovaAdDPZOKvXpsGzOjJWS5vPvPUAQk ZBOA7yWyqntbJBQrwZ5hVhtvY5D9g6KF3RD3jUtvO5BCEmRm6g2iZVAOoJ1rzaSCqSly ZrZDi4GHmEie52IPZmUlrBnVkG51lNRuTsBEiq1cGfuQytnxjn8nUhzzeMu80DxENOwJ a4cVJpVXNN059EKuIjEz6CDiGT6hsnwO5CmbxV6d5OZcsC1WXPIfdBEETr0HhguhR69j s3yQ== X-Gm-Message-State: APjAAAWRIwmCQSXgxlptPkk6v8riYO0Xwwe/gz82UVq6gDk+gvul5Y94 6HRAxpNy5tQzHxnOolAYCaYRCcRKZOOxyyB7/CkQD670 X-Google-Smtp-Source: APXvYqz//2Bw+soJGOmK5HypQhtxm6Qs1Sgj5WpmaIaLyvBZLN5n8ftI+wp0gjs4CpA5ihR9niuzk67cjmpAYl4baLw= X-Received: by 2002:a05:651c:155:: with SMTP id c21mr2819480ljd.10.1556821624680; Thu, 02 May 2019 11:27:04 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Lon Varscsak Date: Thu, 2 May 2019 11:26:53 -0700 Message-ID: Subject: Re: Another regression in 4.2 To: Apache Cayenne Content-Type: multipart/alternative; boundary="000000000000eafbfe0587ebc74a" --000000000000eafbfe0587ebc74a Content-Type: text/plain; charset="UTF-8" You're the best! On Thu, May 2, 2019 at 6:46 AM Nikita Timofeev wrote: > Hi Lon, > > I've fixed this [1]. Select translator incorrectly translated > Expressions in some cases. > Thanks for reporting. > > [1] https://issues.apache.org/jira/browse/CAY-2575 > > On Thu, May 2, 2019 at 4:11 AM Lon Varscsak > wrote: > > > > Hey again :) > > > > I have a situation where the query created is missing an "AND" resulting > in > > invalid sql. Here is the sql that's generated: > > > > SELECT DISTINCT t0.allow_backorder, t0.allow_multiples, t0.business_unit, > > t0.buy_amount, t0.customer_choice, t0.end_date, t0.get_amount, t0.hidden, > > t0.internal_notes, t0.key_code_required, t0.manufacturer_fulfillment, > > t0.offer_name, t0.priority, t0.promo_id, t0.promo_type, t0.start_date > FROM > > marketing.dbo.promotion_master t0 JOIN > > marketing.dbo.promotion_key_code_detail t1 ON t0.promo_id = t1.promo_id > > WHERE ( ( t0.business_unit = ? ) AND ( t0.start_date <= ? ) AND ( > > t0.end_date > ? ) AND ( t0.key_code_required = ? ) AND t0.promo_type IN ( > > ?) ) ( t1.key_code = ? ) [bind: 1->business_unit:'SP', > > 2->start_date:2019-05-01T17:57:19.123333333, > > 3->end_date:2019-05-01T17:57:19.123333333, 4->key_code_required:'true', > > 5->promo_type:'BUY ANY GET Y', 6->key_code:'EDLP10'] > > > > Here is the sql it should generate: > > > > SELECT DISTINCT t0.allow_backorder, t0.allow_multiples, t0.business_unit, > > t0.buy_amount, t0.customer_choice, t0.end_date, t0.get_amount, t0.hidden, > > t0.internal_notes, t0.key_code_required, t0.manufacturer_fulfillment, > > t0.offer_name, t0.priority, t0.promo_id, t0.promo_type, t0.start_date > FROM > > marketing.dbo.promotion_master t0 JOIN > > marketing.dbo.promotion_key_code_detail t1 ON t0.promo_id = t1.promo_id > > WHERE ( ( t0.business_unit = ? ) AND ( t0.start_date <= ? ) AND ( > > t0.end_date > ? ) AND ( t0.key_code_required = ? ) AND t0.promo_type IN ( > > ?) ) *AND* ( t1.key_code = ? ) [bind: 1->business_unit:'SP', > > 2->start_date:2019-05-01T17:57:19.123333333, > > 3->end_date:2019-05-01T17:57:19.123333333, 4->key_code_required:'true', > > 5->promo_type:'BUY ANY GET Y', 6->key_code:'EDLP10'] > > > > Thoughts? > > > > Thanks, > > > > Lon > > > > -- > Best regards, > Nikita Timofeev > --000000000000eafbfe0587ebc74a--