mirror of
https://github.com/openwrt/packages.git
synced 2026-10-14 03:27:03 +04:00
1.2.1 fixes a SQL injection via wrongly escaped bytes parameters on the big5, gbk, sjis, cp932 and gb18030 charsets (GHSA-x4f8-9hx9-hpp9). Drop the pymysql.converters assertions from test.sh: escape_dict is now a non-callable placeholder kept only for aiomysql, and upstream states the module is internal with no compatibility guarantee. Signed-off-by: Alexandru Ardelean <alex@shruggie.ro>
47 lines
965 B
Bash
47 lines
965 B
Bash
#!/bin/sh
|
|
|
|
[ "$1" = python3-pymysql ] || exit 0
|
|
|
|
python3 -c '
|
|
import pymysql
|
|
|
|
# Verify version
|
|
assert pymysql.__version__
|
|
|
|
# Verify core exports
|
|
assert hasattr(pymysql, "connect")
|
|
assert hasattr(pymysql, "connections")
|
|
assert hasattr(pymysql, "cursors")
|
|
|
|
# Verify cursor types are importable
|
|
from pymysql.cursors import Cursor, DictCursor, SSCursor, SSDictCursor
|
|
|
|
# Verify exception classes are importable
|
|
from pymysql import (
|
|
err,
|
|
MySQLError,
|
|
OperationalError,
|
|
InterfaceError,
|
|
DatabaseError,
|
|
IntegrityError,
|
|
DataError,
|
|
)
|
|
|
|
# Verify connections.Connection class exists
|
|
from pymysql import connections
|
|
assert connections.Connection is not None
|
|
|
|
# Verify callable cursor classes
|
|
assert callable(Cursor)
|
|
assert callable(DictCursor)
|
|
assert callable(SSCursor)
|
|
assert callable(SSDictCursor)
|
|
|
|
# Verify constants module
|
|
import pymysql.constants as constants
|
|
assert hasattr(constants, "CR")
|
|
assert hasattr(constants, "ER")
|
|
|
|
print("pymysql OK")
|
|
'
|