This is an automated email from the ASF dual-hosted git repository. leginee pushed a commit to branch bazel-migration in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 237b9eb429ebdbbf276a064fc35e1499e7737b25 Author: Peter Kovacs <[email protected]> AuthorDate: Fri Aug 14 01:59:31 2026 +0200 build(connectivity): the embedded database — six SDBC drivers and the HSQLDB jars "Create a new Base database" could not work, and picking any database driver in Base did not report an error but KILLED the office. Both had the same cause. services.rdb registered SEVEN connectivity drivers whose DLLs were never built (calc, dbase, flat, adabas, ado, mysql, odbc) and their DataAccess XCUs made all seven selectable in the connection wizard. A registration with no library behind it is worse than none: the driver manager resolves the service, osl_loadModule fails on a file that was never produced, and the resulting UNO exception escapes the VCL message loop to desktop/source/app/app.cxx:2241, whose catch calls FatalError() -> _exit(). A hard process exit, no dismissible dialog, taking unsaved work in every other window with it. Meanwhile the driver a new Base document actually needs was not registered at all. dbaccess hardcodes sdbc:embedded:hsqldb (core/misc/dsntypes.cxx), and packcomponents omitted hsqldb and jdbc as "Java-only components ... Java build is deferred" — a comment that had been stale since the Java runtime went green. Built, so the registrations become true: file.dll shared file-based SDBC implementation; NOT a component, and nothing registers it, but dbase/flat/calc link it, so it must be staged or those three fail to load. Exports by declspec via OOO_DLLPUBLIC_FILE, like dbtools, so no DEF is needed; dmake's USE_DEFFILE + .flt symbol filter predates those annotations. dbase.dll dBASE III/IV flat.dll delimited text calc.dll spreadsheet as datasource jdbc.dll generic JDBC bridge hsqldb.dll embedded HSQLDB and the two jars the engine needs, staged to program/classes/ because HDriver.cxx hardcodes the classpath as the literal vnd.sun.star.expand:$OOO_BASE_DIR/program/classes/<name>.jar: hsqldb.jar the engine (new @hsqldb bzlmod module) sdbc_hsqldb.jar AOO's storage bridge -- StorageAccess/StorageFileAccess implement org.hsqldb.lib.Storage/FileAccess over UNO embedded storage, and their native methods are the 28 Java_* exports of hsqldb.dll. This is what makes an embedded database a single .odb file rather than loose files beside it. The chain is four artifacts, not one: hsqldb.dll does no SQL itself, it asks the driver manager for "jdbc:hsqldb:db" and hands the work to jdbc.dll. adabas, ado, mysql and odbc are now UNREGISTERED rather than left pointing at DLLs that do not exist. Each stays fully described in the module readme with what it would take; none is blocked, odbc is the cheapest since //main/unixODBC:odbc_headers already works on Windows. Three things that are not obvious from the makefiles: - stlport is required by every consumer of connectivity/dbtools.hxx, not only the modules using hash_map: line 611 declares askForParameters() with a ::std::bit_vector default argument, an SGI STL extension. - dbase/DNoException.cxx is excluded from the source glob. It is the one file in that directory absent from dmake's SLOFILES and #included by nothing: a stale second copy of bodies that also live in DTable.cxx and dindexnode.cxx, so compiling it gives ~25 LNK2005 duplicate-symbol errors. - SOLAR_JAVA is load-bearing for jdbc and hsqldb rather than a feature switch: jvmaccess/virtualmachine.hxx includes the real <jni.h> only under it and otherwise declares stubs, so without it every JNIEnv-> call is C2027. hsqldb.dll is dual-role, a UNO component and a JNI library, so its DEF carries 28 undecorated Java_* names beside the two component_* ones -- JNICALL is __stdcall on Win32 and they would otherwise be exported as _Java_...@N, which the JVM cannot find. Same trick as jurt's jpipe.def. It does NOT need that rule's RT_MANIFEST id 2 embedded manifest: jpipe/jpipx are loaded by a stock java.exe with no VC90 activation context, whereas this JVM runs in-process inside soffice.exe, whose own manifest already covers it. DIVERGENCE, deliberate and reversible: hsqldb.jar is the release jar from the archive with AOO's eight behaviourally patched files recompiled over it, not a full source build. Upstream builds HSQLDB with Ant, and that build runs HSQLDB's own CodeSwitcher preprocessor first; compiling the 255 non-test sources directly fails with 12 errors, all of them JDBC wrapper classes not implementing methods java.sql grew after 2008 (getCharacterStream(long,long), isWrapperFor, generatedKeyAlwaysReturned, getParentLogger, getObject(String,Class<T>)). i121754.patch exists to paper over exactly that for Java 7, and javac 21 cannot target below --release 8, so a faithful source build would need new source changes upstream does not have. Merging with the patched classes first (singlejar keeps the first duplicate) keeps every behaviour patch, including script.patch's 2023 fix to skip SCRIPT while a script or log is replayed; only the Java-7 build-compat hunks are dropped, and those are moot once the classes come from the release jar. LANDMINE for any future bzlmod module: AOO's hsqldb patches cannot be used verbatim. i121754.patch was generated with `diff -urbwB` -- ignore whitespace AND blank lines -- which GNU patch tolerates and Bazel's stricter implementation does not. Bazel applied script.patch, skipped i121754.patch entirely, and never created the new file lib/StringComparator.java, all without an error or a warning; the failure only showed up as a missing input file much later. Fixed with a single regenerated byte-exact patch at patch_strip 1, verified by diffing the fetched repo against a GNU-patch reference tree rather than by trusting the build. Note also that a source.json change needs `bazel mod deps --lockfile_mode=refresh`, or the stale external repo is reused. Verified green on both winXP-x86 and winXP-x64, and on x64 at runtime: the office boots, a new Base database can be created, and a table created in it. Co-Authored-By: Claude Opus 5 <[email protected]> --- MODULE.bazel | 1 + ext_libraries/modules/hsqldb/1.8.0/MODULE.bazel | 7 + .../modules/hsqldb/1.8.0/overlay/BUILD.bazel | 64 ++++ .../modules/hsqldb/1.8.0/overlay/MODULE.bazel | 7 + .../modules/hsqldb/1.8.0/patches/aoo-hsqldb.patch | 388 +++++++++++++++++++++ ext_libraries/modules/hsqldb/1.8.0/source.json | 13 + ext_libraries/modules/hsqldb/metadata.json | 7 + main/connectivity/BUILD.bazel | 337 ++++++++++++++++++ main/connectivity/util/calc.def | 4 + main/connectivity/util/dbase.def | 4 + main/connectivity/util/flat.def | 4 + main/connectivity/util/hsqldb.def | 37 ++ main/connectivity/util/jdbc.def | 4 + main/postprocess/BUILD.bazel | 34 +- main/staging/BUILD.bazel | 16 + 15 files changed, 914 insertions(+), 13 deletions(-) diff --git a/MODULE.bazel b/MODULE.bazel index 2161c1cc54..6de885fe59 100644 --- a/MODULE.bazel +++ b/MODULE.bazel @@ -51,6 +51,7 @@ bazel_dep(name = "rules_java", version = "8.11.0") bazel_dep(name = "mdds", version = "0.3.1") bazel_dep(name = "coinmp", version = "1.7.6") bazel_dep(name = "gtest", version = "1.7.0") # GoogleTest — C++ unit-test foundation (//main/test) +bazel_dep(name = "hsqldb", version = "1.8.0") # embedded database engine behind sdbc:embedded:hsqldb (//main/connectivity) # Host JDK. Expose a downloaded JDK so we can register an ARCH-NEUTRAL java # RUNTIME toolchain (see //build/toolchain/java). rules_java only auto-registers diff --git a/ext_libraries/modules/hsqldb/1.8.0/MODULE.bazel b/ext_libraries/modules/hsqldb/1.8.0/MODULE.bazel new file mode 100644 index 0000000000..b51a876e63 --- /dev/null +++ b/ext_libraries/modules/hsqldb/1.8.0/MODULE.bazel @@ -0,0 +1,7 @@ +module( + name = "hsqldb", + version = "1.8.0", + compatibility_level = 1, +) + +bazel_dep(name = "rules_java", version = "8.11.0") diff --git a/ext_libraries/modules/hsqldb/1.8.0/overlay/BUILD.bazel b/ext_libraries/modules/hsqldb/1.8.0/overlay/BUILD.bazel new file mode 100644 index 0000000000..421864287d --- /dev/null +++ b/ext_libraries/modules/hsqldb/1.8.0/overlay/BUILD.bazel @@ -0,0 +1,64 @@ +load("@rules_java//java:defs.bzl", "java_import", "java_library") + +package(default_visibility = ["//visibility:public"]) + +# HSQLDB 1.8.0 — the database engine behind "create a new Base database" +# (dbaccess hardcodes sdbc:embedded:hsqldb). Consumed as a jar by +# //main/connectivity:hsqldb via the JDBC driver. +# +# WHY THE SHIPPED JAR IS THE BASE, AND NOT A FULL SOURCE BUILD. +# Upstream builds this with Ant, and that build is not a plain javac: HSQLDB's +# build.xml runs its own org.hsqldb.util.CodeSwitcher over the sources first, +# commenting blocks in and out per JDK level. Compiling the 255 non-test +# sources directly with the toolchain JDK fails with 12 errors, all of them the +# same thing — the JDBC wrapper classes (jdbcClob, jdbcDatabaseMetaData, +# jdbcDataSource, jdbcParameterMetaData, jdbcResultSet, jdbcDriver) do not +# implement methods that java.sql grew after this release: getCharacterStream +# (long,long) (JDBC 4.0), isWrapperFor, generatedKeyAlwaysReturned, +# getParentLogger, getObject(String,Class<T>) (JDBC 4.1). AOO's own +# i121754.patch exists to paper over exactly that for Java 7, and javac 21 +# cannot target anything below --release 8, so a raw source build would need +# NEW source changes that upstream does not have. That is out of scope here +# (see CLAUDE.md "Source code is NOT being changed"). +# +# lib/hsqldb.jar inside the archive is the official 1.8.0 release build, i.e. +# already CodeSwitcher-processed, so it supplies those classes correctly. +java_import( + name = "hsqldb_upstream", + jars = ["lib/hsqldb.jar"], +) + +# AOO's two patches are not only about buildability. These eight files carry +# the BEHAVIOURAL half — script.patch's fix to skip SCRIPT while a script or +# log is being replayed, and i121754's alignment of the engine to 1.8.0.11 — +# and every one of them compiles cleanly against the release jar, because none +# of them is a java.sql implementor. So the behaviour patches are recovered in +# full; only i121754's JDBC-compat hunks are dropped, and those exist purely to +# make the SOURCE build on Java 7, which is moot when the classes come from the +# release jar. +java_library( + name = "hsqldb_patches", + srcs = [ + "src/org/hsqldb/DatabaseCommandInterpreter.java", + "src/org/hsqldb/Expression.java", + "src/org/hsqldb/Library.java", + "src/org/hsqldb/Select.java", + "src/org/hsqldb/Table.java", + "src/org/hsqldb/TableWorks.java", + "src/org/hsqldb/lib/StringComparator.java", + "src/org/hsqldb/persist/HsqlDatabaseProperties.java", + ], + javacopts = ["--release", "8"], + deps = [":hsqldb_upstream"], +) + +# The consumer-facing target. Order matters: //main/connectivity merges these +# with singlejar, which keeps the FIRST occurrence of a duplicate entry, so the +# patched classes must come before the release jar. +filegroup( + name = "hsqldb_jars", + srcs = [ + ":hsqldb_patches", + ":hsqldb_upstream", + ], +) diff --git a/ext_libraries/modules/hsqldb/1.8.0/overlay/MODULE.bazel b/ext_libraries/modules/hsqldb/1.8.0/overlay/MODULE.bazel new file mode 100644 index 0000000000..b51a876e63 --- /dev/null +++ b/ext_libraries/modules/hsqldb/1.8.0/overlay/MODULE.bazel @@ -0,0 +1,7 @@ +module( + name = "hsqldb", + version = "1.8.0", + compatibility_level = 1, +) + +bazel_dep(name = "rules_java", version = "8.11.0") diff --git a/ext_libraries/modules/hsqldb/1.8.0/patches/aoo-hsqldb.patch b/ext_libraries/modules/hsqldb/1.8.0/patches/aoo-hsqldb.patch new file mode 100644 index 0000000000..cd3247bde0 --- /dev/null +++ b/ext_libraries/modules/hsqldb/1.8.0/patches/aoo-hsqldb.patch @@ -0,0 +1,388 @@ +diff -Naur pristine/hsqldb/src/org/hsqldb/DatabaseCommandInterpreter.java hsqldb/src/org/hsqldb/DatabaseCommandInterpreter.java +--- a/src/org/hsqldb/DatabaseCommandInterpreter.java 2008-05-27 14:26:44.000000000 +0200 ++++ b/src/org/hsqldb/DatabaseCommandInterpreter.java 2026-08-13 08:05:47.816535000 +0200 +@@ -402,6 +402,9 @@ + if (tokenizer.getType() != Types.VARCHAR) { + throw Trace.error(Trace.INVALID_IDENTIFIER); + } ++ if (session.isProcessingScript() || session.isProcessingLog()) { ++ return new Result(ResultConstants.UPDATECOUNT); ++ } + + dsw = new ScriptWriterText(database, token, true, true, true); + +diff -Naur pristine/hsqldb/src/org/hsqldb/Expression.java hsqldb/src/org/hsqldb/Expression.java +--- a/src/org/hsqldb/Expression.java 2008-05-27 17:15:05.000000000 +0200 ++++ b/src/org/hsqldb/Expression.java 2026-08-13 08:05:47.484175300 +0200 +@@ -807,6 +807,14 @@ + + case COUNT : + buf.append(' ').append(Token.T_COUNT).append('('); ++ ++ if ("(*)".equals(left)) { ++ buf.append('*'); ++ } else { ++ buf.append(left); ++ } ++ ++ buf.append(')'); + break; + + case SUM : +@@ -858,11 +866,15 @@ + buf.append(' ').append(Token.T_VAR_SAMP).append('('); + buf.append(left).append(')'); + break; +- } + ++ default : + throw Trace.error(Trace.EXPRESSION_NOT_SUPPORTED); + } + ++ // changes used in OpenOffice 3.4 have been incorporated ++ return buf.toString(); ++ } ++ + private String describe(Session session, int blanks) { + + int lIType; +@@ -1523,6 +1535,12 @@ + return columnName; + } + ++ if (isAggregate(exprType)) { ++ try { ++ return getDDL(); ++ } catch (Exception e) {} ++ } ++ + return ""; + } + +diff -Naur pristine/hsqldb/src/org/hsqldb/Library.java hsqldb/src/org/hsqldb/Library.java +--- a/src/org/hsqldb/Library.java 2006-07-17 00:29:33.000000000 +0200 ++++ b/src/org/hsqldb/Library.java 2026-08-13 08:05:47.691918500 +0200 +@@ -1957,7 +1957,7 @@ + functionMap.put("bitand", bitand); + functionMap.put("bitlength", bitLength); + functionMap.put("bitor", bitor); +- functionMap.put("bitxor", bitor); ++ functionMap.put("bitxor", bitxor); + functionMap.put("character", character); + functionMap.put("concat", concat); + functionMap.put("cot", cot); +diff -Naur pristine/hsqldb/src/org/hsqldb/Select.java hsqldb/src/org/hsqldb/Select.java +--- a/src/org/hsqldb/Select.java 2007-07-17 18:14:09.000000000 +0200 ++++ b/src/org/hsqldb/Select.java 2026-08-13 08:05:47.723004900 +0200 +@@ -33,7 +33,7 @@ + * + * For work added by the HSQL Development Group: + * +- * Copyright (c) 2001-2008, The HSQL Development Group ++ * Copyright (c) 2001-2005, The HSQL Development Group + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without +@@ -1255,6 +1255,7 @@ + for (int i = 0; i < iResultLen; i++) { + e = exprColumns[i]; + rmd.colTypes[i] = e.getDataType(); ++ rmd.classNames[i] = e.getValueClassName(); + rmd.colSizes[i] = e.getColumnSize(); + rmd.colScales[i] = e.getColumnScale(); + rmd.colLabels[i] = e.getAlias(); +@@ -1263,6 +1264,7 @@ + rmd.colNames[i] = e.getColumnName(); + + if (rmd.isTableColumn(i)) { ++ rmd.schemaNames[i] = e.getTableSchemaName(); + rmd.colNullable[i] = e.nullability; + rmd.isIdentity[i] = e.isIdentity; + rmd.isWritable[i] = e.isWritable; +diff -Naur pristine/hsqldb/src/org/hsqldb/Table.java hsqldb/src/org/hsqldb/Table.java +--- a/src/org/hsqldb/Table.java 2007-10-19 23:59:07.000000000 +0200 ++++ b/src/org/hsqldb/Table.java 2026-08-13 08:05:47.737895100 +0200 +@@ -149,10 +149,10 @@ + Constraint[] constraintList; // constrainst for the table + HsqlArrayList[] triggerLists; // array of trigger lists + private int[] colTypes; // fredt - types of columns +- private int[] colSizes; // fredt - copy of SIZE values for columns ++ int[] colSizes; // fredt - copy of SIZE values for columns + private int[] colScales; // fredt - copy of SCALE values for columns + private boolean[] colNullable; // fredt - modified copy of isNullable() values +- private Expression[] colDefaults; // fredt - expressions of DEFAULT values ++ Expression[] colDefaults; // fredt - expressions of DEFAULT values + private int[] defaultColumnMap; // fred - holding 0,1,2,3,... + private boolean hasDefaultValues; //fredt - shortcut for above + boolean sqlEnforceSize; // inherited from the database - +diff -Naur pristine/hsqldb/src/org/hsqldb/TableWorks.java hsqldb/src/org/hsqldb/TableWorks.java +--- a/src/org/hsqldb/TableWorks.java 2007-01-14 06:48:16.000000000 +0100 ++++ b/src/org/hsqldb/TableWorks.java 2026-08-13 08:05:47.757178600 +0200 +@@ -670,7 +670,10 @@ + // default expressions can change + oldCol.setType(newCol); + oldCol.setDefaultExpression(newCol.getDefaultExpression()); +- table.setColumnTypeVars(colIndex); ++ ++ table.colSizes[colIndex] = oldCol.getSize(); ++ table.colDefaults[colIndex] = oldCol.getDefaultExpression(); ++ + table.resetDefaultsFlag(); + + return; +diff -Naur pristine/hsqldb/src/org/hsqldb/jdbc/jdbcCallableStatement.java hsqldb/src/org/hsqldb/jdbc/jdbcCallableStatement.java +--- a/src/org/hsqldb/jdbc/jdbcCallableStatement.java 2008-03-20 02:44:28.000000000 +0100 ++++ b/src/org/hsqldb/jdbc/jdbcCallableStatement.java 2026-08-13 08:05:47.498930500 +0200 +@@ -3376,7 +3376,26 @@ + { + throw new UnsupportedOperationException("Not supported yet."); + } +-*/ + ++ public <T>T getObject(int parameterIndex, ++ Class<T> type) throws SQLException { ++ return (T) this.getObject(parameterIndex); ++ } ++ ++ public <T>T getObject(String parameterName, ++ Class<T> type) throws SQLException { ++ return getObject(this.findParameterIndex(parameterName), type); ++ } ++ ++ public void closeOnCompletion() throws SQLException { ++ throw new UnsupportedOperationException("Not supported yet."); ++ } ++ ++ public boolean isCloseOnCompletion() throws SQLException { ++ throw new UnsupportedOperationException("Not supported yet."); ++ } ++ ++*/ + //#endif JAVA6 ++ + } +diff -Naur pristine/hsqldb/src/org/hsqldb/jdbc/jdbcConnection.java hsqldb/src/org/hsqldb/jdbc/jdbcConnection.java +--- a/src/org/hsqldb/jdbc/jdbcConnection.java 2008-03-20 02:44:28.000000000 +0100 ++++ b/src/org/hsqldb/jdbc/jdbcConnection.java 2026-08-13 08:05:47.524967500 +0200 +@@ -2794,6 +2794,36 @@ + { + throw new UnsupportedOperationException("Not supported yet."); + } ++ ++ public int getNetworkTimeout() throws SQLException { ++ return 0; ++ } ++ ++ public void setNetworkTimeout(java.util.concurrent.Executor executor, ++ int milliseconds) throws SQLException { ++ ++ checkClosed(); ++ ++ throw Util.notSupported(); ++ } ++ ++ public void setSchema(String schema) throws SQLException { ++ checkClosed(); ++ ++ throw Util.notSupported(); ++ } ++ ++ public String getSchema() throws SQLException { ++ checkClosed(); ++ ++ throw Util.notSupported(); ++ } ++ public void abort( ++ java.util.concurrent.Executor executor) throws SQLException { ++ checkClosed(); ++ ++ throw Util.notSupported(); ++ } + */ + + //#endif JAVA6 +diff -Naur pristine/hsqldb/src/org/hsqldb/jdbc/jdbcDataSource.java hsqldb/src/org/hsqldb/jdbc/jdbcDataSource.java +--- a/src/org/hsqldb/jdbc/jdbcDataSource.java 2008-05-28 22:23:02.000000000 +0200 ++++ b/src/org/hsqldb/jdbc/jdbcDataSource.java 2026-08-13 08:05:47.573435900 +0200 +@@ -322,6 +322,11 @@ + { + throw new UnsupportedOperationException("Not supported yet."); + } ++ ++ public java.util.logging.Logger getParentLogger() ++ throws java.sql.SQLFeatureNotSupportedException { ++ throw (java.sql.SQLFeatureNotSupportedException) Util.notSupported(); ++ } + */ + + //#endif JAVA6 +diff -Naur pristine/hsqldb/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java hsqldb/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java +--- a/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java 2008-03-20 02:44:28.000000000 +0100 ++++ b/src/org/hsqldb/jdbc/jdbcDatabaseMetaData.java 2026-08-13 08:05:47.543924100 +0200 +@@ -5694,7 +5694,17 @@ + { + throw new UnsupportedOperationException("Not supported yet."); + } +-*/ + ++ public ResultSet getPseudoColumns( ++ String catalog, String schemaPattern, String tableNamePattern, ++ String columnNamePattern) throws SQLException { ++ throw Util.notSupported(); ++ } ++ ++ public boolean generatedKeyAlwaysReturned() throws SQLException { ++ return true; ++ } ++ ++*/ + //#endif JAVA6 + } +diff -Naur pristine/hsqldb/src/org/hsqldb/jdbc/jdbcPreparedStatement.java hsqldb/src/org/hsqldb/jdbc/jdbcPreparedStatement.java +--- a/src/org/hsqldb/jdbc/jdbcPreparedStatement.java 2008-03-20 02:44:28.000000000 +0100 ++++ b/src/org/hsqldb/jdbc/jdbcPreparedStatement.java 2026-08-13 08:05:47.592185100 +0200 +@@ -2403,6 +2403,15 @@ + { + throw new UnsupportedOperationException("Not supported yet."); + } ++ ++ public void closeOnCompletion() throws SQLException { ++ checkClosed(); ++ } ++ ++ public boolean isCloseOnCompletion() throws SQLException { ++ checkClosed(); ++ return false; ++ } + */ + + //#endif JAVA6 +diff -Naur pristine/hsqldb/src/org/hsqldb/jdbc/jdbcResultSet.java hsqldb/src/org/hsqldb/jdbc/jdbcResultSet.java +--- a/src/org/hsqldb/jdbc/jdbcResultSet.java 2008-03-20 02:44:28.000000000 +0100 ++++ b/src/org/hsqldb/jdbc/jdbcResultSet.java 2026-08-13 08:05:47.612907400 +0200 +@@ -5325,7 +5325,16 @@ + { + throw new UnsupportedOperationException("Not supported yet."); + } +-*/ + ++ public <T>T getObject(int columnIndex, Class<T> type) throws SQLException { ++ return (T) getObject(columnIndex); ++ } ++ ++ public <T>T getObject(String columnLabel, ++ Class<T> type) throws SQLException { ++ return getObject(findColumn(columnLabel), type); ++ } ++ ++*/ + //#endif JAVA6 + } +diff -Naur pristine/hsqldb/src/org/hsqldb/jdbc/jdbcStatement.java hsqldb/src/org/hsqldb/jdbc/jdbcStatement.java +--- a/src/org/hsqldb/jdbc/jdbcStatement.java 2008-03-20 02:44:28.000000000 +0100 ++++ b/src/org/hsqldb/jdbc/jdbcStatement.java 2026-08-13 08:05:47.640977900 +0200 +@@ -1608,6 +1608,16 @@ + { + throw new UnsupportedOperationException("Not supported yet."); + } ++ ++ public void closeOnCompletion() throws SQLException { ++ checkClosed(); ++ } ++ ++ public boolean isCloseOnCompletion() throws SQLException { ++ checkClosed(); ++ return false; ++ } ++ + */ + //#endif JAVA6 + } +diff -Naur pristine/hsqldb/src/org/hsqldb/jdbcDriver.java hsqldb/src/org/hsqldb/jdbcDriver.java +--- a/src/org/hsqldb/jdbcDriver.java 2006-04-11 17:03:24.000000000 +0200 ++++ b/src/org/hsqldb/jdbcDriver.java 2026-08-13 08:05:47.660111000 +0200 +@@ -321,4 +321,16 @@ + DriverManager.registerDriver(new jdbcDriver()); + } catch (Exception e) {} + } ++ ++//#ifdef JAVA6 ++/* ++ public java.util.logging ++ .Logger getParentLogger() throws java.sql ++ .SQLFeatureNotSupportedException { ++ throw new UnsupportedOperationException("Not supported yet."); ++ } ++*/ ++ ++//#endif ++ + } +diff -Naur pristine/hsqldb/src/org/hsqldb/lib/StringComparator.java hsqldb/src/org/hsqldb/lib/StringComparator.java +--- a/src/org/hsqldb/lib/StringComparator.java 1970-01-01 01:00:00.000000000 +0100 ++++ b/src/org/hsqldb/lib/StringComparator.java 2026-08-13 08:05:47.687575200 +0200 +@@ -0,0 +1,53 @@ ++/* Copyright (c) 2001-2008, The HSQL Development Group ++ * All rights reserved. ++ * ++ * Redistribution and use in source and binary forms, with or without ++ * modification, are permitted provided that the following conditions are met: ++ * ++ * Redistributions of source code must retain the above copyright notice, this ++ * list of conditions and the following disclaimer. ++ * ++ * Redistributions in binary form must reproduce the above copyright notice, ++ * this list of conditions and the following disclaimer in the documentation ++ * and/or other materials provided with the distribution. ++ * ++ * Neither the name of the HSQL Development Group nor the names of its ++ * contributors may be used to endorse or promote products derived from this ++ * software without specific prior written permission. ++ * ++ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ++ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ * ARE DISCLAIMED. IN NO EVENT SHALL HSQL DEVELOPMENT GROUP, HSQLDB.ORG, ++ * OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, ++ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, ++ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; ++ * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ++ * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT ++ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS ++ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ++ */ ++ ++ ++package org.hsqldb.lib; ++ ++public class StringComparator implements ObjectComparator { ++ ++ public int compare(Object a, Object b) { ++ ++ // handle nulls ++ if (a == b) { ++ return 0; ++ } ++ ++ if (a == null) { ++ return -1; ++ } ++ ++ if (b == null) { ++ return 1; ++ } ++ ++ return ((String) a).compareTo((String) b); ++ } ++} +diff -Naur pristine/hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java hsqldb/src/org/hsqldb/persist/HsqlDatabaseProperties.java +--- a/src/org/hsqldb/persist/HsqlDatabaseProperties.java 2008-03-17 17:05:41.000000000 +0100 ++++ b/src/org/hsqldb/persist/HsqlDatabaseProperties.java 2026-08-13 08:05:47.698029700 +0200 +@@ -429,6 +429,7 @@ + setProperty(hsqldb_log_size, 10); + setProperty(sql_enforce_strict_size, true); + setProperty(hsqldb_nio_data_file, false); ++ setProperty(hsqldb_lock_file, true); + } + + // OOo end diff --git a/ext_libraries/modules/hsqldb/1.8.0/source.json b/ext_libraries/modules/hsqldb/1.8.0/source.json new file mode 100644 index 0000000000..be7f94f26a --- /dev/null +++ b/ext_libraries/modules/hsqldb/1.8.0/source.json @@ -0,0 +1,13 @@ +{ + "url": "file:///C:/workspace/openoffice/ext_sources/17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip", + "integrity": "sha256-0wsT9LouO2otTwIMDe4Kn7n8b7zC1WHza3jaS/OAI3A=", + "strip_prefix": "hsqldb", + "overlay": { + "MODULE.bazel": "sha256-o2J1egfwqE5IgWn95r5cKaiG6mI7W7d+rQIOWevYUWI=", + "BUILD.bazel": "sha256-jcwEGl/P8V251/+kr6ecm5DZsYjWVCiEL15xCskWKm4=" + }, + "patches": { + "aoo-hsqldb.patch": "sha256-IJcXwdW1ETdxNneaHymJ9OE+7yR5NfiCsfbIC3xF/OA=" + }, + "patch_strip": 1 +} diff --git a/ext_libraries/modules/hsqldb/metadata.json b/ext_libraries/modules/hsqldb/metadata.json new file mode 100644 index 0000000000..b262e0fd9d --- /dev/null +++ b/ext_libraries/modules/hsqldb/metadata.json @@ -0,0 +1,7 @@ +{ + "homepage": "http://hsqldb.org/", + "maintainers": [], + "repository": [], + "versions": ["1.8.0"], + "yanked_versions": {} +} diff --git a/main/connectivity/BUILD.bazel b/main/connectivity/BUILD.bazel index 41c43cc9ba..b046297d87 100644 --- a/main/connectivity/BUILD.bazel +++ b/main/connectivity/BUILD.bazel @@ -1,7 +1,9 @@ package(default_visibility = ["//visibility:public"]) load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library") +load("@rules_java//java:defs.bzl", "java_library") load("//build/rules:rsc_pipeline.bzl", "rsc_res") +load("//build/rules:java_pipeline.bzl", "uno_jar") _DEFINES = [ "WNT", "GUI", "WIN32", @@ -214,6 +216,338 @@ filegroup( visibility = ["//visibility:public"], ) +# ── file.dll — shared base for the file-based drivers ────────────── +# Not a UNO component: no component_getFactory, nothing in services.rdb. +# It is the common SDBC implementation that dbase, flat and calc derive +# from, exported by declspec via OOO_DLLPUBLIC_FILE (source/inc/file/ +# filedllapi.hxx) exactly like dbtools — hence no win_def_file. dmake +# built it with USE_DEFFILE + a .flt symbol filter, which only existed +# because the .flt route predates the declspec annotations; the headers +# are fully annotated, so the DEF is redundant here. +cc_binary( + name = "file", + srcs = glob(["source/drivers/file/*.cxx"]), + copts = _COPTS, + defines = _DEFINES + ["OOO_DLLIMPLEMENTATION_FILE"], + linkshared = True, + # stlport: connectivity/dbtools.hxx declares askForParameters() with a + # ::std::bit_vector default argument (line 611). bit_vector is an SGI STL + # extension that only stlport provides, so EVERY consumer of that header + # needs it, not just the ones using hash_map. + deps = [ + ":connectivity_headers", + "//main/stlport:stlport", + ], + additional_linker_inputs = [ + "//main/sal:sal_implib", + "//main/cppu:cppu3_implib", + "//main/cppuhelper:cppuhelper_implib", + "//main/comphelper:comphelpMSC_implib", + "//main/tools:tl_implib", + "//main/unotools:utl_implib", + "//main/svl:svl_implib", + "//main/ucbhelper:ucbhelperMSC_implib", + "//main/vos:vos3MSC_implib", + ":dbtools_implib", + ], + linkopts = [ + "$(execpath //main/sal:sal_implib)", + "$(execpath //main/cppu:cppu3_implib)", + "$(execpath //main/cppuhelper:cppuhelper_implib)", + "$(execpath //main/comphelper:comphelpMSC_implib)", + "$(execpath //main/tools:tl_implib)", + "$(execpath //main/unotools:utl_implib)", + "$(execpath //main/svl:svl_implib)", + "$(execpath //main/ucbhelper:ucbhelperMSC_implib)", + "$(execpath //main/vos:vos3MSC_implib)", + "$(execpath :dbtools_implib)", + "user32.lib", "/MANIFEST:NO", + ], + visibility = ["//visibility:public"], +) + +filegroup( + name = "file_implib", + srcs = [":file"], + output_group = "interface_library", + visibility = ["//visibility:public"], +) + +# ── dbase.dll — dBASE III/IV driver ──────────────────────────────── +# DNoException.cxx is excluded, matching dmake: it is the ONE file in this +# directory absent from the makefile's SLOFILES, and nothing #includes it. +# It is a stale second copy of function bodies that also live in DTable.cxx +# and dindexnode.cxx (ODbaseTable::seekRow/ReadMemo/AllocBuffer/WriteBuffer, +# the whole ONDXNode/ONDXPage/ONDXPagePtr set), so compiling it gives ~25 +# LNK2005 duplicate-symbol errors. Not a candidate for the glob. +cc_binary( + name = "dbase", + srcs = glob( + ["source/drivers/dbase/*.cxx"], + exclude = ["source/drivers/dbase/DNoException.cxx"], + ), + copts = _COPTS, + defines = _DEFINES, + linkshared = True, + win_def_file = "util/dbase.def", + deps = [ + ":connectivity_headers", + "//main/stlport:stlport", + ], + additional_linker_inputs = [ + "//main/sal:sal_implib", + "//main/cppu:cppu3_implib", + "//main/cppuhelper:cppuhelper_implib", + "//main/comphelper:comphelpMSC_implib", + "//main/tools:tl_implib", + "//main/unotools:utl_implib", + "//main/svl:svl_implib", + "//main/ucbhelper:ucbhelperMSC_implib", + "//main/vos:vos3MSC_implib", + ":dbtools_implib", + ":file_implib", + ], + linkopts = [ + "$(execpath //main/sal:sal_implib)", + "$(execpath //main/cppu:cppu3_implib)", + "$(execpath //main/cppuhelper:cppuhelper_implib)", + "$(execpath //main/comphelper:comphelpMSC_implib)", + "$(execpath //main/tools:tl_implib)", + "$(execpath //main/unotools:utl_implib)", + "$(execpath //main/svl:svl_implib)", + "$(execpath //main/ucbhelper:ucbhelperMSC_implib)", + "$(execpath //main/vos:vos3MSC_implib)", + "$(execpath :dbtools_implib)", + "$(execpath :file_implib)", + "user32.lib", "/MANIFEST:NO", + ], + visibility = ["//visibility:public"], +) + +# ── flat.dll — delimited-text driver ─────────────────────────────── +cc_binary( + name = "flat", + srcs = glob(["source/drivers/flat/*.cxx"]), + copts = _COPTS, + defines = _DEFINES, + linkshared = True, + win_def_file = "util/flat.def", + deps = [ + ":connectivity_headers", + "//main/stlport:stlport", + ], + additional_linker_inputs = [ + "//main/sal:sal_implib", + "//main/cppu:cppu3_implib", + "//main/cppuhelper:cppuhelper_implib", + "//main/comphelper:comphelpMSC_implib", + "//main/tools:tl_implib", + "//main/unotools:utl_implib", + "//main/svl:svl_implib", + "//main/vos:vos3MSC_implib", + ":dbtools_implib", + ":file_implib", + ], + linkopts = [ + "$(execpath //main/sal:sal_implib)", + "$(execpath //main/cppu:cppu3_implib)", + "$(execpath //main/cppuhelper:cppuhelper_implib)", + "$(execpath //main/comphelper:comphelpMSC_implib)", + "$(execpath //main/tools:tl_implib)", + "$(execpath //main/unotools:utl_implib)", + "$(execpath //main/svl:svl_implib)", + "$(execpath //main/vos:vos3MSC_implib)", + "$(execpath :dbtools_implib)", + "$(execpath :file_implib)", + "user32.lib", "/MANIFEST:NO", + ], + visibility = ["//visibility:public"], +) + +# ── calc.dll — spreadsheet-as-datasource driver ──────────────────── +cc_binary( + name = "calc", + srcs = glob(["source/drivers/calc/*.cxx"]), + copts = _COPTS, + defines = _DEFINES, + linkshared = True, + win_def_file = "util/calc.def", + deps = [ + ":connectivity_headers", + "//main/stlport:stlport", + ], + additional_linker_inputs = [ + "//main/sal:sal_implib", + "//main/cppu:cppu3_implib", + "//main/cppuhelper:cppuhelper_implib", + "//main/comphelper:comphelpMSC_implib", + "//main/tools:tl_implib", + "//main/unotools:utl_implib", + "//main/svl:svl_implib", + "//main/vos:vos3MSC_implib", + ":dbtools_implib", + ":file_implib", + ], + linkopts = [ + "$(execpath //main/sal:sal_implib)", + "$(execpath //main/cppu:cppu3_implib)", + "$(execpath //main/cppuhelper:cppuhelper_implib)", + "$(execpath //main/comphelper:comphelpMSC_implib)", + "$(execpath //main/tools:tl_implib)", + "$(execpath //main/unotools:utl_implib)", + "$(execpath //main/svl:svl_implib)", + "$(execpath //main/vos:vos3MSC_implib)", + "$(execpath :dbtools_implib)", + "$(execpath :file_implib)", + "user32.lib", "/MANIFEST:NO", + ], + visibility = ["//visibility:public"], +) + +# ── jdbc.dll — generic JDBC bridge driver ────────────────────────── +# SOLAR_JAVA is LOAD-BEARING, not a feature switch: jvmaccess/virtualmachine.hxx +# #includes the real <jni.h> only under it and otherwise declares stubs, so +# without it every JNIEnv-> call is C2027 even in files that include <jni.h> +# themselves. Same landmine as //main/stoc javaloader and the java_uno bridge. +cc_binary( + name = "jdbc", + srcs = glob(["source/drivers/jdbc/*.cxx"]), + copts = _COPTS, + defines = _DEFINES + ["SOLAR_JAVA"], + linkshared = True, + win_def_file = "util/jdbc.def", + deps = [ + ":connectivity_headers", + "//main/stlport:stlport", + "@boost.legacy//:boost.legacy", + "@rules_java//toolchains:jni", + ], + additional_linker_inputs = [ + "//main/sal:sal_implib", + "//main/cppu:cppu3_implib", + "//main/cppuhelper:cppuhelper_implib", + "//main/comphelper:comphelpMSC_implib", + "//main/unotools:utl_implib", + "//main/vos:vos3MSC_implib", + "//main/jvmaccess:jvmaccess3MSC_implib", + "//main/jvmfwk:jvmfwk_implib", + ":dbtools_implib", + ], + linkopts = [ + "$(execpath //main/sal:sal_implib)", + "$(execpath //main/cppu:cppu3_implib)", + "$(execpath //main/cppuhelper:cppuhelper_implib)", + "$(execpath //main/comphelper:comphelpMSC_implib)", + "$(execpath //main/unotools:utl_implib)", + "$(execpath //main/vos:vos3MSC_implib)", + "$(execpath //main/jvmaccess:jvmaccess3MSC_implib)", + "$(execpath //main/jvmfwk:jvmfwk_implib)", + "$(execpath :dbtools_implib)", + "user32.lib", "/MANIFEST:NO", + ], + visibility = ["//visibility:public"], +) + +# ── hsqldb.dll — embedded HSQLDB driver ──────────────────────────── +# This is what "create a new Base database" resolves to: dbaccess hardcodes +# sdbc:embedded:hsqldb (dbaccess/source/core/misc/dsntypes.cxx), HDriver +# delegates the actual SQL to the JDBC driver above ("jdbc:hsqldb:db"), and +# the HSQLDB engine reaches back through the JNI exports below so the database +# lives inside the .odb zip storage rather than as loose files on disk. +# +# DUAL-ROLE DLL: a UNO component AND a JNI library, hence a DEF that carries +# both component_* entries and 28 undecorated Java_* names (JNICALL is +# __stdcall on Win32, so without the DEF they would be exported as _Java_..@N +# and the JVM could not find them) -- same trick as //main/jurt jpipe.def. +# +# No RT_MANIFEST id 2 here, deliberately, and this is the one place the +# jpipe rule does NOT generalise: jpipe/jpipx are loaded by a stock java.exe +# that has no VC90 activation context of its own, whereas the JVM that calls +# these natives runs IN-PROCESS inside soffice.exe (started by javavm/jvmfwk), +# whose own manifest already covers the whole process. +# +# NOT named with a DLLPOSTFIX, unlike every other driver here: version.mk sets +# HSQLDB_TARGET=hsqldb bare, because the Java side hardcodes the base name in +# System.loadLibrary("hsqldb") (sdbc_hsqldb NativeLibraries.java). +cc_binary( + name = "hsqldb", + srcs = glob(["source/drivers/hsqldb/*.cxx"]), + copts = _COPTS, + defines = _DEFINES + ["SOLAR_JAVA"], + linkshared = True, + win_def_file = "util/hsqldb.def", + deps = [ + ":connectivity_headers", + "//main/stlport:stlport", + "@boost.legacy//:boost.legacy", + "@rules_java//toolchains:jni", + ], + additional_linker_inputs = [ + "//main/sal:sal_implib", + "//main/cppu:cppu3_implib", + "//main/cppuhelper:cppuhelper_implib", + "//main/comphelper:comphelpMSC_implib", + "//main/tools:tl_implib", + "//main/unotools:utl_implib", + "//main/jvmfwk:jvmfwk_implib", + ":dbtools_implib", + ], + linkopts = [ + "$(execpath //main/sal:sal_implib)", + "$(execpath //main/cppu:cppu3_implib)", + "$(execpath //main/cppuhelper:cppuhelper_implib)", + "$(execpath //main/comphelper:comphelpMSC_implib)", + "$(execpath //main/tools:tl_implib)", + "$(execpath //main/unotools:utl_implib)", + "$(execpath //main/jvmfwk:jvmfwk_implib)", + "$(execpath :dbtools_implib)", + "user32.lib", "/MANIFEST:NO", + ], + visibility = ["//visibility:public"], +) + +# ── hsqldb.jar — the embedded database engine ────────────────────── +# AOO's patched classes come FIRST: singlejar keeps the first occurrence of a +# duplicate entry, so this is what makes the patches actually win over the +# release jar's copies. See the overlay BUILD in the @hsqldb module for why +# the release jar is the base rather than a full source build. +# +# The filename is not cosmetic: HDriver.cxx hardcodes the classpath it hands +# to the JDBC driver as +# vnd.sun.star.expand:$OOO_BASE_DIR/program/classes/hsqldb.jar +# vnd.sun.star.expand:$OOO_BASE_DIR/program/classes/sdbc_hsqldb.jar +# so both jars must land in program/classes/ under exactly these names. +uno_jar( + name = "hsqldb_jar", + out = "hsqldb.jar", + jars = [ + "@hsqldb//:hsqldb_patches", + "@hsqldb//:hsqldb_upstream", + ], + visibility = ["//visibility:public"], +) + +# ── sdbc_hsqldb.jar — AOO's storage bridge into the .odb ─────────── +# The half that makes an embedded database a SINGLE FILE: StorageAccess and +# StorageFileAccess implement org.hsqldb.lib.Storage / FileAccess in terms of +# UNO's embedded storage, and their native methods are the Java_* exports of +# hsqldb.dll, so the engine reads and writes inside the .odb zip rather than +# next to it. Depends only on the engine and the JDK -- no UNO jars. +java_library( + name = "sdbc_hsqldb_lib", + srcs = glob(["java/sdbc_hsqldb/src/**/*.java"]), + deps = ["@hsqldb//:hsqldb_upstream"], +) + +uno_jar( + name = "sdbc_hsqldb_jar", + out = "sdbc_hsqldb.jar", + jars = [":sdbc_hsqldb_lib"], + # Mirrors the ant build's jar-class-path property. + manifest_lines = ["Class-Path: hsqldb.jar"], + visibility = ["//visibility:public"], +) + rsc_res( name = "connectivity_res", srcs = glob(["source/**/*.src"]), @@ -231,12 +565,15 @@ rsc_res( exports_files(glob(["**/*.component"])) # DataAccess XCU files consumed by //main/postprocess pack_registry targets. +# Exported for every driver whose source is here; which ones are actually PACKED +# is postprocess's decision, and it packs only those with a built DLL. exports_files([ "source/drivers/adabas/adabas.xcu", "source/drivers/ado/ado.xcu", "source/drivers/calc/calc.xcu", "source/drivers/dbase/dbase.xcu", "source/drivers/flat/flat.xcu", + "source/drivers/hsqldb/hsqldb.xcu", "source/drivers/mysql/mysql.xcu", "source/drivers/odbc/odbc.xcu", ]) diff --git a/main/connectivity/util/calc.def b/main/connectivity/util/calc.def new file mode 100644 index 0000000000..b65090458d --- /dev/null +++ b/main/connectivity/util/calc.def @@ -0,0 +1,4 @@ +LIBRARY calc +EXPORTS + component_getImplementationEnvironment + component_getFactory diff --git a/main/connectivity/util/dbase.def b/main/connectivity/util/dbase.def new file mode 100644 index 0000000000..fa49ee1fb7 --- /dev/null +++ b/main/connectivity/util/dbase.def @@ -0,0 +1,4 @@ +LIBRARY dbase +EXPORTS + component_getImplementationEnvironment + component_getFactory diff --git a/main/connectivity/util/flat.def b/main/connectivity/util/flat.def new file mode 100644 index 0000000000..1e03dbacc3 --- /dev/null +++ b/main/connectivity/util/flat.def @@ -0,0 +1,4 @@ +LIBRARY flat +EXPORTS + component_getImplementationEnvironment + component_getFactory diff --git a/main/connectivity/util/hsqldb.def b/main/connectivity/util/hsqldb.def new file mode 100644 index 0000000000..cf5aa06177 --- /dev/null +++ b/main/connectivity/util/hsqldb.def @@ -0,0 +1,37 @@ +; hsqldb.dll is dual-role: a UNO component AND a JNI library. The two +; component_* entries are what the SharedLibrary loader resolves; every +; Java_* entry is a native method of the classes in sdbc_hsqldb.jar, which +; the HSQLDB engine calls back into so that the database files live inside +; the .odb zip storage instead of on disk. Transcribed from +; source/drivers/hsqldb/exports.dxp -- keep the two in step. +LIBRARY hsqldb +EXPORTS + component_getImplementationEnvironment + component_getFactory + Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_openStream + Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_write__Ljava_lang_String_2Ljava_lang_String_2_3BII + Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_write__Ljava_lang_String_2Ljava_lang_String_2_3B + Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_close + Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_write__Ljava_lang_String_2Ljava_lang_String_2I + Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_flush + Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeOutputStream_sync + Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_openStream + Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_close + Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_getFilePointer + Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_length + Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_read__Ljava_lang_String_2Ljava_lang_String_2 + Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_read__Ljava_lang_String_2Ljava_lang_String_2_3BII + Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_readInt + Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_seek + Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_write + Java_com_sun_star_sdbcx_comp_hsqldb_NativeStorageAccess_writeInt + Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_openStream + Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2 + Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2_3BII + Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_close + Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_skip + Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_available + Java_com_sun_star_sdbcx_comp_hsqldb_StorageNativeInputStream_read__Ljava_lang_String_2Ljava_lang_String_2_3B + Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_isStreamElement + Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_removeElement + Java_com_sun_star_sdbcx_comp_hsqldb_StorageFileAccess_renameElement diff --git a/main/connectivity/util/jdbc.def b/main/connectivity/util/jdbc.def new file mode 100644 index 0000000000..9530730c42 --- /dev/null +++ b/main/connectivity/util/jdbc.def @@ -0,0 +1,4 @@ +LIBRARY jdbc +EXPORTS + component_getImplementationEnvironment + component_getFactory diff --git a/main/postprocess/BUILD.bazel b/main/postprocess/BUILD.bazel index 639e1d8426..9aa6425e2a 100644 --- a/main/postprocess/BUILD.bazel +++ b/main/postprocess/BUILD.bazel @@ -163,20 +163,27 @@ _SERVICES_COMPONENTS = { basis_native("dbpool2.dll"), "//main/connectivity:source/dbtools/dbtools.component": basis_native("dbtools.dll"), - "//main/connectivity:source/drivers/adabas/adabas.component": - basis_native("adabas.dll"), - "//main/connectivity:source/drivers/ado/ado.component": - basis_native("ado.dll"), "//main/connectivity:source/drivers/dbase/dbase.component": basis_native("dbase.dll"), "//main/connectivity:source/drivers/flat/flat.component": basis_native("flat.dll"), - "//main/connectivity:source/drivers/mysql/mysql.component": - basis_native("mysql.dll"), - "//main/connectivity:source/drivers/odbc/odbc.component": - basis_native("odbc.dll"), + # The embedded-database pair. hsqldb is what "create a new Base database" + # resolves to (dbaccess hardcodes sdbc:embedded:hsqldb) and it delegates the + # SQL to jdbc, so registering one without the other is useless. + "//main/connectivity:source/drivers/hsqldb/hsqldb.component": + basis_native("hsqldb.dll"), + "//main/connectivity:source/drivers/jdbc/jdbc.component": + basis_native("jdbc.dll"), "//main/connectivity:source/manager/sdbc2.component": basis_native("sdbc2.dll"), + # NOT registered: adabas, ado, mysql, odbc. Their DLLs are not built (see + # connectivity/readme.md), and a registration without a library behind it is + # worse than none: the driver manager resolves the service, osl_loadModule + # fails on a file that was never produced, and the resulting UNO exception + # escapes the VCL message loop to desktop/source/app/app.cxx's catch, which + # calls FatalError() -> _exit(). I.e. picking such a driver in Base KILLS + # the office rather than reporting an error. Re-add each line the moment + # the matching cc_binary exists, never before. # ── cui ─────────────────────────────────────────────────────────────── "//main/cui:util/cui.component": @@ -955,13 +962,14 @@ _MAIN_XCU = [ oc_xcu("UserProfile.xcu"), oc_xcu("VCL.xcu"), oc_xcu("ucb/Configuration.xcu"), - # DataAccess XCU (Windows build: dbase, flat, mysql, odbc, adabas, ado) + # DataAccess XCU — one entry per driver that is actually BUILT. These are + # what make a connection type selectable in the Base wizard, so listing a + # driver here whose DLL does not exist is what turns "unsupported database" + # into a hard process exit. Keep this list in step with the component + # registrations above: dbase, flat, calc, hsqldb. "//main/connectivity:source/drivers/dbase/dbase.xcu", "//main/connectivity:source/drivers/flat/flat.xcu", - "//main/connectivity:source/drivers/mysql/mysql.xcu", - "//main/connectivity:source/drivers/odbc/odbc.xcu", - "//main/connectivity:source/drivers/adabas/adabas.xcu", - "//main/connectivity:source/drivers/ado/ado.xcu", + "//main/connectivity:source/drivers/hsqldb/hsqldb.xcu", # FCFGMerge spool fcfg("fcfg_base_types"), fcfg("fcfg_base_filters"), diff --git a/main/staging/BUILD.bazel b/main/staging/BUILD.bazel index 9b8d85768f..f09736a6b3 100644 --- a/main/staging/BUILD.bazel +++ b/main/staging/BUILD.bazel @@ -301,6 +301,15 @@ collect_outputs( "//main/connectivity:dbtools", "//main/connectivity:sdbc2", "//main/connectivity:dbpool2", + # SDBC drivers. file.dll is not a component and nothing registers it — + # it is the shared implementation dbase/flat/calc link against — but it + # must be staged all the same or those three fail to load. + "//main/connectivity:file", + "//main/connectivity:dbase", + "//main/connectivity:flat", + "//main/connectivity:calc", + "//main/connectivity:jdbc", + "//main/connectivity:hsqldb", "//main/dbaccess:dba", "//main/dbaccess:dbu", "//main/dbaccess:dbaxml", @@ -664,6 +673,13 @@ filegroup( "//main/javaunohelper:juh_runtime_jar", "//main/bridges:java_uno_runtime_jar", "//main/unoil:unoil_jar", + # The embedded-database pair. Not part of the UNO runtime like the six + # above, but they belong in the same directory: HDriver.cxx builds the + # JDBC classpath as the literal + # vnd.sun.star.expand:$OOO_BASE_DIR/program/classes/{hsqldb,sdbc_hsqldb}.jar + # so program/classes is not a convention here, it is the lookup path. + "//main/connectivity:hsqldb_jar", + "//main/connectivity:sdbc_hsqldb_jar", ], )
