Commit graph

43 commits

Author SHA1 Message Date
Kijin Sung
74eeaf3459 Allow setting new charset in DB::modifyColumn() 2021-12-13 15:20:58 +09:00
Kijin Sung
0118962a8f Insert NULL instead of 0 for next sequence
https://xetown.com/questions/1627614

sql_mode에 NO_AUTO_VALUE_ON_ZERO가 포함되어 있는 경우
0을 입력하면 AUTO_INCREMENT가 작동하지 않음
2021-11-10 16:34:22 +09:00
Kijin Sung
86214cb0fa Return a more descriptive error when query result class is not found 2021-04-26 15:45:31 +09:00
Kijin Sung
ce5dc45326 Allow class name to be specified when executing queries
PDO에는 결과를 어떤 클래스로 받아올지 선택하는 기능이 있는데 (기본값 stdClass)
executeQuery()로 쿼리를 실행할 때도 이 기능을 활용할 수 있도록 개선합니다.
stdClass를 받아와서 속성들을 추출한 후 documentItem에 도로 집어넣는 등
비효율적인 부분을 추후 개선하는 데 도움이 될 것으로 예상합니다.
2021-04-25 13:18:47 +09:00
Kijin Sung
b9cb5f429a Use savepoints for nested transactions
- XE에서 사용하던 savepoint 방식을 복원
- 트랜잭션 안에서 commit이 무시되더라도 해당 사실을 알리는 로그를 남기도록 함
2021-02-04 16:39:09 +09:00
Kijin Sung
9dc8476f5d Set $output->data to NULL if query returns no rows 2021-01-31 01:43:07 +09:00
Kijin Sung
957be16a25 Replace all wildcard columns with '1' in count-only subquery #1575 2021-01-29 14:40:28 +09:00
Kijin Sung
f46b41f437 Update unit tests for latest codeception 2021-01-28 21:53:44 +09:00
Kijin Sung
f07afe9c58 Unset $this->_last_stmt before next query 2021-01-14 22:39:43 +09:00
Kijin Sung
4805a1864b Append query ID and IP address as a /* comment */ to every query, if enabled in debug settings 2021-01-13 22:14:15 +09:00
Kijin Sung
c26325efee Fix #1550 mark counter_site_status table as deleted 2021-01-08 23:54:50 +09:00
Kijin Sung
1a204d8c52 Completely disable Debug logging if it is not enabled for the current user
관리자 또는 특정 IP에서만 디버그 기능을 사용하도록 설정된 경우,
그 밖의 요청에서는 어떤 에러메시지, 쿼리, 트리거 소요시간 등의 기록도
디버그 클래스에 저장하지 않도록 변경합니다.

워닝이 많이 발생하는 PHP 8.0에서는 20~30%의 성능 개선 효과가 있습니다.
2021-01-07 02:51:43 +09:00
Kijin Sung
3f766a937c Fix incorrect handling of auto-generated COUNT(*) queries when there are GROUP BY or DISTINCT clauses 2021-01-07 00:55:43 +09:00
Kijin Sung
c700de4f66 Also catch PDOException in _executeCountQuery() 2020-12-26 20:49:46 +09:00
Kijin Sung
afcc25bd50 Convert PDOException to DBError in _fetch() 2020-12-26 17:14:11 +09:00
Kijin Sung
686cfc3478 Create a 'data' field even if there are no results, to prevent warnings 2020-12-18 14:25:48 +09:00
Kijin Sung
8c161bc28d Various fixes to improve PHP 8.0 compatibility
- XmlParser 클래스가 PHP 내장 클래스가 되어버려서 XeXmlParser로 변경
- 함수나 파라미터의 형태가 맞지 않아서 치명적인 오류 나는 곳 수정
- undefined 변수 및 배열 키 다수 수정 (치명적인 오류는 아님)
- 계속 수정중...
2020-10-31 00:25:26 +09:00
Kijin Sung
2a87c060b9 Fix #1442 add prefixes to INSERT/UPDATE queries, too 2020-10-21 22:47:34 +09:00
Kijin Sung
44e73027a1 Don't fetch if the query isn't SELECT
https://xetown.com/questions/1464687
2020-10-04 16:46:51 +09:00
Kijin Sung
4ad35bff8c Support index options 2020-07-11 18:00:36 +09:00
Kijin Sung
25373e6540 Support more index types in DB::addIndex() 2020-07-11 15:50:12 +09:00
Kijin Sung
f6b260d829 Remove args from return value 2020-07-07 14:04:38 +09:00
Kijin Sung
5496180b47 Fix handling of empty string arguments in write queries 2020-07-07 14:03:06 +09:00
Kijin Sung
d2f24dcd12 Replace DB::isValidOldPassword() with Rhymix's own implementation 2020-07-06 11:51:04 +09:00
Kijin Sung
305d045bf6 Fix isValidOldPassword() not working in new DB class 2020-07-06 11:40:13 +09:00
Kijin Sung
ed7130f552 Add 'raw' result type 2020-06-30 23:28:06 +09:00
Kijin Sung
8a3afa03cc More element handling of executeQueryArray() 2020-06-30 23:05:04 +09:00
Kijin Sung
8266114512 Fix erroneous sequence query 2020-06-30 20:49:59 +09:00
Kijin Sung
8cd1cdff9f Fix install problems 2020-06-30 20:05:08 +09:00
Kijin Sung
85df901924 Misc fixes for compatibility with existing XML queries and schemas 2020-06-30 14:43:42 +09:00
Kijin Sung
978d3d167a Fix error handling issues 2020-06-30 12:16:59 +09:00
Kijin Sung
936568a8a5 Improve error handling by using wrapper classes for PDO and PDOStatement 2020-06-30 12:00:42 +09:00
Kijin Sung
47bb30c535 Implement getColumnInfo() 2020-06-30 00:40:10 +09:00
Kijin Sung
58133573b3 Implement addColumn() and modifyColumn() 2020-06-30 00:31:06 +09:00
Kijin Sung
4a7c18f0ac Implement most methods for adding/dropping tables and indexes 2020-06-29 23:16:03 +09:00
Kijin Sung
98bf9e485c Implement isTableExists() and fix return types of prepare(), query(), etc. 2020-06-29 22:46:38 +09:00
Kijin Sung
1903deee40 Fix condition for recording backtraces 2020-06-29 22:37:48 +09:00
Kijin Sung
902b931b89 Provide methods to tell total elapsed time 2020-06-29 22:30:48 +09:00
Kijin Sung
421199b196 Improve debugging 2020-06-29 22:27:45 +09:00
Kijin Sung
84a7b915b7 Implement the COUNT(*) query for pagination 2020-06-29 21:32:25 +09:00
Kijin Sung
7e96affa1a Add prepare() and query() for direct querying 2020-06-29 20:11:04 +09:00
Kijin Sung
8f746af45f Implement more methods for DB class 2020-06-29 17:00:04 +09:00
Kijin Sung
cc271ee154 Initial implementation of DB class based on PDO MySQL driver 2020-06-29 15:45:01 +09:00