⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.124
Server IP:
50.28.103.30
Server:
Linux host.jcukjv-lwsites.com 4.18.0-553.22.1.el8_10.x86_64 #1 SMP Tue Sep 24 05:16:59 EDT 2024 x86_64
Server Software:
nginx/1.28.0
PHP Version:
8.3.12
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
www
/
server
/
mysql
/
mysql-test
/
include
/
View File Name :
show_json_object.inc
# Utility function to extract only a certain # JSON object/array from some optimizer trace. # @param extract a string of the form 'XXX S' # where XXX is object or array's key, and S is the symbol after this # key ( [ or { ). --disable_query_log DELIMITER |; CREATE FUNCTION show_json_object(extract TEXT, trace TEXT) RETURNS TEXT BEGIN DECLARE pos INT; DECLARE opened INT; DECLARE closed INT; DECLARE inside INT; DECLARE stop INT; DECLARE open_symbol VARCHAR(1); DECLARE close_symbol VARCHAR(1); SET pos = LOCATE(extract, trace); IF pos = 0 THEN RETURN 'NOT FOUND'; END IF; SET open_symbol = SUBSTRING(extract, -1); IF open_symbol = '{' THEN SET close_symbol = '}'; ELSEIF open_symbol = '[' THEN SET close_symbol = ']'; ELSE RETURN 'ERROR: 1st argument does not end with { or ['; END IF; SET trace = SUBSTRING(trace, pos); SET pos = 1; SET inside = 0; # A counter to break an infinite loop, in case of bug in SP or bad trace SET stop = 1000; LOOP SET stop = stop - 1; IF stop = 0 THEN RETURN "ERROR"; END IF; SET closed = LOCATE(close_symbol, trace, pos); SET opened = LOCATE(open_symbol, trace, pos); IF opened = 0 THEN # symbol not found, treat it as "very far ahead" SET opened = 2000000; END IF; IF opened < closed THEN SET inside = inside + 1; SET pos = opened + 1; ELSE SET inside = inside - 1; SET pos = closed + 1; END IF; IF inside = 0 THEN RETURN SUBSTRING(trace, 1, pos); END IF; END LOOP; END| DELIMITER ;| --enable_query_log