What's New in v2.1-alpha.20180604

This version of CockroachDB is no longer supported. For more details, see the Release Support Policy.

June 4, 2018

This release includes general usability enhancements and bug fixes as well as:

  • Easier data migrations from MySQL: The IMPORT feature now supports a subset of MySQL export formats. We will continue to make migrations easier in the alphas leading up to 2.1.

Please give this feature and the ones below a try. If you see something that can be improved, we’d love to hear from you on GitHub or the Forum.

Get future release notes emailed to you:


General Changes

  • New clusters and existing clusters upgraded to this version of CockroachDB will include two new empty databases, defaultdb and postgres. The defaultdb database is automatically used for clients that connect without a current database set (e.g., without a database component in the connection URL). The postgres database is provided for compatibility with PostgreSQL client frameworks that require it to exist when the database server has been freshly installed. Both new databases behave like any other regular database and, if deemed unnecessary, can be manually deleted. #24735
  • The new compactor.threshold_bytes and max_record_age cluster settings can be used to configure the compactor. #25397
  • After upgrading a cluster from v2.0 to v2.1, it is no longer necessary to manually finalize the upgrade. #24987

SQL Language Changes

  • Collated strings can now be used in WHERE clauses on indexed columns. #25169
  • The new CANCEL QUERIES and CANCEL SESSIONS variants of the CANCEL QUERY and CANCEL SESSION statements cancel multiple queries or sessions at once. Likewise, the new CANCEL/PAUSE/RESUME JOBS variants of the CANCEL JOB, PAUSE JOB, and RESUME JOB statements operate on multiple jobs at once. #25157
  • The Level and Type columns of EXPLAIN (VERBOSE) results are now hidden; if they are needed, they can be SELECTed explicitly. #25172
  • All users now automatically belong to the new public role. This role makes it possible to grant privileges on an object for all users at once, e.g., GRANT SELECT ON mytable TO public;. #25099
  • The binary Postgres wire format is now supported for INTERVAL values. #25242
  • Prevented DROP TABLE from using too much CPU. #24983
  • Improved SET TRACING so that a client can more easily trace around a statement that produce errors. #25262
  • Added the generate_subscripts() built-in function. #25295
  • Improved the documentation of the now(), current_time(), current_date(), current_timestamp(), clock_timestamp(), statement_timestamp(), and cluster_logical_timestamp() built-in functions. #25327
  • Running TRUNCATE without CASCADE on a table that has interleaved table children now returns an error instead of proceeding to delete both tables. #25265
  • Tuples can now be labeled using the new grammar ((1,2,3) AS a,b,c). #25283
  • Labeled tuples can now be accessed using their labels, but doing so requires an extra level of parentheses, e.g., SELECT (((1,'2',true) AS a, b, c)).a. #25810
  • SHOW TRACE FOR <stmt> now runs <stmt> through the DistSQL execution engine, if supported. SHOW KV TRACE FOR <stmt> still runs <stmt> through local SQL. #24709
  • Introduced two experimental scalar operators, IFERROR() and ISERROR(). They may be documented for public use in the future. #25304
  • The server.time_until_store_dead cluster setting can no longer be set to less than 1m15s. Setting it to lower values was previously allowed but not safe, since it can cause bad rebalancing behavior. #25598
  • CANCEL JOB can now be executed on long-running schema change jobs, causing them to terminate early and roll back. #25571
  • Added the array_to_string() built-in function. #25681
  • IMPORT now supports MySQL's tabbed OUTFILE format. #25615
  • IMPORT now supports mysqldump SQL as a data format. #25783
  • The experimental lookup join feature now supports secondary indexes. #25628
  • Stored, computed columns can now be converted to regular columns by running ALTER TABLE t ALTER COLUMN c DROP STORED. #25819
  • The experimental lookup join feature now supports left outer joins. #25644
  • TRUNCATE commands are now logged in the event log. #25868
  • Improved IMPORT error messages. #26032

Command-Line Changes

  • Changing or removing a replication zone config now causes events to be written to the system event log. #25250
  • Messages that refer to an invoked command (e.g., "Failed running start") are no longer confused by the presence of flags before the first argument (e.g., cockroach --no-color start). #25246
  • Typos in replication zone constraints are now validated. When they are set, required attributes and localities must match at least one node in the cluster. #25421

Admin UI Changes

  • Running unit tests for the Admin UI now depends on the installation of Google Chrome. #25140
  • Added RocksDB compactions/flushes to Storage graphs. #25428
  • Added a Stores report page, including encryption status. #26040
  • Removed time selectors and tier labels during Node Map setup. #25280

Bug Fixes

  • The cockroach sql command once again does not prompt for a password when a certificate is provided. #25252
  • Corrected the behavior of GREATEST and LEAST built-ins when they have a leading NULL argument. #25882
  • CockroachDB now properly reports an error when using the internal-only functions final_variance() and final_stddev() instead of causing a crash. #25158
  • The constraint_schema column in information_schema.constraint_column_usage now displays the constraint's schema instead of its catalog. #25190
  • BEGIN; RELEASE SAVEPOINT; now returns and error instead of causing a crash. #25247
  • Fix a bug where the sessions endpoint on the Admin UI would return an error when there was an active transaction. #25249
  • Corrected the CockroachDB-specific, currently undocumented conversion from INTERVAL to/from numeric types. #25257
  • Fixed problems with IMPORT sometimes failing after node decommissioning. #25162
  • Prevented queries that use placeholders for tuple types from causing a crash. #25269
  • Fixed a rare segfault that occurred when reading from an invalid memory location returned from C++. #25347
  • Fixed a bug with IS DISTINCT FROM not returning NULL values that pass the condition in some cases. #25336
  • Restarting a CockroachDB server on Windows no longer fails due to file system locks in the store directory. #25267
  • Prevented the consistency checker from deadlocking. This would previously manifest itself as a steady number of replicas queued for consistency checking on one or more nodes and would resolve by restarting the affected nodes. #25456
  • Fixed a crash in some cases when using a GROUP BY with HAVING. #25574
  • Fixed a nil pointer dereference when importing data containing date values. #25661
  • Numeric literal values no longer silently lose information after a certain precision. #25597
  • Prevented spurious BudgetExceededErrors for some queries that read a lot of JSON data from disk. #25679
  • Fixed query errors in some cases involving a NULL constant that is cast to a specific type. #25735
  • Fixed a crash when trying to plan certain UNION ALL queries. #25747
  • Fixed a crash caused by inserting data into a table with computed columns that reference other columns not present in the INSERT statement. #25682
  • EXPLAIN (DISTSQL) now properly reports that plans containing subqueries cannot be run through the DistSQL execution engine. #25618
  • CockroachDB no longer crashes if the control statements CANCEL/PAUSE/RESUME are given values using special PostgreSQL types (e.g., NAME). #25844
  • Fixed a panic when using unordered aggregations. #26042
  • Fixed an error caused by INET constants in some rare cases. #26086
  • Fixed an error caused by empty arrays in some cases. #26090
  • Previously, expired compactions could stay in the queue forever. Now, they are removed when they expire. #26039
  • Fixed problems using tables with foreign key or interleaved references to other tables when the tables were created in the same transaction. #25786

Doc Updates


This release includes 304 merged PRs by 38 authors. We would like to thank the following contributors from the CockroachDB community, with special thanks to first-time contributors Nishant Gupta, wabada, and yuzefovich.

  • Garvit Juniwal
  • Gustav Paul
  • Karan Vaidya
  • Nishant Gupta
  • Vijay Karthik
  • wabada
  • Yahor Yuzefovich
YesYes NoNo