sqlite/sqlite-3.31.1-s390-arch-compatibibility.patch
Ondrej Dubaj 236dd0f14c - Updated to version 3.31.1 (https://sqlite.org/releaselog/3_31_1.html)
- updated spec file, deleted useless patches
- Resolved s390 arch incompatibility
- Modified FTS tests to support big endian platforms
2020-02-05 08:48:04 +01:00

121 lines
4.1 KiB
Diff

From afbd5f941b1167661ed68077cd075bd8bbce378e Mon Sep 17 00:00:00 2001
From: Ondrej Dubaj <odubaj@redhat.com>
Date: Wed, 29 Jan 2020 08:15:03 +0100
Subject: [PATCH] Minor change for compatibility with the s390 architecture.
---
src/insert.c | 4 +++-
src/parse.y | 6 ++++++
src/test_multiplex.c | 2 +-
src/vdbeaux.c | 5 ++++-
test/in.test | 22 ++++++++++++++--------
5 files changed, 28 insertions(+), 11 deletions(-)
diff --git a/src/insert.c b/src/insert.c
index 93f22a8..7a04b98 100644
--- a/src/insert.c
+++ b/src/insert.c
@@ -2170,12 +2170,14 @@ void sqlite3GenerateConstraintChecks(
x = *sqlite3VdbeGetOp(v, addrConflictCk);
if( x.opcode!=OP_IdxRowid ){
int p2; /* New P2 value for copied conflict check opcode */
+ const char *zP4;
if( sqlite3OpcodeProperty[x.opcode]&OPFLG_JUMP ){
p2 = lblRecheckOk;
}else{
p2 = x.p2;
}
- sqlite3VdbeAddOp4(v, x.opcode, x.p1, p2, x.p3, x.p4.z, x.p4type);
+ zP4 = x.p4type==P4_INT32 ? SQLITE_INT_TO_PTR(x.p4.i) : x.p4.z;
+ sqlite3VdbeAddOp4(v, x.opcode, x.p1, p2, x.p3, zP4, x.p4type);
sqlite3VdbeChangeP5(v, x.p5);
VdbeCoverageIf(v, p2!=x.p2);
}
diff --git a/src/parse.y b/src/parse.y
index 5876a1a..c783c69 100644
--- a/src/parse.y
+++ b/src/parse.y
@@ -1193,6 +1193,12 @@ expr(A) ::= expr(A) between_op(N) expr(X) AND expr(Y). [BETWEEN] {
*/
sqlite3ExprUnmapAndDelete(pParse, A);
A = sqlite3Expr(pParse->db, TK_INTEGER, N ? "1" : "0");
+ }else if( 0 && Y->nExpr==1 && sqlite3ExprIsConstant(Y->a[0].pExpr) ){
+ Expr *pRHS = Y->a[0].pExpr;
+ Y->a[0].pExpr = 0;
+ sqlite3ExprListDelete(pParse->db, Y);
+ A = sqlite3PExpr(pParse, TK_EQ, A, pRHS);
+ if( N ) A = sqlite3PExpr(pParse, TK_NOT, A, 0);
}else{
A = sqlite3PExpr(pParse, TK_IN, A, 0);
if( A ){
diff --git a/src/test_multiplex.c b/src/test_multiplex.c
index ed8c9f7..56e78c3 100644
--- a/src/test_multiplex.c
+++ b/src/test_multiplex.c
@@ -530,7 +530,7 @@ static int multiplexOpen(
pGroup->szChunk += 65536;
}
}
- pGroup->flags = flags;
+ pGroup->flags = (flags & ~SQLITE_OPEN_URI);
rc = multiplexSubFilename(pGroup, 1);
if( rc==SQLITE_OK ){
pSubOpen = multiplexSubOpen(pGroup, 0, &rc, pOutFlags, 0);
diff --git a/src/vdbeaux.c b/src/vdbeaux.c
index fab8b70..c38a4f7 100644
--- a/src/vdbeaux.c
+++ b/src/vdbeaux.c
@@ -4726,7 +4726,10 @@ static int vdbeRecordCompareString(
assert( pPKey2->aMem[0].flags & MEM_Str );
vdbeAssertFieldCountWithinLimits(nKey1, pKey1, pPKey2->pKeyInfo);
- getVarint32(&aKey1[1], serial_type);
+ serial_type = (u8)(aKey1[1]);
+ if( serial_type >= 0x80 ){
+ sqlite3GetVarint32(&aKey1[1], (u32*)&serial_type);
+ }
if( serial_type<12 ){
res = pPKey2->r1; /* (pKey1/nKey1) is a number or a null */
}else if( !(serial_type & 0x01) ){
diff --git a/test/in.test b/test/in.test
index 4595d5f..a1fe1d2 100644
--- a/test/in.test
+++ b/test/in.test
@@ -765,19 +765,25 @@ do_execsql_test in-18.1 {
#
# Also ticket https://sqlite.org/src/info/29f635e0af71234b
#
-do_execsql_test in-19.1 {
+do_execsql_test in-19.10 {
DROP TABLE IF EXISTS t0;
CREATE TABLE t0(c0 REAL UNIQUE);
- INSERT INTO t0(c0) VALUES(2.07093491255203046E18);
- SELECT 1 FROM t0 WHERE c0 IN ('2070934912552030444');
+ INSERT INTO t0(c0) VALUES(2.0625E00);
+ SELECT 1 FROM t0 WHERE c0 IN ('2.0625');
} {1}
-do_execsql_test in-19.2 {
- SELECT c0 IN ('2070934912552030444') FROM t0;
+do_execsql_test in-19.20 {
+ SELECT c0 IN ('2.0625') FROM t0;
} {1}
-do_execsql_test in-19.3 {
- SELECT c0 IN ('2070934912552030444',2,3) FROM t0;
+do_execsql_test in-19.21 {
+ SELECT c0 = ('2.0625') FROM t0;
} {1}
-do_execsql_test in-19.4 {
+do_execsql_test in-19.22 {
+ SELECT c0 = ('0.20625e+01') FROM t0;
+} {1}
+do_execsql_test in-19.30 {
+ SELECT c0 IN ('2.0625',2,3) FROM t0;
+} {1}
+do_execsql_test in-19.40 {
DROP TABLE t0;
CREATE TABLE t0(c0 TEXT, c1 REAL, c2, PRIMARY KEY(c2, c0, c1));
CREATE INDEX i0 ON t0(c1 IN (c0));
--
2.19.1