Warning | 1681 | Integer display width is deprecated and will be removed in a future release.
예제를 따라서 SQL문을 작성하다가 마주친 워닝 문구
아마 범위 지정때문에 경고를 받은듯하다
어떤 경고인지 자세하게 보면 좋을것같아 찾아본 MySQL warning 확인하는 명령어
mysql> show warnings
-> ;
+---------+------+------------------------------------------------------------------------------+
| Level | Code | Message |
+---------+------+------------------------------------------------------------------------------+
| Warning | 1681 | Integer display width is deprecated and will be removed in a future release. |
| Warning | 1681 | Integer display width is deprecated and will be removed in a future release. |
| Warning | 1681 | Integer display width is deprecated and will be removed in a future release. |
| Warning | 1681 | Integer display width is deprecated and will be removed in a future release. |
+---------+------+------------------------------------------------------------------------------+
4 rows in set (0.00 sec)
show warnings; 를 입력해주면 받은 경고에 대한 상세 메세지를 확인할수있다
워닝 코드는 1681이며
워닝 메세지는 Integer display width is deprecated and will be removed in a future release. 였다
이제 이 경고가 왜 뜨는지, 또 피할수있는 방법이 있는지 검색을 시도해봤음
친절한 스택오버플로우는
이러한 워닝은 데이터를 저장하거나 표출하는데 아무런 문제가 없으며
그렇더라도 이러한 문구를 피하고싶다면, 기존 컬럼 타입을
INT(11) 등의 형태에서 INT로 수정하라고 해결방법까지 안내해준다
참고 :
https://dev.mysql.com/doc/refman/8.0/en/numeric-type-attributes.html
MySQL :: MySQL 8.0 Reference Manual :: 11.1.6 Numeric Type Attributes
11.1.6 Numeric Type Attributes MySQL supports an extension for optionally specifying the display width of integer data types in parentheses following the base keyword for the type. For example, INT(4) specifies an INT with a display width of four digits.
dev.mysql.com
'데이터베이스' 카테고리의 다른 글
[MySQL] zerofill이란, int(4)과 int 표현의 차이는? (0) | 2021.10.31 |
---|---|
[MySQL] 데이터베이스 테이블 생성, 조회, 데이터 추가 명령어 (0) | 2021.10.22 |