From db749895b8dbe125b11ccde4b8816bdd505776f2 Mon Sep 17 00:00:00 2001 From: GregoryTravis Date: Sat, 7 Sep 2024 13:58:59 -0400 Subject: [PATCH] Upgrade SQLite to 3.46 (#10911) Before 3.46, the SQLite parser had a limited stack, which could overflow for certain complex queries. CTE optimizations make some of our queries much smaller, but also a little bit more deeply nested, causing the parser stack to overflow. 3.46 removes this stack limitation. Closes #10910. (cherry picked from commit 6f97e8041b328bdbbc0d19aeb10f243ac37ddd26) --- CHANGELOG.md | 2 ++ build.sbt | 2 +- .../Database/0.0.0-dev/THIRD-PARTY/NOTICE | 7 ++++- .../0.0.0-dev/THIRD-PARTY/licenses/MIT | 6 +++++ .../org.slf4j.slf4j-api-1.7.36/NOTICES | 27 +++++++++++++++++++ .../LICENSE | 0 .../LICENSE.zentus | 0 .../NOTICES | 0 docs/distribution/licenses.md | 6 ++--- test/Base_Tests/src/Data/Round_Spec.enso | 26 +++++++++--------- .../src/Database/Common/IR_Spec.enso | 2 +- .../org.slf4j.slf4j-api-1.7.36/copyright-add | 1 + .../copyright-keep-context | 1 + .../copyright-ignore | 0 .../copyright-keep | 0 .../custom-license | 0 .../files-keep | 0 tools/legal-review/Database/report-state | 4 +-- .../Database/reviewed-licenses/MIT_License | 1 + 19 files changed, 65 insertions(+), 20 deletions(-) create mode 100644 distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/licenses/MIT create mode 100644 distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/org.slf4j.slf4j-api-1.7.36/NOTICES rename distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/{org.xerial.sqlite-jdbc-3.42.0.0 => org.xerial.sqlite-jdbc-3.46.1.0}/LICENSE (100%) rename distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/{org.xerial.sqlite-jdbc-3.42.0.0 => org.xerial.sqlite-jdbc-3.46.1.0}/LICENSE.zentus (100%) rename distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/{org.xerial.sqlite-jdbc-3.42.0.0 => org.xerial.sqlite-jdbc-3.46.1.0}/NOTICES (100%) create mode 100644 tools/legal-review/Database/org.slf4j.slf4j-api-1.7.36/copyright-add create mode 100644 tools/legal-review/Database/org.slf4j.slf4j-api-1.7.36/copyright-keep-context rename tools/legal-review/Database/{org.xerial.sqlite-jdbc-3.42.0.0 => org.xerial.sqlite-jdbc-3.46.1.0}/copyright-ignore (100%) rename tools/legal-review/Database/{org.xerial.sqlite-jdbc-3.42.0.0 => org.xerial.sqlite-jdbc-3.46.1.0}/copyright-keep (100%) rename tools/legal-review/Database/{org.xerial.sqlite-jdbc-3.42.0.0 => org.xerial.sqlite-jdbc-3.46.1.0}/custom-license (100%) rename tools/legal-review/Database/{org.xerial.sqlite-jdbc-3.42.0.0 => org.xerial.sqlite-jdbc-3.46.1.0}/files-keep (100%) create mode 100644 tools/legal-review/Database/reviewed-licenses/MIT_License diff --git a/CHANGELOG.md b/CHANGELOG.md index 13cac3596d..f5f4df9ef3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -108,6 +108,7 @@ `Comparable.new`][10468] - [Added `dec` construction function for creating `Decimal`s.][10517] - [Added initial read support for SQLServer][10324] +- [Upgraded SQLite to version 3.46.1.][10911] [10434]: https://github.com/enso-org/enso/pull/10434 [10445]: https://github.com/enso-org/enso/pull/10445 @@ -116,6 +117,7 @@ [10474]: https://github.com/enso-org/enso/pull/10474 [10517]: https://github.com/enso-org/enso/pull/10517 [10324]: https://github.com/enso-org/enso/pull/10324 +[10911]: https://github.com/enso-org/enso/pull/10911 # Enso 2024.2 diff --git a/build.sbt b/build.sbt index 3e5d019258..5ba6358aec 100644 --- a/build.sbt +++ b/build.sbt @@ -559,7 +559,7 @@ val scalaLoggingVersion = "3.9.4" val scalameterVersion = "0.19" val scalatestVersion = "3.3.0-SNAP4" val slf4jVersion = JPMSUtils.slf4jVersion -val sqliteVersion = "3.42.0.0" +val sqliteVersion = "3.46.1.0" val tikaVersion = "2.4.1" val typesafeConfigVersion = "1.4.2" val junitVersion = "4.13.2" diff --git a/distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/NOTICE b/distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/NOTICE index 911064a2ae..b2c91d5083 100644 --- a/distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/NOTICE +++ b/distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/NOTICE @@ -11,7 +11,12 @@ The license information can be found along with the copyright notices. Copyright notices related to this dependency can be found in the directory `org.postgresql.postgresql-42.4.0`. +'slf4j-api', licensed under the MIT License, is distributed with the Database. +The license file can be found at `licenses/MIT`. +Copyright notices related to this dependency can be found in the directory `org.slf4j.slf4j-api-1.7.36`. + + 'sqlite-jdbc', licensed under the The Apache Software License, Version 2.0, is distributed with the Database. The license information can be found along with the copyright notices. -Copyright notices related to this dependency can be found in the directory `org.xerial.sqlite-jdbc-3.42.0.0`. +Copyright notices related to this dependency can be found in the directory `org.xerial.sqlite-jdbc-3.46.1.0`. diff --git a/distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/licenses/MIT b/distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/licenses/MIT new file mode 100644 index 0000000000..fe45399e37 --- /dev/null +++ b/distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/licenses/MIT @@ -0,0 +1,6 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + diff --git a/distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/org.slf4j.slf4j-api-1.7.36/NOTICES b/distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/org.slf4j.slf4j-api-1.7.36/NOTICES new file mode 100644 index 0000000000..9b89151d96 --- /dev/null +++ b/distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/org.slf4j.slf4j-api-1.7.36/NOTICES @@ -0,0 +1,27 @@ + + + +/** + * Copyright (c) 2004-2011 QOS.ch + * All rights reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ diff --git a/distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/org.xerial.sqlite-jdbc-3.42.0.0/LICENSE b/distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/org.xerial.sqlite-jdbc-3.46.1.0/LICENSE similarity index 100% rename from distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/org.xerial.sqlite-jdbc-3.42.0.0/LICENSE rename to distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/org.xerial.sqlite-jdbc-3.46.1.0/LICENSE diff --git a/distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/org.xerial.sqlite-jdbc-3.42.0.0/LICENSE.zentus b/distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/org.xerial.sqlite-jdbc-3.46.1.0/LICENSE.zentus similarity index 100% rename from distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/org.xerial.sqlite-jdbc-3.42.0.0/LICENSE.zentus rename to distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/org.xerial.sqlite-jdbc-3.46.1.0/LICENSE.zentus diff --git a/distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/org.xerial.sqlite-jdbc-3.42.0.0/NOTICES b/distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/org.xerial.sqlite-jdbc-3.46.1.0/NOTICES similarity index 100% rename from distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/org.xerial.sqlite-jdbc-3.42.0.0/NOTICES rename to distribution/lib/Standard/Database/0.0.0-dev/THIRD-PARTY/org.xerial.sqlite-jdbc-3.46.1.0/NOTICES diff --git a/docs/distribution/licenses.md b/docs/distribution/licenses.md index a3c275383b..49efa3a239 100644 --- a/docs/distribution/licenses.md +++ b/docs/distribution/licenses.md @@ -37,9 +37,9 @@ sources to gather copyright information related to the used dependencies. To configure the task, `GatherLicenses.distributions` should be set with sequence of distributions. Each distribution describes one component that is distributed separately and should include all references to all projects that -are included as part of its distribution. Currently, we have the `launcher` -distribution that consists of one `launcher` component and the `engine` -distribution which includes `runtime`, `engine-runner` and `project-manager`. +are included as part of its distribution. Currently we have three main +distrbutions (`launcher`, `engine`, and `project-manager`), as well as +distributions for many of the major components of the standard library. Another relevant setting is `GatherLicenses.licenseConfigurations` which defines which `ivy` configurations are considered to search for dependencies. Currently diff --git a/test/Base_Tests/src/Data/Round_Spec.enso b/test/Base_Tests/src/Data/Round_Spec.enso index d52c579c13..9895cb5d5a 100644 --- a/test/Base_Tests/src/Data/Round_Spec.enso +++ b/test/Base_Tests/src/Data/Round_Spec.enso @@ -20,13 +20,15 @@ type Batch_Runner values_vec = configs.map c-> c.at 0 dps_vec = configs.map c-> c.at 1 expected_vec = configs.map c-> c.at 2 + epsilon_vec = configs.map c-> c.at 3 got_vec = self.run_batch values_vec dps_vec use_bankers got_vec.each_with_index ix-> got-> expected = expected_vec.at ix value = values_vec.at ix dp = dps_vec.at ix + epsilon = epsilon_vec.at ix Test.with_clue "round("+value.to_text+", "+dp.to_text+", use_bankers="+use_bankers.to_text+") -> " <| - got.should_equal expected + got.should_equal expected epsilon type Batch_Builder Value vector_builder @@ -37,8 +39,8 @@ type Batch_Builder type Check_Instance Value vector_builder value dp - should_equal self (expected : Number) = - self.vector_builder.append [self.value, self.dp, expected] + should_equal self (expected : Number) (epsilon:Float=0) = + self.vector_builder.append [self.value, self.dp, expected, epsilon] ## PRIVATE add_specs group_builder batch_runner run_advanced = @@ -180,25 +182,25 @@ add_specs group_builder batch_runner run_advanced = round_fun 1.222222222225 11 . should_equal 1.22222222223 round_fun 1.2222222222225 12 . should_equal 1.222222222223 round_fun 1.22222222222225 13 . should_equal 1.2222222222223 - round_fun 1.222222222222225 14 . should_equal 1.22222222222223 + round_fun 1.222222222222225 14 . should_equal 1.22222222222223 0.00000000000001 round_fun -1.22222222225 10 . should_equal -1.2222222223 round_fun -1.222222222225 11 . should_equal -1.22222222223 round_fun -1.2222222222225 12 . should_equal -1.222222222223 round_fun -1.22222222222225 13 . should_equal -1.2222222222223 - round_fun -1.222222222222225 14 . should_equal -1.22222222222223 + round_fun -1.222222222222225 14 . should_equal -1.22222222222223 0.00000000000001 round_fun 1.22222222235 10 . should_equal 1.2222222224 round_fun 1.222222222235 11 . should_equal 1.22222222224 - round_fun 1.2222222222235 12 . should_equal 1.222222222224 - round_fun 1.22222222222235 13 . should_equal 1.2222222222224 - round_fun 1.222222222222235 14 . should_equal 1.22222222222224 + round_fun 1.2222222222235 12 . should_equal 1.222222222224 0.000000000002 + round_fun 1.22222222222235 13 . should_equal 1.2222222222224 0.0000000000001 + round_fun 1.222222222222235 14 . should_equal 1.22222222222224 0.00000000000001 round_fun -1.22222222235 10 . should_equal -1.2222222224 round_fun -1.222222222235 11 . should_equal -1.22222222224 - round_fun -1.2222222222235 12 . should_equal -1.222222222224 - round_fun -1.22222222222235 13 . should_equal -1.2222222222224 - round_fun -1.222222222222235 14 . should_equal -1.22222222222224 + round_fun -1.2222222222235 12 . should_equal -1.222222222224 0.000000000002 + round_fun -1.22222222222235 13 . should_equal -1.2222222222224 0.0000000000001 + round_fun -1.222222222222235 14 . should_equal -1.22222222222224 0.00000000000001 group_builder.specify "Can round correctly near the precision limit, using banker's rounding" pending=pending_advanced <| batch_runner.run use_bankers=True round_fun-> @@ -228,7 +230,7 @@ add_specs group_builder batch_runner run_advanced = group_builder.specify "Floating point imperfect representation counter-examples" pending=(if group_builder.name.contains "Snowflake" then "TODO: https://github.com/enso-org/enso/issues/10307") <| batch_runner.run_one 1.225 2 use_bankers=True . should_equal 1.22 # Actual result 1.23 - batch_runner.run_one 37.785 2 . should_equal 37.79 + batch_runner.run_one 37.785 2 . should_equal 37.79 0.01 group_builder.specify "Can round small integers to a specified number of decimal places correctly (value is unchanged)" <| batch_runner.run use_bankers=False round_fun-> diff --git a/test/Table_Tests/src/Database/Common/IR_Spec.enso b/test/Table_Tests/src/Database/Common/IR_Spec.enso index d6dfb1f5b3..c2f549486a 100644 --- a/test/Table_Tests/src/Database/Common/IR_Spec.enso +++ b/test/Table_Tests/src/Database/Common/IR_Spec.enso @@ -86,7 +86,7 @@ add_specs (suite_builder : Suite_Builder) setup (prefix : Text) default_connecti big = wm b0 (x * y) xty-> wm b1 (x + y + 10) xpyp10-> wm b2 (xty.round 1 use_bankers=True) r0-> - wm b3 xpyp10.round r1-> + wm b3 (xpyp10.round use_bankers=True) r1-> r0 + r1 big.to_vector results.flatten.flatten.flatten.distinct.length . should_equal 1 diff --git a/tools/legal-review/Database/org.slf4j.slf4j-api-1.7.36/copyright-add b/tools/legal-review/Database/org.slf4j.slf4j-api-1.7.36/copyright-add new file mode 100644 index 0000000000..8b13789179 --- /dev/null +++ b/tools/legal-review/Database/org.slf4j.slf4j-api-1.7.36/copyright-add @@ -0,0 +1 @@ + diff --git a/tools/legal-review/Database/org.slf4j.slf4j-api-1.7.36/copyright-keep-context b/tools/legal-review/Database/org.slf4j.slf4j-api-1.7.36/copyright-keep-context new file mode 100644 index 0000000000..7383b9c6d6 --- /dev/null +++ b/tools/legal-review/Database/org.slf4j.slf4j-api-1.7.36/copyright-keep-context @@ -0,0 +1 @@ +Copyright (c) 2004-2011 QOS.ch diff --git a/tools/legal-review/Database/org.xerial.sqlite-jdbc-3.42.0.0/copyright-ignore b/tools/legal-review/Database/org.xerial.sqlite-jdbc-3.46.1.0/copyright-ignore similarity index 100% rename from tools/legal-review/Database/org.xerial.sqlite-jdbc-3.42.0.0/copyright-ignore rename to tools/legal-review/Database/org.xerial.sqlite-jdbc-3.46.1.0/copyright-ignore diff --git a/tools/legal-review/Database/org.xerial.sqlite-jdbc-3.42.0.0/copyright-keep b/tools/legal-review/Database/org.xerial.sqlite-jdbc-3.46.1.0/copyright-keep similarity index 100% rename from tools/legal-review/Database/org.xerial.sqlite-jdbc-3.42.0.0/copyright-keep rename to tools/legal-review/Database/org.xerial.sqlite-jdbc-3.46.1.0/copyright-keep diff --git a/tools/legal-review/Database/org.xerial.sqlite-jdbc-3.42.0.0/custom-license b/tools/legal-review/Database/org.xerial.sqlite-jdbc-3.46.1.0/custom-license similarity index 100% rename from tools/legal-review/Database/org.xerial.sqlite-jdbc-3.42.0.0/custom-license rename to tools/legal-review/Database/org.xerial.sqlite-jdbc-3.46.1.0/custom-license diff --git a/tools/legal-review/Database/org.xerial.sqlite-jdbc-3.42.0.0/files-keep b/tools/legal-review/Database/org.xerial.sqlite-jdbc-3.46.1.0/files-keep similarity index 100% rename from tools/legal-review/Database/org.xerial.sqlite-jdbc-3.42.0.0/files-keep rename to tools/legal-review/Database/org.xerial.sqlite-jdbc-3.46.1.0/files-keep diff --git a/tools/legal-review/Database/report-state b/tools/legal-review/Database/report-state index 803b803b19..a046755599 100644 --- a/tools/legal-review/Database/report-state +++ b/tools/legal-review/Database/report-state @@ -1,3 +1,3 @@ -4DFA19B7C7AB8984E827C35E9CA6EF40CC3B246094BB0A763D65AD6BF76F0D26 -DF30306CEDC69A2DB5BF394CDD77B240B6F6B2E695D4DE6BDC343EAA271CEB34 +DD7BB70C12F39CA1BC8F595222CF0561FAF0BE8FC966DB1CB006E087A6620383 +2BEE2E3E56AF2CFCD76BAEDCAC4ECEA5D6D2CAD1E9727A38052FC5385E818DBD 0 diff --git a/tools/legal-review/Database/reviewed-licenses/MIT_License b/tools/legal-review/Database/reviewed-licenses/MIT_License new file mode 100644 index 0000000000..3889131c8a --- /dev/null +++ b/tools/legal-review/Database/reviewed-licenses/MIT_License @@ -0,0 +1 @@ +tools/legal-review/license-texts/MIT