@@ -210,54 +210,22 @@ void ObErrorInfoMgr::print_ob_error()
210210 is_compat_header_printed = true ;
211211 printf (" \t\t MySQL: %d(%s)\n " , mysql_errno, sqlstate);
212212 }
213- bool need_oracle_print = false ;
214- int oracle_errno = ob_errpkt_errno (ob_error_code, true );
215- if (oracle_errno != -ob_error_code) {
216- if (ORACLE_SPECIAL_ERROR_CODE == oracle_errno) {
217- // Compatible error for ORA-00600
218- if (is_special_oracle_error_compatible (ob_error_code)) {
219- need_oracle_print = true ;
220- }
221- } else {
222- need_oracle_print = true ;
223- }
224- if (need_oracle_print) {
225- const char *oracle_err_msg = ob_errpkt_strerror (ob_error_code, true );
226- if (nullptr != oracle_err_msg) {
227- if (false == is_compat_header_printed) {
228- printf (" \t %s\n " , compatiable_header);
229- is_compat_header_printed = true ;
230- }
231- char oracle_error_code[ORACLE_MSG_PREFIX] = {0 };
232- strncpy (oracle_error_code, oracle_err_msg, ORACLE_MSG_PREFIX-2 );
233- printf (" \t\t Oracle: %s\n " , oracle_error_code);
234- }
235- }
236- }
213+ // Oracle error code printing removed - seekdb no longer supports Oracle compatibility mode
237214 }
238215}
239216// ////////////////////////////////////////////////////////////
240217static void print_help ()
241218{
242219 printf (" This is the ob_error tool. Usage:\n\n "
243220 " ob_error [option]\n "
244- " ob_error [facility] error_code [-a ARGUMENT]\n "
245- " ob_error [facility] error_code [--argument ARGUMENT]\n "
221+ " ob_error [facility] error_code\n "
246222 " Get the error information, reasons and possible solutions.\n\n "
247223 " Query an error:\n\n "
248224 " ob_error error_code\n\n "
249225 " Query an error in MySQL mode:\n\n "
250226 " ob_error MY error_code\n\n "
251- " Query an error in ORACLE mode:\n\n "
252- " ob_error facility error_code\n "
253- " ob_error facility error_code -a ARGUMENT\n "
254- " ob_error facility error_code --argument ARGUMENT\n\n "
255- " ARGUMENT: \n\n "
256- " Positive number OceanBase error_code in ORA-00600 error output.\n\n "
257227 " facility:\n\n "
258- " MY MySQL mode.\n "
259- " ORA ORACLE mode. Error from database.\n "
260- " PLS ORACLE mode. Error from the stored procedure.\n\n "
228+ " MY MySQL mode.\n\n "
261229 " Normal options:\n\n "
262230 " --help, -h Print this message and then exit.\n "
263231 " --version, -V Print version information and then exit.\n\n " );
@@ -473,74 +441,13 @@ bool add_mysql_info(int error_code, ObErrorInfoMgr* mgr)
473441
474442bool add_oracle_info (Fac oracle_facility, int error_code, int argument, ObErrorInfoMgr* mgr)
475443{
476- bool bret = false ;
477- if (nullptr == mgr) {
478- ERROR_PRINT (" ObErrorInfoMgr *mgr is null.\n " );
479- bret = true ;
480- } else if (0 <= error_code && ORACLE_MAX_ERROR_CODE > error_code) {
481- int info_count = 0 ;
482- int ob_error = -1 ;
483- // Before being called, ensure that argument cannot be set when nullptr == oracle_facility
484- if (NONE == oracle_facility) {
485- // Handle the case where error is ORA-error_code
486- bret |= add_error_info (error_code, ORA, g_oracle_ora, mgr);
487- // Handle the case where error is PLS-error_code
488- bret |= add_error_info (error_code, PLS, g_oracle_pls, mgr);
489- } else {
490- if (ORA == oracle_facility) {
491- if (ORACLE_SPECIAL_ERROR_CODE == error_code) {
492- // 600 is a special error code.
493- // If there is no '-a ARG' parameter, the original possible error of ora-00600 will be output
494- if (-1 == argument) {
495- bret = add_error_info (error_code, ORA, g_oracle_ora, mgr);
496- } else {
497- ob_error = argument;
498- const char * error_usr_msg = ob_errpkt_str_user_error (-ob_error, true );
499- if (nullptr != error_usr_msg) {
500- // verify that the error is ora-00600
501- if (-OB_ERR_PROXY_REROUTE == ob_errpkt_errno (-ob_error, true ) ||
502- ORACLE_SPECIAL_ERROR_CODE == ob_errpkt_errno (-ob_error, true )) {
503- const char * error_msg = ob_errpkt_strerror (-ob_error, true );
504- const char * error_name = ob_error_name (-ob_error);
505- const char * error_cause = ob_error_cause (-ob_error);
506- const char * error_solution = ob_error_solution (-ob_error);
507- if (mgr->insert_oracle_error (error_name,
508- error_msg + ORACLE_MSG_PREFIX,
509- error_cause,
510- error_solution,
511- ORA,
512- error_code,
513- ob_error)) {
514- bret = true ;
515- }
516- }
517- }
518- }
519- } else {
520- // '-a ARG' parameter only supports ora-00600 error
521- if (-1 != argument) {
522- printf (" error: '-a ARG' is unsupport in this scene\n "
523- " Use 'ob_error ora 600 -a=ARG'.\n "
524- " Use 'ob_error --help' for help.\n " );
525- bret = true ;
526- } else {
527- bret = add_error_info (error_code, ORA, g_oracle_ora, mgr);
528- }
529- }
530- } else if (PLS == oracle_facility) {
531- // '-a ARG' parameter only supports ora-00600 error
532- if (-1 != argument) {
533- printf (" error: '-a ARG' is unsupport in this scene\n "
534- " Use 'ob_error ora 600 -a ARG'.\n "
535- " Use 'ob_error --help' for help.\n " );
536- bret = true ;
537- } else {
538- bret = add_error_info (error_code, PLS, g_oracle_pls, mgr);
539- }
540- }
541- }
542- }
543- return bret;
444+ // Oracle support has been removed from seekdb
445+ // This function now returns false to indicate no Oracle error info is available
446+ (void )oracle_facility;
447+ (void )error_code;
448+ (void )argument;
449+ (void )mgr;
450+ return false ;
544451}
545452
546453// prevent the atoi parse "123abc"
@@ -777,24 +684,7 @@ static bool ob_init_error_to_oberror(int ora_err[][OB_MAX_SAME_ERROR_COUNT], int
777684 bret = false ;
778685 }
779686 }
780- // init ora_err/pls_err map
781- const char * error_usr_msg = ob_oracle_str_user_error (-i);
782- error_code = ob_oracle_errno (-i);
783- if (-1 != error_code && NULL != error_usr_msg) {
784- if (0 > error_code)
785- error_code = -error_code;
786- if (0 == strncmp (error_usr_msg, facility_str[ORA], strlen (facility_str[ORA]))) {
787- if (!insert_oracle_error_slot_ora (ora_err, error_code, i)) {
788- ERROR_PRINT (" error: OB_MAX_SAME_ERROR_COUNT is not enough for ORA-%05d(OB Error %d)\n " , error_code, i);
789- bret = false ;
790- }
791- } else if (0 == strncmp (error_usr_msg, facility_str[PLS], strlen (facility_str[PLS]))) {
792- if (!insert_oracle_error_slot_pls (pls_err, error_code, i)) {
793- ERROR_PRINT (" error: OB_MAX_SAME_ERROR_COUNT is not enough for PLS-%05d(OB Error %d)\n " , error_code, i);
794- bret = false ;
795- }
796- }
797- }
687+ // Oracle error mapping removed - seekdb no longer supports Oracle compatibility mode
798688 }
799689 return bret;
800690}
0 commit comments