注册
给SQL注入hint
技术分享/ 文章详情 /

给SQL注入hint

醉酒方知浓 2025/03/07 153 0 0

使用SF_INJECT_HINT函数需设置INI 参数 ENABLE_INJECT_HINT为1

SP_SET_PARA_VALUE(1,'ENABLE_INJECT_HINT',1); 

INJECT HINT函数使用示例(精确匹配)

sf_inject_hint(
sql_text => 'select a.department_id, a.employee_name, b.department_name from dmhr.employee a, dmhr.department b where a.department_id = b.department_id;',
hint_text =>'use_nl(a,b)',
name =>'TESTSQL',
description => 'this is a test hint',
validate => true);

INJECT HINT函数使用示例(模糊匹配)

sf_inject_hint(
sql_text => 'from dmhr.employee a, dmhr.department b where a.department_id=b.department_id',
hint_text =>'use_nl(a,b)',
name =>'TESTJOIN',
description => 'this is a test join hint.',
validate => true,
fuzzy = true
);

查询SYSINJECTHINT视图可以查看已指定的 SQL 语句和对应的 HINT

select NAME, DESCRIPTION, VALIDATE, SQL_TEXT, HINT_TEXT, CREATOR, CRTDATE from SYSINJECTHINT;

将设置INJECT hint删除

sf_deinject_hint('TESTJOIN');
评论
后发表回复

作者

文章

阅读量

获赞

扫一扫
联系客服