[tarantool-patches] Re: [PATCH v1 3/3] sql: get rid of Column structure

  • From: Kirill Shcherbatov <kshcherbatov@xxxxxxxxxxxxx>
  • To: tarantool-patches@xxxxxxxxxxxxx, Vladislav Shpilevoy <v.shpilevoy@xxxxxxxxxxxxx>, Nikita Pettik <korablev@xxxxxxxxxxxxx>
  • Date: Thu, 19 Jul 2018 13:17:03 +0300

Now you have changed the behavior. Before this fix the collation was
assigned once. Now it is assigned every time.
hi! Thank you for lookup. You right: columns could have default collation that 
could be 
overwritten with specified one. 
I've returned old semantics.

CREATE TABLE t3(x TEXT PRIMARY KEY COLLATE "unicode_ci");
SELECT b FROM t4 UNION SELECT b FROM v4 ORDER BY 1 COLLATE text;

-               bool unused;
-               uint32_t id;
-               struct coll *coll = sql_expr_coll(pParse, p, &unused, &id);
-               if (coll != NULL && pCol->coll == NULL) {
-                       pCol->coll = coll;
-                       pTab->def->fields[i].coll_id = id;
-               }
+               bool is_found;
+               uint32_t coll_id;
+               if (pTab->def->fields[i].coll_id == COLL_NONE &&
+                   sql_expr_coll(pParse, p, &is_found, &coll_id) && is_found)
+                       pTab->def->fields[i].coll_id = coll_id;

Other related posts: