diff options
author | Yuchen Pei <id@ypei.org> | 2023-07-14 20:12:47 +1000 |
---|---|---|
committer | Yuchen Pei <id@ypei.org> | 2023-07-14 20:12:47 +1000 |
commit | 53ae35e9ee2d971ce34494f14f7e7c869e46fe4f (patch) | |
tree | 46c42b37ad1f9aa51ea0977450c46cd4682fa471 /emacs/.emacs.d/lisp/my | |
parent | 9e4107cc2d3a9378d690a602c78d96e100ae3525 (diff) |
some minor changes
Diffstat (limited to 'emacs/.emacs.d/lisp/my')
-rw-r--r-- | emacs/.emacs.d/lisp/my/my-mariadb.el | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/emacs/.emacs.d/lisp/my/my-mariadb.el b/emacs/.emacs.d/lisp/my/my-mariadb.el index bd9fd76..355b89e 100644 --- a/emacs/.emacs.d/lisp/my/my-mariadb.el +++ b/emacs/.emacs.d/lisp/my/my-mariadb.el @@ -115,5 +115,44 @@ (goto-char old-frame) (gdb-select-frame))))) +(defun my-mdev-29502-seek-next () + (save-excursion + (while (re-search-forward "\\(\\ *\\)SPIDER_CLEAR_FILE_POS(&\\(.*\\)->mta_conn_mutex_file_pos); +\\ *pthread_mutex_unlock(&\\2->mta_conn_mutex);" nil t) + (replace-match "\\1spider_conn_mutex_unlock(\\2);"))) + (save-excursion + (while (re-search-forward "\\(\\ *\\)DBUG_ASSERT(!\\(.*\\)->mta_conn_mutex_lock_already); +\\ *DBUG_ASSERT(!\\2->mta_conn_mutex_unlock_later); +\\ *\\2->mta_conn_mutex_lock_already = TRUE; +\\ *\\2->mta_conn_mutex_unlock_later = TRUE;" nil t) + (replace-match "\\1spider_conn_mutex_locked(\\2);"))) + (save-excursion + (while (re-search-forward "\\(\\ *\\)DBUG_ASSERT(\\(.*\\)->mta_conn_mutex_lock_already); +\\ *DBUG_ASSERT(\\2->mta_conn_mutex_unlock_later); +\\ *\\2->mta_conn_mutex_lock_already = FALSE; +\\ *\\2->mta_conn_mutex_unlock_later = FALSE;" nil t) + (replace-match "\\1spider_conn_mutex_unlocking(\\2);"))) + (save-excursion + (while (re-search-forward "\\(\\ *\\)pthread_mutex_lock(&\\(.*\\)->mta_conn_mutex); +\\ *SPIDER_SET_FILE_POS(&\\2->mta_conn_mutex_file_pos);" nil t) + (replace-match "\\1spider_conn_mutex_lock(\\2);"))) + ) + +(defun my-mdev-29502-need-lock () + (save-excursion + (while (re-search-forward "\\(\\ *\\)if ([^!].*need_lock_before_set_sql_for_exec(.*" nil t) + (beginning-of-line) + (kill-sexp 3) + (kill-line))) + (save-excursion + (while (re-search-forward "\\(\\ *\\)if (!.*need_lock_before_set_sql_for_exec(.*" nil t) + (beginning-of-line) + (kill-sexp 2) + (kill-line 2) + (c-indent-line-or-region) + (beginning-of-line 3) + (kill-line 1) + ))) + (provide 'my-mariadb) ;;; my-mariadb.el ends here |