Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f4e7bf1

Browse files
committed
minor update regarding support for Unicode characters in Oracle
1 parent 704488a commit f4e7bf1

2 files changed

Lines changed: 7 additions & 3 deletions

File tree

lib/core/common.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2682,7 +2682,11 @@ def decodeIntToUnicode(value):
26822682
Decodes inferenced integer value with usage of current page encoding
26832683
"""
26842684
try:
2685-
return unichr(value)
2685+
# http://dev.mysql.com/doc/refman/5.0/en/string-functions.html#function_ord
2686+
if Backend.getIdentifiedDbms() in (DBMS.MYSQL,):
2687+
return struct.pack('B' if value<256 else '<H', value).decode(kb.pageEncoding or UNICODE_ENCODING)
2688+
else:
2689+
return unichr(value)
26862690
except:
26872691
return INFERENCE_UNKNOWN_CHAR
26882692

xml/queries.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -224,9 +224,9 @@
224224
<count query="COUNT(%s)"/>
225225
<comment query="--"/>
226226
<timedelay query="BEGIN DBMS_LOCK.SLEEP(%d); END" query2="EXEC DBMS_LOCK.SLEEP(%d.00)" query3="EXEC USER_LOCK.SLEEP(%d.00)"/>
227-
<substring query="SUBSTR((%s),%d,%d)"/>
227+
<substring query="SUBSTRC((%s),%d,%d)"/>
228228
<case query="SELECT (CASE WHEN (%s) THEN 1 ELSE 0 END)"/>
229-
<inference query="ASCII(SUBSTR((%s),%d,1)) > %d"/>
229+
<inference query="ASCII(SUBSTRC((%s),%d,1)) > %d"/>
230230
<banner query="SELECT banner FROM v$version WHERE ROWNUM=1"/>
231231
<current_user query="SELECT USER FROM DUAL"/>
232232
<!--

0 commit comments

Comments
 (0)