|
131 | 131 | _util = None
|
132 | 132 | _thns = threading.local()
|
133 | 133 |
|
134 |
| -_tenTo = [10 ** x for x in range(20)] |
| 134 | +_tenTo = [10 ** x for x in range(30)] |
135 | 135 | _i2name = {DbInfoCode.READ_SEQ_COUNT: 'sequential', DbInfoCode.READ_IDX_COUNT: 'indexed',
|
136 | 136 | DbInfoCode.INSERT_COUNT: 'inserts', DbInfoCode.UPDATE_COUNT: 'updates',
|
137 | 137 | DbInfoCode.DELETE_COUNT: 'deletes', DbInfoCode.BACKOUT_COUNT: 'backouts',
|
@@ -3078,7 +3078,7 @@ def _extract_db_array_to_list(self, esize: int, dtype: int, subtype: int,
|
3078 | 3078 | elif dtype in (a.blr_short, a.blr_long, a.blr_int64):
|
3079 | 3079 | val = (0).from_bytes(buf[bufpos:bufpos + esize], 'little', signed=True)
|
3080 | 3080 | if subtype or scale:
|
3081 |
| - val = decimal.Decimal(val) / _tenTo[abs(256-scale)] |
| 3081 | + val = decimal.Decimal(val) / _tenTo[abs(scale)] |
3082 | 3082 | elif dtype == a.blr_bool:
|
3083 | 3083 | val = (0).from_bytes(buf[bufpos:bufpos + esize], 'little') == 1
|
3084 | 3084 | elif dtype == a.blr_float:
|
@@ -3173,9 +3173,9 @@ def _fill_db_array_buffer(self, esize: int, dtype: int, subtype: int,
|
3173 | 3173 | if subtype or scale:
|
3174 | 3174 | val = value[i]
|
3175 | 3175 | if isinstance(val, decimal.Decimal):
|
3176 |
| - val = int((val * _tenTo[256-abs(scale)]).to_integral()) |
| 3176 | + val = int((val * _tenTo[abs(scale)]).to_integral()) |
3177 | 3177 | elif isinstance(val, (int, float)):
|
3178 |
| - val = int(val * _tenTo[256-abs(scale)]) |
| 3178 | + val = int(val * _tenTo[abs(scale)]) |
3179 | 3179 | else:
|
3180 | 3180 | raise TypeError(f'Objects of type {type(val)} are not '
|
3181 | 3181 | f' acceptable input for'
|
@@ -3214,7 +3214,7 @@ def _fill_db_array_buffer(self, esize: int, dtype: int, subtype: int,
|
3214 | 3214 | valuebuf.value = _util.encode_time(value[i]).to_bytes(4, 'little')
|
3215 | 3215 | memmove(byref(buf, bufpos), valuebuf, esize)
|
3216 | 3216 | elif dtype == a.blr_sql_time_tz:
|
3217 |
| - valuebuf.value = _util.encode_time_tz(value[i]).to_bytes(esize, 'little') |
| 3217 | + valuebuf.value = _util.encode_time_tz(value[i]) |
3218 | 3218 | memmove(byref(buf, bufpos), valuebuf, esize)
|
3219 | 3219 | elif dtype == a.blr_timestamp_tz:
|
3220 | 3220 | valuebuf.value = _util.encode_timestamp_tz(value[i])
|
|
0 commit comments