본문 바로가기

전체 글

(704)
MySQL, innodb_autoinc_lock_mode [1. 개요] innodb_autoinc_lock_mode 와 auto_increment 동작 방식에 대해 정리한다. auto_increment INT 형 자료형을 대상으로 설정 가능하다. NULL 이 올 수 없으므로, NOT NULL 인 column 을 대상으로 설정 가능하다. Table 생성 시, auto_increment 의 시작 값을 특정 값으로 초기화 할 수 있다. 반드시 pk 나 unique key 가 될 필요는 없지만, 중복이 있어선 안된다. innodb_autoinc_lock_mode 아래 query 로 현재 설정 된 값을 확인 할 수 있다. # show variables like 'innodb_autoinc_lock_mode' 아래 query 로 설정 값을 바꿀 수 있다. # set gl..
polyline decoding [1. 개요] 인코딩 한 polyline 을 다시 decoding 하는 방법을 정리한다. decoding 은 encoding 을 거슬러 올라가면 된다. wgs84 좌표를 encoding 한 형태에 대해서 정리한다. [2. encoding 과정] encoding 에 대해서 정리한 페이지는 아래를 참조한다. https://testkernelv2.tistory.com/616 간략하게 정리하면 아래와 같다. 소수점 확보 1 bit left-shift 음수 인 경우, bit 반전 하위 5bit 단위로 처리 # 다음 bit chunk 가 0이 아닌 경우, 현재 bit chunk 와 0x20 를 OR 연산 ## 0x20 == 0010_0000 # 연산 결과에 63 을 더함 # ascii 문자로 변환 bit chunk..
MySQL, SQL_SAFE_UPDATES [1. 개요] table 에 대한 update 혹은 delete 작업 시 where 절이 없거나, where 절에 index 가 걸린 column 이 없는 경우 update / delete 구문을 실패 시킨다. 이러한 동작은 SQL_SAFE_UPDATES 값이 1인 경우 발생하고, 0으로 설정한 경우 update / delete 구문을 정상 동작하게 할 수 있다. [2. 확인 방법] show variables like 'sql_safe_updates' [3. 변경 방법] off set sql_safe_updates = 0; on set sql_safe_updates = 1;