From 53ae35e9ee2d971ce34494f14f7e7c869e46fe4f Mon Sep 17 00:00:00 2001 From: Yuchen Pei Date: Fri, 14 Jul 2023 20:12:47 +1000 Subject: some minor changes --- emacs/.emacs.d/lisp/my/my-mariadb.el | 39 ++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) (limited to 'emacs/.emacs.d/lisp') 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 -- cgit v1.2.3