[20191125]oracel sql parsing function qcplgte 2.txt
–//参考前面的测试:http://blog.itpub.net/267265/viewspace-2665273/=>[20191122]oracel sql parsing function qcplgte.txt
–//补充一些测试:
1.环境:
–//session 1:
scott@book> @ ver1
port_string version banner
—————————— ————– ——————————————————————————–
x86_64/linux 2.4.xx 11.2.0.4.0 oracle database 11g enterprise edition release 11.2.0.4.0 – 64bit production
scott@book> @ spid
sid serial# process server spid pid p_serial# c50
———- ———- ———————— ——— —— ——- ———- ————————————————–
86 15 964 dedicated 965 30 8 alter system kill session ‘86,15’ immediate;
scott@book> alter session set cursor_sharing=force ;
session altered.
2.测试:
–//session 1:
scott@book> select * from dept where deptno=41;
no rows selected
–//session 2:
0x7fff1e373528: “select * from dept where deptno=41”
0x7fff1e37352e: ” * from dept where deptno=41″
0x7fff1e373530: ” from dept where deptno=41″
0x7fff1e373535: ” dept where deptno=41″
0x7fff1e37353a: ” where deptno=41″
0x7fff1e373540: ” deptno=41″
0x7fff1e373547: “=41”
0x7fff1e373548: “41”
0x7fff1e37354a: “”
0x7db65d78: “select * from dept where deptno=:\”sys_b_0\””
0x7db65d7e: ” * from dept where deptno=:\”sys_b_0\””
0x7db65d80: ” from dept where deptno=:\”sys_b_0\””
0x7db65d85: ” dept where deptno=:\”sys_b_0\””
0x7db65d8a: ” where deptno=:\”sys_b_0\””
0x7db65d90: ” deptno=:\”sys_b_0\””
0x7db65d97: “=:\”sys_b_0\””
0x7db65d91: “deptno=:\”sys_b_0\””
0x7db65d97: “=:\”sys_b_0\””
0x7db65d98: “:\”sys_b_0\””
0x7db65d99: “\”sys_b_0\””
0x7db65da2: “”
0x7f6fca73d9f0: “select * from dept where deptno=:\”sys_b_0\””
0x7f6fca73d9f6: ” * from dept where deptno=:\”sys_b_0\””
0x7f6fca73d9f8: ” from dept where deptno=:\”sys_b_0\””
0x7f6fca73d9fd: ” dept where deptno=:\”sys_b_0\””
0x7f6fca73da02: ” where deptno=:\”sys_b_0\””
0x7f6fca73da08: ” deptno=:\”sys_b_0\””
0x7f6fca73da0f: “=:\”sys_b_0\””
0x7f6fca73da10: “:\”sys_b_0\””
0x7f6fca73da11: “\”sys_b_0\””
0x7f6fca73da1a: “”
0x7f6fca73d978: “select * from dept where deptno = :\”sys_b_0\””
0x7f6fca73d97e: ” * from dept where deptno = :\”sys_b_0\””
0x7f6fca73d980: ” from dept where deptno = :\”sys_b_0\””
0x7f6fca73d985: ” dept where deptno = :\”sys_b_0\””
0x7f6fca73d98a: ” where deptno = :\”sys_b_0\””
0x7f6fca73d990: ” deptno = :\”sys_b_0\””
0x7f6fca73d997: ” = :\”sys_b_0\””
0x7f6fca73d999: ” :\”sys_b_0\””
0x7f6fca73d99b: “\”sys_b_0\””
0x7cc6fb76: “deptno”
0x7cc6fb7c: “”
0x7c7b8bfe: “dname”
0x7c7b8c03: “”
0x7c7b8b26: “loc”
0x7c7b8b29: “”
–//session 1:
scott@book> select * from dept where deptno=42;
no rows selected
–//session 2:
0x7fff1e373528: “select * from dept where deptno=42”
0x7fff1e37352e: ” * from dept where deptno=42″
0x7fff1e373530: ” from dept where deptno=42″
0x7fff1e373535: ” dept where deptno=42″
0x7fff1e37353a: ” where deptno=42″
0x7fff1e373540: ” deptno=42″
0x7fff1e373547: “=42”
0x7fff1e373548: “42”
0x7fff1e37354a: “”
0x7cc6fb76: “deptno”
0x7cc6fb7c: “”
0x7c7b8bfe: “dname”
0x7c7b8c03: “”
0x7c7b8b26: “loc”
0x7c7b8b29: “”
–//session 1:
scott@book> select * from dept where deptno=41;
no rows selected
–//session 2:
0x7cc6fb76: “deptno”
0x7cc6fb7c: “”
0x7c7b8bfe: “dname”
0x7c7b8c03: “”
0x7c7b8b26: “loc”
0x7c7b8b29: “”
–//session 1:
–//执行多次.
scott@book> select * from dept where deptno=41;
no rows selected
–//session 2:
0x7cc6fb76: “deptno”
0x7cc6fb7c: “”
0x7c7b8bfe: “dname”
0x7c7b8c03: “”
0x7c7b8b26: “loc”
0x7c7b8b29: “”
–//在cursor_sharing=force的情况,如果绑定变量参数不同才会调用1组qcplgte.不过里面的字段不知道为什么每次都要调用.
–//即使是明确字段的情况下也是一样.
–//session 1:
scott@book> select dname from dept where deptno=41;
no rows selected
–//session 1 调用多次select dname from dept where deptno=41;
–//session 2:
0x7fff1e373528: “select dname from dept where deptno=41”
0x7fff1e37352e: ” dname from dept where deptno=41″
0x7fff1e373534: ” from dept where deptno=41″
0x7fff1e373539: ” dept where deptno=41″
0x7fff1e37353e: ” where deptno=41″
0x7fff1e373544: ” deptno=41″
0x7fff1e37354b: “=41”
0x7fff1e37354c: “41”
0x7fff1e37354e: “”
0x7c8622f8: “select dname from dept where deptno=:\”sys_b_0\””
0x7c8622fe: ” dname from dept where deptno=:\”sys_b_0\””
0x7c862304: ” from dept where deptno=:\”sys_b_0\””
0x7c8622ff: “dname from dept where deptno=:\”sys_b_0\””
0x7c862304: ” from dept where deptno=:\”sys_b_0\””
0x7c8622ff: “dname from dept where deptno=:\”sys_b_0\””
0x7c862304: ” from dept where deptno=:\”sys_b_0\””
0x7c862309: ” dept where deptno=:\”sys_b_0\””
0x7c86230e: ” where deptno=:\”sys_b_0\””
0x7c862314: ” deptno=:\”sys_b_0\””
0x7c86231b: “=:\”sys_b_0\””
0x7c862315: “deptno=:\”sys_b_0\””
0x7c86231b: “=:\”sys_b_0\””
0x7c86231c: “:\”sys_b_0\””
0x7c86231d: “\”sys_b_0\””
0x7c862326: “”
0x7f6fca73d9f8: “select dname from dept where deptno=:\”sys_b_0\””
0x7f6fca73d9fe: ” dname from dept where deptno=:\”sys_b_0\””
0x7f6fca73da04: ” from dept where deptno=:\”sys_b_0\””
0x7f6fca73da09: ” dept where deptno=:\”sys_b_0\””
0x7f6fca73da0e: ” where deptno=:\”sys_b_0\””
0x7f6fca73da14: ” deptno=:\”sys_b_0\””
0x7f6fca73da1b: “=:\”sys_b_0\””
0x7f6fca73da1c: “:\”sys_b_0\””
0x7f6fca73da1d: “\”sys_b_0\””
0x7f6fca73da26: “”
0x7f6fca73d978: “select dname from dept where deptno = :\”sys_b_0\””
0x7f6fca73d97e: ” dname from dept where deptno = :\”sys_b_0\””
0x7f6fca73d984: ” from dept where deptno = :\”sys_b_0\””
0x7f6fca73d989: ” dept where deptno = :\”sys_b_0\””
0x7f6fca73d98e: ” where deptno = :\”sys_b_0\””
0x7f6fca73d994: ” deptno = :\”sys_b_0\””
0x7f6fca73d99b: ” = :\”sys_b_0\””
0x7f6fca73d99d: ” :\”sys_b_0\””
0x7f6fca73d99f: “\”sys_b_0\””
0x7c11fd1e: “dname”
0x7c11fd23: “”
0x7c11fd1e: “dname”
0x7c11fd23: “”
0x7c11fd1e: “dname”
0x7c11fd23: “”
0x7c11fd1e: “dname”
0x7c11fd23: “”