{"push_id":2808443640,"size":1,"distinct_size":1,"ref":"refs/heads/20180819-c4-fix-bit","head":"65d41737a9025d8bba33dcd42cddebb4a28a64e4","before":"5df97f6285415f47a8287d76cd489f42f6137aa0","commits":[{"sha":"65d41737a9025d8bba33dcd42cddebb4a28a64e4","author":{"name":"Raphael 'kena' Poss","email":"ffa74aa72f5ed5e720c03212554d1e38d8a2905e@cockroachlabs.com"},"message":"sql: fix (really: add) the handling of bit arrays\n\nPreviously CockroachDB was handling the keyword BIT as an alias for\nINT (specifically: INT with a \"visible type\" of BIT). With regards to\nstoring values, performing arithmetic, comparisons, etc, \"BIT\" values\nwere considered just integers.\n\nIn the PostgreSQL dialect however, bit arrays are a completely\ndifferent thing: they are arbitrary long strings of bits, possibly\nlonger (or shorter) than 64 bits, with odd number of bits, etc. They\nalso support concatenation, which integers do not. They are also\ndifferent from strings, because they support bitwise logic operators,\nwhich strings do not. Their literal values are also different from\nboth integer and string values, noted with `B'....'` (note the capital\nB; and see discussion below).\n\nThis patch \"fixes\" the (really, provides the correct) handling of bit\narrays in CockroachDB. It does this as follows:\n\n- a new literal syntax `B'....'` for bit array literals.\n- a new coltype TBitArray.\n- a new datum type DBitArray.\n- a new ColumnType BIT (see discussion below).\n- a new KV encoding type BitArray. Complete with separate\n  value and composite key value encoding.\n\nThe new bit array type is conditional on a cluster version, so that\nlower version nodes in a cluster do not get confused by the new key\nencoding.\n\nRegarding the new ColumnType BIT: this now becomes a first class\nSemanticType instead of a VisibleType on INT. Any column previously\ncreated with an INT semantic type and BIT in the VisibleType is\nuntouched in this patch and will continue to work as a plain integer\ncolumn. This is a backward-compatible change insofar that the BIT\nvisible type for INT columns had previously no bearing on the results\nof queries.\n\nRelease note (bug fix): CockroachDB now supports the BIT and VARBIT (BIT\nVARYING) data types like PostgreSQL: this is a bit array. See the\nPostgreSQL documentation for details. Only the bit array literal\nnotation with a capital B (e.g. `B'10001'`) is currently supported;\nthe syntax with a small b (e.g. `b'abcd'`) continues to denote byte\narrays as previously.\n\nRelease note (backward-incompatible change): CockroachDB happened to\nsupport the notation `B'abcde'` previously to express byte array\nliterals, although this was not documented. This is not supported any\nmore; the notation `B'100011'` will now express bit array literals\nlike in PostgreSQL. The notation `b'...'` remains for byte array\nliterals.\n\nRelease note (sql change): Tables columns created prior to this patch\nwith the type name \"BIT\" will continue to work but will see their type\nautomatically changed to INT in the output of SHOW TABLES,\n`information_schema`, etc. This is backward-compatible insofar that\nthe previous BIT type in CockroachDB was actually a simple\ninteger. Only the name of the type of these columns changes; their\nvalues are unaffected and can continue to be used in queries without\nvisible changes to query results in client apps.","distinct":true,"url":"https://api.github.com/repos/knz/cockroach/commits/65d41737a9025d8bba33dcd42cddebb4a28a64e4"}]}
{"actor":{"display_login":"knz"}}