1615: Prepared statement needs to be re-prepared (prepared statement 재준비 필요)
MySQL의미
서버 측 prepared statement가 의존하는 메타데이터(테이블/뷰 정의)가 변경되어 무효화되었으므로 실행이 거부되었다. 문장을 다시 준비해야 한다.
원인
문장 준비 후 기반 테이블에 대한 DDL(ALTER TABLE), 테이블 재생성, 메타데이터 캐시가 가득 차 항목이 제거됨, 또는 너무 작은 table_definition_cache/table_open_cache 한도가 원인이다. DDL이 많은 시스템과 일부 ORM/풀 시나리오에서 흔하다.
해결 방법
대부분의 클라이언트 라이브러리는 이를 잡아 자동으로 문장을 다시 준비한다. 애플리케이션에서는 이 오류를 잡아 prepare + execute를 재시도한다. 자주 재발하면 table_definition_cache와 table_open_cache를 늘린다. 애플리케이션 트래픽 중 불필요한 DDL을 피한다.
같은 데이터베이스의 다른 항목
- 1236Got fatal error 1236 from master when reading data from binary log (binary log 읽기 중 master로부터 치명적 오류 1236 수신)
- 1129Host 'host' is blocked because of many connection errors (연결 오류가 많아 호스트 차단됨)
- 1194Table 'name' is marked as crashed and should be repaired (테이블이 crashed로 표시되어 복구 필요)
- 1553Cannot drop index needed in a foreign key constraint (외래 키 제약 조건에 필요한 인덱스 삭제 불가)
- 3948Loading local data is disabled; this must be enabled on both the client and server sides (로컬 데이터 로드가 비활성화됨. 클라이언트와 서버 양쪽에서 활성화 필요)
- 1075Incorrect table definition; there can be only one auto column and it must be defined as a key (잘못된 테이블 정의. auto 컬럼은 하나만 가능하며 키로 정의해야 함)
- 1055Expression not in GROUP BY (only_full_group_by) (GROUP BY에 없는 표현식)