Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sql: YEAR(2) is not supported, M is display width #608

Merged
merged 2 commits into from
Sep 10, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.