From be601f14c4fe23f982ff10ca814e6a2597b4cff9 Mon Sep 17 00:00:00 2001 From: Jesse Seldess Date: Thu, 16 Jun 2016 11:13:53 -0400 Subject: [PATCH 1/2] hexidecimal string and numeric literals --- int.md | 10 +++++++++- string.md | 12 ++++++++---- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/int.md b/int.md index 8640150efbc..b7c800056c6 100644 --- a/int.md +++ b/int.md @@ -20,7 +20,15 @@ In CockroachDB, the following are aliases for `INT`: ## Format -When inserting into an `INT` column, format the value as `12345`. +An `INT` column accepts Unicode numeric literals and hexadecimal numeric literals. + +### Unicode Numeric Literal + +When inserting a Unicode numeric literal into an `INT` column, format the value as `12345`. + +### Hexadecimal Numeric Literal + +When inserting a hexadecimal numeric literal into a `INT` column, use hexadecimal digits preceded by `0x`. For example, `0xcafe1111` corresponds to the Unicode numeric literal `3405648145`. ## Size diff --git a/string.md b/string.md index 10ea9788c74..dde2f5cd724 100644 --- a/string.md +++ b/string.md @@ -36,15 +36,19 @@ When inserting a string: ## Format -A `STRING` column accepts both string literals and escape strings. +A `STRING` column accepts Unicode string literals, hexadecimal string literals, and escape strings. -### String Literal +### Unicode String Literal -When inserting a string literal into a `STRING` column, format the value as Unicode characters within single quotes, e.g., `'a1b2c3'`. +When inserting a Unicode string literal into a `STRING` column, format the value as Unicode characters within single quotes, e.g., `'a1b2c3'`. + +### Hexadecimal String Literal + +When inserting a hexadecimal string literal into a `STRING` column, use `x` or `X` followed by hexadecimal digits in single quotes. For example, `x'636174'` or `X'636174'` correspond to the Unicode string literal `'cat'`. ### Escape String -When inserting an escape string into a `STRING` column, use either `e` or `E` and followed by one or more of the following backslash escape sequences within single quotes: +When inserting an escape string into a `STRING` column, use either `e` or `E` followed by one or more of the following backslash escape sequences within single quotes: Backslash Escape Sequence | Interpretation --------------------------|--------------- From f1104bacaee0375978113e05075b41e540af0ba9 Mon Sep 17 00:00:00 2001 From: Jesse Seldess Date: Thu, 16 Jun 2016 14:16:07 -0400 Subject: [PATCH 2/2] revisions for jordan --- int.md | 10 +++++----- string.md | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/int.md b/int.md index b7c800056c6..c09d1cdd20d 100644 --- a/int.md +++ b/int.md @@ -20,15 +20,15 @@ In CockroachDB, the following are aliases for `INT`: ## Format -An `INT` column accepts Unicode numeric literals and hexadecimal numeric literals. +An `INT` column accepts numeric literals and hexadecimal-encoded numeric literals. -### Unicode Numeric Literal +### Numeric Literal -When inserting a Unicode numeric literal into an `INT` column, format the value as `12345`. +When inserting a numeric literal into an `INT` column, format the value as `12345`. -### Hexadecimal Numeric Literal +### Hexadecimal-Encoded Numeric Literal -When inserting a hexadecimal numeric literal into a `INT` column, use hexadecimal digits preceded by `0x`. For example, `0xcafe1111` corresponds to the Unicode numeric literal `3405648145`. +When inserting a hexadecimal-encoded numeric literal into a `INT` column, format the value as hexadecimal digits preceded by `0x`. For example, `0xcafe1111` corresponds to the numeric literal `3405648145`. ## Size diff --git a/string.md b/string.md index dde2f5cd724..3164be2f180 100644 --- a/string.md +++ b/string.md @@ -38,17 +38,17 @@ When inserting a string: A `STRING` column accepts Unicode string literals, hexadecimal string literals, and escape strings. -### Unicode String Literal +### String Literal -When inserting a Unicode string literal into a `STRING` column, format the value as Unicode characters within single quotes, e.g., `'a1b2c3'`. +When inserting a string literal into a `STRING` column, format the value as Unicode characters within single quotes, e.g., `'a1b2c3'`. -### Hexadecimal String Literal +### Hexadecimal-Encoded String Literal -When inserting a hexadecimal string literal into a `STRING` column, use `x` or `X` followed by hexadecimal digits in single quotes. For example, `x'636174'` or `X'636174'` correspond to the Unicode string literal `'cat'`. +When inserting a hexadecimal-encoded string literal into a `STRING` column, format the value as `x` or `X` followed by hexadecimal digits in single quotes. For example, `x'636174'` or `X'636174'` correspond to the Unicode string literal `'cat'`. ### Escape String -When inserting an escape string into a `STRING` column, use either `e` or `E` followed by one or more of the following backslash escape sequences within single quotes: +When inserting an escape string into a `STRING` column, format the value as `e` or `E` followed by one or more of the following backslash escape sequences within single quotes: Backslash Escape Sequence | Interpretation --------------------------|---------------