rpms/mdbtools/devel mdbtools-0.5.99.0.6pre1.0.20051109-odbc.patch, NONE, 1.1 mdbtools.spec, 1.2, 1.3
Hans de Goede
jwrdegoede at fedoraproject.org
Tue Nov 25 08:36:43 UTC 2008
- Previous message: rpms/perl-Config-Augeas/F-10 .cvsignore, 1.5, 1.6 perl-Config-Augeas.spec, 1.4, 1.5 sources, 1.5, 1.6
- Next message: rpms/perl-Config-Augeas/F-9 .cvsignore, 1.3, 1.4 perl-Config-Augeas.spec, 1.2, 1.3 sources, 1.3, 1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Author: jwrdegoede
Update of /cvs/extras/rpms/mdbtools/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv23774
Modified Files:
mdbtools.spec
Added Files:
mdbtools-0.5.99.0.6pre1.0.20051109-odbc.patch
Log Message:
* Mon Nov 24 2008 Hans de Goede <j.w.r.degoede at hhs.nl> 0.6-0.5.cvs20051109
- Fix several issues with the odbc interface (rh 472692)
mdbtools-0.5.99.0.6pre1.0.20051109-odbc.patch:
--- NEW FILE mdbtools-0.5.99.0.6pre1.0.20051109-odbc.patch ---
diff -up mdbtools-0.6pre1/src/odbc/odbc.c.odbc mdbtools-0.6pre1/src/odbc/odbc.c
--- mdbtools-0.6pre1/src/odbc/odbc.c.odbc 2008-11-24 09:57:03.000000000 +0100
+++ mdbtools-0.6pre1/src/odbc/odbc.c 2008-11-24 10:20:06.000000000 +0100
@@ -597,7 +597,7 @@ SQLRETURN SQL_API SQLDescribeCol(
SQLSMALLINT FAR *pibScale,
SQLSMALLINT FAR *pfNullable)
{
- int namelen, i;
+ int i;
struct _hstmt *stmt = (struct _hstmt *) hstmt;
struct _hdbc *dbc = (struct _hdbc *) stmt->hdbc;
struct _henv *env = (struct _henv *) dbc->henv;
@@ -620,9 +620,10 @@ SQLRETURN SQL_API SQLDescribeCol(
}
if (szColName) {
- namelen = MIN(cbColNameMax,strlen(sqlcol->name));
- strncpy(szColName, sqlcol->name, namelen);
- szColName[namelen]='\0';
+ strncpy(szColName, sqlcol->name, cbColNameMax);
+ szColName[cbColNameMax - 1] = '\0';
+ if (pcbColName)
+ *pcbColName = strlen(sqlcol->name);
}
if (pfSqlType) {
*pfSqlType = _odbc_get_client_type(col->col_type);
@@ -650,7 +651,7 @@ SQLRETURN SQL_API SQLColAttributes(
SQLSMALLINT FAR *pcbDesc,
SQLLEN FAR *pfDesc)
{
- int namelen, i;
+ int i;
struct _hstmt *stmt;
struct _hdbc *dbc;
struct _henv *env;
@@ -690,9 +691,10 @@ SQLRETURN SQL_API SQLColAttributes(
switch(fDescType) {
case SQL_COLUMN_NAME:
case SQL_COLUMN_LABEL:
- namelen = MIN(cbDescMax,strlen(sqlcol->name));
- strncpy(rgbDesc, sqlcol->name, namelen);
- ((char *)rgbDesc)[namelen]='\0';
+ strncpy(rgbDesc, sqlcol->name, cbDescMax);
+ ((char *)rgbDesc)[cbDescMax - 1] = '\0';
+ if (pcbDesc)
+ *pcbDesc = strlen(sqlcol->name);
break;
case SQL_COLUMN_TYPE:
*pfDesc = SQL_CHAR;
@@ -1162,13 +1164,21 @@ SQLRETURN SQL_API SQLGetData(
strcpy(rgbValue, (col->cur_value_len)?"0":"1");
if (pcbValue)
*pcbValue = 1;
+ } else if (col->col_type == MDB_OLE) {
+ int len;
+ col->bind_ptr = rgbValue;
+ len = mdb_ole_read(mdb, col, mdb->pg_buf + col->cur_value_start, cbValueMax);
+ col->bind_ptr = NULL;
+ if (pcbValue)
+ *pcbValue = len;
} else if (col->cur_value_len) {
char *str = mdb_col_to_string(mdb,mdb->pg_buf,
col->cur_value_start,col->col_type,col->cur_value_len);
- strcpy(rgbValue, str);
+ strncpy(rgbValue, str, cbValueMax);
+ ((char *)rgbValue)[cbValueMax - 1] = 0;
g_free(str);
if (pcbValue)
- *pcbValue = col->cur_value_len;
+ *pcbValue = strlen(rgbValue);
} else {
/* When NULL data is retrieved, non-null pcbValue is required */
if (pcbValue) {
Index: mdbtools.spec
===================================================================
RCS file: /cvs/extras/rpms/mdbtools/devel/mdbtools.spec,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- mdbtools.spec 19 Feb 2008 09:15:44 -0000 1.2
+++ mdbtools.spec 25 Nov 2008 08:36:12 -0000 1.3
@@ -2,7 +2,7 @@
Name: mdbtools
Version: 0.6
-Release: 0.4.cvs20051109%{?dist}
+Release: 0.5.cvs20051109%{?dist}
Summary: Access data stored in Microsoft Access databases
Group: Applications/Databases
License: GPLv2+
@@ -12,6 +12,7 @@
Patch0: mdbtools-0.6pre1-cvs20051109.patch.gz
Patch1: ftp://ftp.nluug.nl/pub/os/Linux/distr/debian/pool/main/m/mdbtools/mdbtools_0.5.99.0.6pre1.0.20051109-4.diff.gz
Patch2: mdbtools-0.6-crashes.patch
+Patch3: mdbtools-0.5.99.0.6pre1.0.20051109-odbc.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: unixODBC-devel libgnomeui-devel readline-devel
BuildRequires: bison flex desktop-file-utils
@@ -71,6 +72,7 @@
done
popd
%patch2 -p1 -z .crash
+%patch3 -p1 -z .odbc
chmod -x COPYING.LIB
@@ -131,6 +133,9 @@
%changelog
+* Mon Nov 24 2008 Hans de Goede <j.w.r.degoede at hhs.nl> 0.6-0.5.cvs20051109
+- Fix several issues with the odbc interface (rh 472692)
+
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng at fedoraproject.org> - 0.6-0.4.cvs20051109
- Autorebuild for GCC 4.3
- Previous message: rpms/perl-Config-Augeas/F-10 .cvsignore, 1.5, 1.6 perl-Config-Augeas.spec, 1.4, 1.5 sources, 1.5, 1.6
- Next message: rpms/perl-Config-Augeas/F-9 .cvsignore, 1.3, 1.4 perl-Config-Augeas.spec, 1.2, 1.3 sources, 1.3, 1.4
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the scm-commits
mailing list