Limit search for NULL rows when adding a NOT NULL constraint

This commit is contained in:
Nicolas Évrard
2024-03-05 16:08:19 +01:00
parent c3117568ad
commit 00f81cf62f
+1 -1
View File
@@ -440,7 +440,7 @@ class TableHandler(TableHandlerInterface):
if self._columns[column_name]['notnull']:
return
cursor.execute(SQL(
'SELECT id FROM {} WHERE {} IS NULL').format(
'SELECT id FROM {} WHERE {} IS NULL LIMIT 1').format(
Identifier(self.table_name),
Identifier(column_name)))
if not cursor.rowcount: