Commit 8d1c68ed authored by Yuchen Pei's avatar Yuchen Pei

MDEV-30576 Add a script to output spider errors

usage example:

From the build dir:

$ ./storage/spider/pspderr 12719
\#define ER_SPIDER_INFINITE_LOOP_NUM 12719
\#define ER_SPIDER_INFINITE_LOOP_STR "An infinite loop is detected when opening table %s.%s"

binary distribution:

$ ./scripts/make_binary_distribution
CPack: Create package using TGZ
CPack: Install projects
CPack: - Run preinstall target for: MySQL
CPack: - Install project: MySQL []
CPack: Create package
CPack: - package: /home/ycp/source/mariadb-server/10.5/build/mariadb-10.5.27-linux-x86_64.tar.gz generated.
$ tar -xf mariadb-10.5.27-linux-x86_64.tar.gz -C /tmp
$ /tmp/mariadb-10.5.27-linux-x86_64/lib/plugin/pspderr 12719
\#define ER_SPIDER_INFINITE_LOOP_NUM 12719
\#define ER_SPIDER_INFINITE_LOOP_STR "An infinite loop is detected when opening table %s.%s"
parent 872dbec9
...@@ -58,6 +58,19 @@ ELSE() ...@@ -58,6 +58,19 @@ ELSE()
IF(NOT TARGET spider) IF(NOT TARGET spider)
RETURN() RETURN()
ENDIF() ENDIF()
CONFIGURE_FILE(spd_err.h . COPYONLY)
CONFIGURE_FILE(pspderr . COPYONLY)
INSTALL(FILES
"spd_err.h"
DESTINATION ${INSTALL_PLUGINDIR}
COMPONENT Server
)
INSTALL_SCRIPT(
"pspderr"
DESTINATION ${INSTALL_PLUGINDIR}
COMPONENT Server
)
ENDIF() ENDIF()
IF(ORACLE_INCLUDE_DIR AND ORACLE_OCI_LIBRARY) IF(ORACLE_INCLUDE_DIR AND ORACLE_OCI_LIBRARY)
......
#!/bin/bash
er=$(grep "$1" $(dirname "$0")/spd_err.h | grep -oE [A-Z_]+_NUM | sed 's/_NUM//')
grep -E "#define[[:space:]]+$er(_NUM|_STR)" $(dirname "$0")/spd_err.h
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment