[koffice] - include some kexi patches recommended by upstream
Rex Dieter
rdieter at fedoraproject.org
Wed Sep 8 16:09:39 UTC 2010
commit 6ec278491a73263c3bbe902ae918153fee9ab4e9
Author: Rex Dieter <rdieter at fedoraproject.org>
Date: Wed Sep 8 11:15:13 2010 -0500
- include some kexi patches recommended by upstream
fix-crash-on-closing-sqlite-connection-2.2.2.patch | 13 +++
koffice.spec | 12 +++-
support-large-memo-values-for-msaccess-2.2.2.patch | 96 ++++++++++++++++++++
3 files changed, 120 insertions(+), 1 deletions(-)
---
diff --git a/fix-crash-on-closing-sqlite-connection-2.2.2.patch b/fix-crash-on-closing-sqlite-connection-2.2.2.patch
new file mode 100644
index 0000000..8f1d8d4
--- /dev/null
+++ b/fix-crash-on-closing-sqlite-connection-2.2.2.patch
@@ -0,0 +1,13 @@
+Index: kexi/kexidb/drivers/sqlite/sqliteconnection.cpp
+===================================================================
+--- kexi/kexidb/drivers/sqlite/sqliteconnection.cpp (revision 1172693)
++++ kexi/kexidb/drivers/sqlite/sqliteconnection.cpp (working copy)
+@@ -55,7 +55,7 @@
+ SQLiteConnectionInternal::~SQLiteConnectionInternal()
+ {
+ if (data_owned && data) {
+- free(data);
++ sqlite3_close(data);
+ data = 0;
+ }
+ //sqlite_freemem does this if (errmsg) {
diff --git a/koffice.spec b/koffice.spec
index a15c8d4..e6a14d1 100644
--- a/koffice.spec
+++ b/koffice.spec
@@ -21,7 +21,7 @@
Name: koffice
Epoch: 3
Version: 2.2.2
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: An integrated office suite
Group: Applications/Productivity
@@ -34,6 +34,10 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
## upstreamable patches
## upstream patches
+# http://bugs.kde.org/show_bug.cgi?id=245030
+Patch100: http://kexi-project.org/download/patches/2.2.2/fix-crash-on-closing-sqlite-connection-2.2.2.patch
+# http://bugs.kde.org/show_bug.cgi?id=244420
+Patch101: http://kexi-project.org/download/patches/2.2.2/support-large-memo-values-for-msaccess-2.2.2.patch
#-- The following OPTIONAL packages could NOT be located on your system.
#-- Consider installing them to enable more features from this software.
@@ -451,6 +455,9 @@ Requires: libxml2-devel
%prep
%setup -q
+%patch100 -p0 -b .kexi_sqlite
+%patch101 -p0 -b .kexi_msaccess
+
## kdchart munging begin
pushd kchart/kdchart
mv src kdchart
@@ -1126,6 +1133,9 @@ fi
%changelog
+* Wed Sep 08 2010 Rex Dieter <rdieter at fedoraproject.org. - 3:2.2.2-2
+- include some kexi patches recommended by upstream
+
* Sat Aug 21 2010 Rex Dieter <rdieter at fedoraproject.org> - 3:2.2.2-1
- koffice-2.2.2
diff --git a/support-large-memo-values-for-msaccess-2.2.2.patch b/support-large-memo-values-for-msaccess-2.2.2.patch
new file mode 100644
index 0000000..c0ccf66
--- /dev/null
+++ b/support-large-memo-values-for-msaccess-2.2.2.patch
@@ -0,0 +1,96 @@
+Index: kexi/migration/mdb/src/keximdb/mdbmigrate.cpp
+===================================================================
+--- kexi/migration/mdb/src/keximdb/mdbmigrate.cpp (revision 1151353)
++++ kexi/migration/mdb/src/keximdb/mdbmigrate.cpp (revision 1151354)
+@@ -264,7 +264,15 @@
+ //! Bind + allocate the DB columns to columnData and columnDataLength arrays
+ mdb_read_columns(tableDef); // mdb_bind_column dies without this
+ for (unsigned int i = 0; i < tableDef->num_cols; i++) {
+- columnData[i] = (char*) g_malloc(MDB_BIND_SIZE);
++ MdbColumn *col = (MdbColumn*) g_ptr_array_index(tableDef->columns, i);
++ if (col->col_type == MDB_MEMO) {
++//! @todo supporting 1GB (possible to insert programmatically) of MEMO field needs changes in mdbtools API;
++//! for now 65,535 is supported (maximum when entering data through the user interface)
++ columnData[i] = (char*) g_malloc(0x10000);
++ }
++ else {
++ columnData[i] = (char*) g_malloc(MDB_BIND_SIZE);
++ }
+
+ // Columns are numbered from 1
+ // and why aren't these unsigned ints?
+Index: kexi/migration/mdb/src/mdbtools/libmdb/data.c
+===================================================================
+--- kexi/migration/mdb/src/mdbtools/libmdb/data.c (revision 1151353)
++++ kexi/migration/mdb/src/mdbtools/libmdb/data.c (revision 1151354)
+@@ -223,12 +223,19 @@
+
+ char *str;
+ if (col->col_type == MDB_NUMERIC) {
++ /*fprintf(stdout,"MDB_NUMERIC\n");*/
+ str = mdb_num_to_string(mdb, start,
+ col->col_type, col->col_prec,
+ col->col_scale);
++ /*fprintf(stdout,"mdb_num_to_string()=%d '%s'\n", strlen(str), str);*/
+ } else {
++ /*fprintf(stdout,"!MDB_NUMERIC : %d len=%d\n", col->col_type, len);*/
+ str = mdb_col_to_string(mdb, mdb->pg_buf, start,
+ col->col_type, len);
++ /*if (strlen(str) > MDB_BIND_SIZE) {
++ fprintf(stdout, "!!!!!!\n");
++ }
++ fprintf(stdout,"mdb_col_to_string()=%d '%s'\n", strlen(str), str);*/
+ }
+ strcpy(col->bind_ptr, str);
+ g_free(str);
+@@ -610,9 +617,11 @@
+ gint32 row_start, pg_row;
+ size_t len;
+ void *buf, *pg_buf = mdb->pg_buf;
+- char *text = (char *) g_malloc(MDB_BIND_SIZE);
++ char *text = 0;
+
++ /*printf("mdb_memo_to_string: size=%d\n", size);*/
+ if (size<MDB_MEMO_OVERHEAD) {
++ text = (char *) g_malloc(MDB_BIND_SIZE);
+ strcpy(text, "");
+ return text;
+ }
+@@ -626,13 +635,18 @@
+ * The 32 bit integer at offset 4 contains page and row information.
+ */
+ memo_len = mdb_get_int32(pg_buf, start);
++ /*printf("memo_len=%d\n", memo_len);*/
+
+ if (memo_len & 0x80000000) {
++ text = (char *) g_malloc(MDB_BIND_SIZE);
++ /*printf("INLINE MEMO\n");*/
+ /* inline memo field */
+ mdb_unicode2ascii(mdb, (char*)pg_buf + start + MDB_MEMO_OVERHEAD,
+ size - MDB_MEMO_OVERHEAD, text, MDB_BIND_SIZE);
+ return text;
+ } else if (memo_len & 0x40000000) {
++ text = (char *) g_malloc(MDB_BIND_SIZE);
++ /*printf("SINGLE-PAGE MEMO\n");*/
+ /* single-page memo field */
+ pg_row = mdb_get_int32(pg_buf, start+4);
+ #if MDB_DEBUG
+@@ -650,6 +664,7 @@
+ mdb_unicode2ascii(mdb, (char*)buf + row_start, len, text, MDB_BIND_SIZE);
+ return text;
+ } else if ((memo_len & 0xff000000) == 0) { /* assume all flags in MSB */
++ /*printf("MULTI-PAGE MEMO\n");*/
+ /* multi-page memo field */
+ guint32 tmpoff = 0;
+ char *tmp;
+@@ -678,7 +693,9 @@
+ if (tmpoff < memo_len) {
+ fprintf(stderr, "Warning: incorrect memo length\n");
+ }
+- mdb_unicode2ascii(mdb, tmp, tmpoff, text, MDB_BIND_SIZE);
++ /*printf("ALLOCATING tmpoff *2: %d\n", tmpoff * 2);*/
++ text = (char *) g_malloc(tmpoff);
++ mdb_unicode2ascii(mdb, tmp, tmpoff, text, tmpoff);
+ g_free(tmp);
+ return text;
+ } else {
More information about the scm-commits
mailing list