From: "n.pettik" <korablev@tarantool.org> To: tarantool-patches@freelists.org Cc: Ivan Koptelov <ivan.koptelov@tarantool.org> Subject: [tarantool-patches] Re: [PATCH] sql: forbid different sorting orders in ORDER BY Date: Fri, 15 Mar 2019 19:23:22 +0300 [thread overview] Message-ID: <F403887D-B04C-4C05-93F6-B36D364B5AA4@tarantool.org> (raw) In-Reply-To: <A37ADFCC-BDF9-41E5-B696-076B0D24647D@tarantool.org> [-- Attachment #1: Type: text/plain, Size: 2519 bytes --] >> Plase, make up a list of tests to be enabled after multi-directional >> iterators are introduced. Don’t fix tests which fail now, simply comment >> them. Finally, add a few simple tests verifying that different sorting >> orders are not supported now. > > I did as you say. Added list of tests as a comment to #3309. > But I would like to know, why commenting tests & making a list > of them is better than change tests & comment old expected results? > The main advantage is that one can not ignore/miss tests, which > would fail after #3309 is done. Firstly, they won’t automatically start to fail, since check is SQL code won’t disappear itself. Secondly, such approach allows to significantly reduce efforts to turn tests on/off after/before fixes. > + -- Tests are commented because of the reason described in > + -- NOTE at the beginning of the file. > + -- <begin> > + --local data = { > + -- {limit=0, offset=4, orderby="+b,+a"}, > + -- {limit=0, offset=5, orderby="+b,+a"}, > + -- {limit=0, offset=6, orderby="+b,+a"}, > + -- {limit=0, offset=9, orderby="+b,+a"}, > + -- {limit=0, offset=0, orderby="+b,+a"}, > + -- {limit=0, offset=1, orderby="+b,+a"}, > + -- {limit=7, offset=4, orderby="+b,+a"}, > + -- {limit=7, offset=9, orderby="+b,+a”}, These first tests come with the same sorting orders, can we avoid commenting them? > + -- {limit=0, offset=4, orderby="+b DESC,+a"}, > + -- {limit=0, offset=5, orderby="+b DESC,+a"}, > + -- {limit=0, offset=6, orderby="+b DESC,+a"}, > + -- {limit=0, offset=9, orderby="+b DESC,+a"}, > + -- {limit=0, offset=0, orderby="+b DESC,+a"}, > + -- {limit=0, offset=1, orderby="+b DESC,+a"}, > + -- {limit=7, offset=4, orderby="+b DESC,+a"}, > + -- {limit=7, offset=9, orderby="+b DESC,+a"}, > > +void > +sql_expr_check_sort_orders(struct Parse *parse, > + const struct ExprList *expr_list) > +{ > + if(expr_list == NULL) > + return; > + enum sort_order reference_order = expr_list->a[0].sort_order; > + for (int i = 1; i < expr_list->nExpr; i++) { > + assert(expr_list->a[i].sort_order != SORT_ORDER_UNDEF); > + if (expr_list->a[i].sort_order != reference_order) { > + diag_set(ClientError, ER_UNSUPPORTED, "ORDER BY", > + "different sorting orders”); Different sorting orders and LIMIT clause at the same time OR “ORDER BY with LIMIT”, “different sorting orders”. [-- Attachment #2: Type: text/html, Size: 40933 bytes --]
next prev parent reply other threads:[~2019-03-15 16:23 UTC|newest] Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top 2019-03-11 15:44 [tarantool-patches] " Ivan Koptelov 2019-03-12 14:25 ` [tarantool-patches] " n.pettik 2019-03-15 12:10 ` i.koptelov 2019-03-15 16:23 ` n.pettik [this message] 2019-03-15 16:52 ` i.koptelov 2019-03-15 16:55 ` n.pettik 2019-03-19 11:25 ` Kirill Yukhin
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=F403887D-B04C-4C05-93F6-B36D364B5AA4@tarantool.org \ --to=korablev@tarantool.org \ --cc=ivan.koptelov@tarantool.org \ --cc=tarantool-patches@freelists.org \ --subject='[tarantool-patches] Re: [PATCH] sql: forbid different sorting orders in ORDER BY' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox