Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
cpython
Commits
78576508
Kaydet (Commit)
78576508
authored
Mar 05, 2010
tarafından
Gerhard Häring
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #7670: sqlite3: Fixed crashes when operating on closed connections.
üst
94820327
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
89 additions
and
0 deletions
+89
-0
dbapi.py
Lib/sqlite3/test/dbapi.py
+67
-0
NEWS
Misc/NEWS
+2
-0
connection.c
Modules/_sqlite/connection.c
+20
-0
No files found.
Lib/sqlite3/test/dbapi.py
Dosyayı görüntüle @
78576508
...
...
@@ -744,6 +744,73 @@ class ClosedTests(unittest.TestCase):
except
:
self
.
fail
(
"Should have raised a ProgrammingError"
)
def
CheckClosedCreateFunction
(
self
):
con
=
sqlite
.
connect
(
":memory:"
)
con
.
close
()
def
f
(
x
):
return
17
try
:
con
.
create_function
(
"foo"
,
1
,
f
)
self
.
fail
(
"Should have raised a ProgrammingError"
)
except
sqlite
.
ProgrammingError
:
pass
except
:
self
.
fail
(
"Should have raised a ProgrammingError"
)
def
CheckClosedCreateAggregate
(
self
):
con
=
sqlite
.
connect
(
":memory:"
)
con
.
close
()
class
Agg
:
def
__init__
(
self
):
pass
def
step
(
self
,
x
):
pass
def
finalize
(
self
):
return
17
try
:
con
.
create_aggregate
(
"foo"
,
1
,
Agg
)
self
.
fail
(
"Should have raised a ProgrammingError"
)
except
sqlite
.
ProgrammingError
:
pass
except
:
self
.
fail
(
"Should have raised a ProgrammingError"
)
def
CheckClosedSetAuthorizer
(
self
):
con
=
sqlite
.
connect
(
":memory:"
)
con
.
close
()
def
authorizer
(
*
args
):
return
sqlite
.
DENY
try
:
con
.
set_authorizer
(
authorizer
)
self
.
fail
(
"Should have raised a ProgrammingError"
)
except
sqlite
.
ProgrammingError
:
pass
except
:
self
.
fail
(
"Should have raised a ProgrammingError"
)
def
CheckClosedSetProgressCallback
(
self
):
con
=
sqlite
.
connect
(
":memory:"
)
con
.
close
()
def
progress
():
pass
try
:
con
.
set_progress_handler
(
progress
,
100
)
self
.
fail
(
"Should have raised a ProgrammingError"
)
except
sqlite
.
ProgrammingError
:
pass
except
:
self
.
fail
(
"Should have raised a ProgrammingError"
)
def
CheckClosedCall
(
self
):
con
=
sqlite
.
connect
(
":memory:"
)
con
.
close
()
try
:
con
()
self
.
fail
(
"Should have raised a ProgrammingError"
)
except
sqlite
.
ProgrammingError
:
pass
except
:
self
.
fail
(
"Should have raised a ProgrammingError"
)
def
suite
():
module_suite
=
unittest
.
makeSuite
(
ModuleTests
,
"Check"
)
connection_suite
=
unittest
.
makeSuite
(
ConnectionTests
,
"Check"
)
...
...
Misc/NEWS
Dosyayı görüntüle @
78576508
...
...
@@ -356,6 +356,8 @@ Library
Extension Modules
-----------------
- Issue #7670: sqlite3: Fixed crashes when operating on closed connections.
- Stop providing crtassem.h symbols when compiling with Visual Studio 2010, as
msvcr100.dll is not a platform assembly anymore.
...
...
Modules/_sqlite/connection.c
Dosyayı görüntüle @
78576508
...
...
@@ -690,6 +690,10 @@ PyObject* pysqlite_connection_create_function(pysqlite_Connection* self, PyObjec
int
narg
;
int
rc
;
if
(
!
pysqlite_check_thread
(
self
)
||
!
pysqlite_check_connection
(
self
))
{
return
NULL
;
}
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwargs
,
"siO"
,
kwlist
,
&
name
,
&
narg
,
&
func
))
{
...
...
@@ -719,6 +723,10 @@ PyObject* pysqlite_connection_create_aggregate(pysqlite_Connection* self, PyObje
static
char
*
kwlist
[]
=
{
"name"
,
"n_arg"
,
"aggregate_class"
,
NULL
};
int
rc
;
if
(
!
pysqlite_check_thread
(
self
)
||
!
pysqlite_check_connection
(
self
))
{
return
NULL
;
}
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwargs
,
"siO:create_aggregate"
,
kwlist
,
&
name
,
&
n_arg
,
&
aggregate_class
))
{
return
NULL
;
...
...
@@ -809,6 +817,10 @@ PyObject* pysqlite_connection_set_authorizer(pysqlite_Connection* self, PyObject
static
char
*
kwlist
[]
=
{
"authorizer_callback"
,
NULL
};
int
rc
;
if
(
!
pysqlite_check_thread
(
self
)
||
!
pysqlite_check_connection
(
self
))
{
return
NULL
;
}
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwargs
,
"O:set_authorizer"
,
kwlist
,
&
authorizer_cb
))
{
return
NULL
;
...
...
@@ -834,6 +846,10 @@ PyObject* pysqlite_connection_set_progress_handler(pysqlite_Connection* self, Py
static
char
*
kwlist
[]
=
{
"progress_handler"
,
"n"
,
NULL
};
if
(
!
pysqlite_check_thread
(
self
)
||
!
pysqlite_check_connection
(
self
))
{
return
NULL
;
}
if
(
!
PyArg_ParseTupleAndKeywords
(
args
,
kwargs
,
"Oi:set_progress_handler"
,
kwlist
,
&
progress_handler
,
&
n
))
{
return
NULL
;
...
...
@@ -948,6 +964,10 @@ PyObject* pysqlite_connection_call(pysqlite_Connection* self, PyObject* args, Py
PyObject
*
weakref
;
int
rc
;
if
(
!
pysqlite_check_thread
(
self
)
||
!
pysqlite_check_connection
(
self
))
{
return
NULL
;
}
if
(
!
PyArg_ParseTuple
(
args
,
"O"
,
&
sql
))
{
return
NULL
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment