SQL SIGN must return zero for zero

The SQLite implementation of SIGN is not correct for zero, it must return zero
instead of 1.

issue4518
review10831002
This commit is contained in:
Cédric Krier committed 2015-02-04 23:19:45 +01:00
1 parent 1b0edb06c6
commit 288dc51876
1 file changed
+6 -2
+6 -2
View File
@@ -8,7 +8,6 @@ import datetime
import time
import sys
import threading
import math
_FIX_ROWCOUNT = False
try:
@@ -140,7 +139,12 @@ class SQLiteCharLength(Function):
def sign(value):
return math.copysign(1, value)
if value > 0:
return 1
elif value < 0:
return -1
else:
return value
MAPPING = {