Skip to content

Commit

Permalink
sql: YEAR(2) is not supported, M is display width (#608)
Browse files Browse the repository at this point in the history
* YEAR(2) is not supported, M is display width
* Fixed punctuation point (existing issue)
  • Loading branch information
morgo authored Sep 10, 2018
1 parent 0155339 commit 0b3709c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sql/datatype.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ The meaning of the fields:

| Syntax Element | Description |
| -------- | ------------------------------- |
| M | the length of the type. Optional. |
| M | the display width of the type. Optional. |
| UNSIGNED | UNSIGNED. If omitted, it is SIGNED. |
| ZEROFILL | If you specify ZEROFILL for a numeric column, TiDB automatically adds the UNSIGNED attribute to the column. |

Expand Down Expand Up @@ -175,8 +175,8 @@ TIME[(fsp)]
> A time. The range is '-838:59:59.000000' to '838:59:59.000000'. TiDB displays TIME values in 'HH:MM:SS[.fraction]' format.
An optional fsp value in the range from 0 to 6 may be given to specify fractional seconds precision. If omitted, the default precision is 0.

YEAR[(2|4)]
> A year in two-digit or four-digit format. The default is the four-digit format. In four-digit format, values display as 1901 to 2155, and 0000. In two-digit format, values display as 70 to 69, representing years from 1970 to 2069.
YEAR[(4)]
> A year in four-digit format. Values display as 1901 to 2155, and 0000.

```

Expand Down Expand Up @@ -308,7 +308,7 @@ In TiDB, the values of the SET type is internally converted to Int64. The existe

In this case, for an element of `('a', 'c')`, it is 0101 in binary.

For more information, see [the SET type in MySQL](https://dev.mysql.com/doc/refman/5.7/en/set.html)
For more information, see [the SET type in MySQL](https://dev.mysql.com/doc/refman/5.7/en/set.html).

## Data type default values

Expand All @@ -330,4 +330,4 @@ Implicit defaults are defined as follows:

- For numeric types, the default is 0. If declared with the AUTO_INCREMENT attribute, the default is the next value in the sequence.
- For date and time types other than TIMESTAMP, the default is the appropriate “zero” value for the type. For TIMESTAMP, the default value is the current date and time.
- For string types other than ENUM, the default value is the empty string. For ENUM, the default is the first enumeration value.
- For string types other than ENUM, the default value is the empty string. For ENUM, the default is the first enumeration value.

0 comments on commit 0b3709c

Please sign in to comment.