tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
X\¬Qc@siddlZddlZddlZdejfd„ƒYZd„Zd„ZedkreeƒndS(iÿÿÿÿNtRegressionTestscBs×eZd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Z    d„Z
d    „Z d
„Z d „Z d „Zd „Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„Zd„ZRS(cCstjdƒ|_dS(Ns:memory:(tsqlitetconnecttcon(tself((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pytsetUpscCs|jjƒdS(N(Rtclose(R((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pyttearDown scCs |jjƒ}|jdƒdS(Nspragma user_version(Rtcursortexecute(Rtcur((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pytCheckPragmaUserVersion#scCsTtjddtjƒ}z |jjƒ}|jdƒWd|jƒ|jƒXdS(Ns:memory:t detect_typesspragma schema_version(RRtPARSE_COLNAMESRRR    R(RRR
((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pytCheckPragmaSchemaVersion(s 
cCsÐtjdddƒ}gtdƒD]}|jƒ^q"}|djdƒxDtdƒD]6}|djdgtdƒD]}|f^qxƒqXWx-tdƒD]}||jd|d    ƒqŸW|jƒdS(
Ns:memory:tcached_statementsiiscreate table test(x)i
sinsert into test(x) values (?)t sselect x from test(RRtxrangeRR    tranget executemanytrollback(RRtxtcursorsti((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pytCheckStatementReset2s%4cCsc|jjƒ}|jdƒ|j|jdddƒ|jdƒ|j|jdddƒdS(Ns select 1 as "foo bar [datetime]"isfoo barsselect 1 as "foo baz"sfoo baz(RRR    t assertEqualt description(RR
((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pytCheckColumnNameWithSpacesAs
  cCsjtjdƒ}g}xDtdƒD]6}|jƒ}|j|ƒ|jdt|ƒƒq"W|jƒdS(Ns:memory:iisselect 1 x union select (RRRRtappendR    tstrR(RRRRR
((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pyt#CheckStatementFinalizationOnCloseDbIs  cCs§tjdkrdStjdƒ}|jdƒ|jdƒy|jdƒWntjk
rcnX|jdƒy|jƒWn!tjk
r¢|jdƒnXdS(    Niis:memory:s3create table foo(x, unique(x) on conflict rollback)sinsert into foo(x) values (1)sinsert into foo(x) values (2)s1pysqlite knew nothing about the implicit ROLLBACK(iii(Rtsqlite_version_infoRR    t DatabaseErrortcommittOperationalErrortfail(RR((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pytCheckOnConflictRollbackWs   cCs4|jjdƒ|jjdƒ|jjdƒdS(sm
        pysqlite would crash with older SQLite versions unless
        a workaround is implemented.
        screate table foo(bar)sdrop table fooN(RR    (R((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pyt-CheckWorkaroundForBuggySqliteTransferBindingsgscCs|jjdƒdS(s
        pysqlite used to segfault with SQLite versions 3.5.x. These return NULL
        for "no-operation" statements
        tN(RR    (R((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pytCheckEmptyStatementpscCstjdƒ}|jƒdS(s    
        With pysqlite 2.4.0 you needed to use a string or a APSW connection
        object for opening database connections.
 
        Formerly, both bytestrings and unicode strings used to work.
 
        Let's make sure unicode strings work in the future.
        u:memory:N(RRR(RR((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pytCheckUnicodeConnectws    cCsŒd}tjddtjƒ}|jdƒ|jdtjjƒfƒ|j|ƒ|jdƒ|jdƒ|jdƒ|j|ƒd    S(
        pysqlite until 2.4.1 did not rebuild the row_cast_map when recompiling
        a statement. This test exhibits the problem.
        sselect * from foos:memory:R screate table foo(bar timestamp)sinsert into foo(bar) values (?)sdrop table fooscreate table foo(bar integer)sinsert into foo(bar) values (5)N(RRtPARSE_DECLTYPESR    tdatetimetnow(RtSELECTR((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pytCheckTypeMapUsageƒs     cCs|jttjidƒdS(s!
        See issue 3312.
        N(t assertRaisest    TypeErrorRtregister_adaptertNone(R((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pytCheckRegisterAdapter’scCs,tjdƒ}|jtt|ddƒdS(s!
        See issue 3312.
        s:memory:tisolation_leveluéN(RRR.tUnicodeEncodeErrortsetattr(RR((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pytCheckSetIsolationLevel˜scCs†dtjfd„ƒY}tjdƒ}||ƒ}y$|jdƒjƒ|jdƒWn'tjk
rnn|jdƒnXdS(s[
        Verifies that cursor methods check wether base class __init__ was called.
        tCursorcBseZd„ZRS(cSsdS(N((RR((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pyt__init__¥s(t__name__t
__module__R8(((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pyR7¤ss:memory:s
select 4+5s#should have raised ProgrammingErrorN(RR7RR    tfetchallR#tProgrammingError(RR7RR
((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pytCheckCursorConstructorCallCheck s cCspdtjfd„ƒY}|dƒ}y|jƒ}|jdƒWn'tjk
rXn|jdƒnXdS(s_
        Verifies that connection methods check wether base class __init__ was called.
        t
ConnectioncBseZd„ZRS(cSsdS(N((Rtname((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pyR8·s(R9R:R8(((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pyR>¶ss:memory:s#should have raised ProgrammingErrorN(RR>RR#R<(RR>RR
((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pyt#CheckConnectionConstructorCallCheck²s  csÖdtjf‡fd†ƒY}dtjfd„ƒY‰|dƒ}|jƒ}|jdƒ|jddddgƒ|jd ƒ|jƒy|jƒ|jd ƒWn'tj    k
r¾n|jd ƒnXd S(sœ
        Verifies that subclassed cursor classes are correctly registered with
        the connection object, too.  (fetch-across-rollback problem)
        R>cseZ‡fd†ZRS(cs
ˆ|ƒS(N((R(R7(s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pyRÉs(R9R:R((R7(s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pyR>ÈsR7cBseZd„ZRS(cSstjj||ƒdS(N(RR7R8(RR((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pyR8Ís(R9R:R8(((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pyR7Ìss:memory:screate table foo(x)sinsert into foo(x) values (?)iiisselect x from foos!should have raised InterfaceErrorN(i(i(i(
RR>R7RR    RRR;R#tInterfaceError(RR>RR
((R7s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pytCheckCursorRegistrationÃs    
 
cCstjdddƒ}dS(s§
        Verifies that creating a connection in autocommit mode works.
        2.5.3 introduced a regression so that these could no longer
        be created.
        s:memory:R3N(RRR1(RR((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pytCheckAutoCommitÞscCsF|jjƒ}|jdƒ|jdƒ|jdƒ|jƒ}dS(s‡
        Verifies that running a PRAGMA statement that does an autocommit does
        work. This did not work in 2.5.3/2.5.4.
        screate table foo(bar)sinsert into foo(bar) values (5)spragma page_sizeN(RRR    tfetchone(RR
trow((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pytCheckPragmaAutocommitæs
   cCs„ddd„ƒY}|ƒ}|jt|jj|ƒ|jt|jj|ƒ|jt|jj|ƒ|jt|jj|ƒdS(sÎ
        See http://bugs.python.org/issue7478
 
        It was possible to successfully register callbacks that could not be
        hashed. Return codes of PyDict_SetItem were not checked properly.
        t NotHashablecBseZd„Zd„ZRS(c_sdS(N((Rtargstkw((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pyt__call__úscSs tƒ‚dS(N(R/(R((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pyt__hash__üs(R9R:RJRK(((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pyRGùs    N((R.R/Rtcreate_functiontcreate_aggregatetset_authorizertset_progress_handler(RRGtvar((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pyt CheckSetDictòs     cCs|jtj|jdƒdS(s}
        Call a connection with a non-string SQL request: check error handling
        of the statement constructor.
        iN(R.RtWarningR(R((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pytCheckConnectionCallscs~tjdƒ}|jƒ‰ˆjdƒˆjdƒ‡fd†}|jtjƒ"ˆjdd„|ƒDƒƒWdQXdS(sÝ
        http://bugs.python.org/issue10811
 
        Recursively using a cursor, such as when reusing it from a generator led to segfaults.
        Now we catch recursive cursor usage and raise a ProgrammingError.
        s:memory:screate table a (bar)screate table b (baz)c3sˆjddƒdVdS(Nsinsert into a (bar) values (?)i(i(R    ((R
(s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pytfoossinsert into b (baz) values (?)css|]}|fVqdS(N((t.0R((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pys    <genexpr>sN(RRRR    R.R<R(RRRT((R
s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pytCheckRecursiveCursorUse s       c CsËtjddtjƒ}|jƒ}|jdƒ|jdƒ|jdƒ|jdƒg|jƒD]}|d^qe}|j|tjdd    d    d
d dd ƒtjdd    d    d
d dd ƒgƒdS(sË
        http://bugs.python.org/issue14720
 
        The microsecond parsing of convert_timestamp() should pad with zeros,
        since the microsecond string "456" actually represents "456000".
        s:memory:R sCREATE TABLE t (x TIMESTAMP)s4INSERT INTO t (x) VALUES ('2012-04-04 15:06:00.456')s:INSERT INTO t (x) VALUES ('2012-04-04 15:06:00.123456789')sSELECT * FROM tiiÜiiii@õi@âN(RRR)RR    R;RR*(RRR
Rtvalues((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pyt'CheckConvertTimestampMicrosecondPadding s     #    (R9R:RRR RRRRR$R%R'R(R-R2R6R=R@RBRCRFRQRSRVRX(((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pyRs.                
                                                                           cCs"tjtdƒ}tj|fƒS(NtCheck(tunittestt    makeSuiteRt    TestSuite(tregression_suite((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pytsuite;scCs tjƒ}|jtƒƒdS(N(RZtTextTestRunnertrunR^(trunner((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pyttest?s t__main__(    R*RZtsqlite3RtTestCaseRR^RbR9(((s_/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/sqlite3/test/regression.pyt<module>s   ÿ