From 076589f03accc989a3acac232fccee5c534cf839 Mon Sep 17 00:00:00 2001 From: Eric Lendvai Date: Wed, 18 Dec 2024 21:55:59 -0800 Subject: [PATCH] On branch rddsql_add_timestamp_support Changes to be committed: modified: ChangeLog.txt modified: contrib/rddsql/sqlbase.c modified: contrib/rddsql/sqlmix.c + added support to timestamp field type. You can now use "@" in DbCreate as the timestamp field type. Thanks to Grigory Filatov for fixing crash! --- ChangeLog.txt | 7 +++++++ contrib/rddsql/sqlbase.c | 7 +++++++ contrib/rddsql/sqlmix.c | 5 +++++ 3 files changed, 19 insertions(+) diff --git a/ChangeLog.txt b/ChangeLog.txt index 282ab8bb5a..20bc4397ee 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -7,6 +7,13 @@ Entries may not always be in chronological/commit order. See license at the end of file. */ +2024-12-18 21:48 UTC-0800 Eric Lendvai (harbour.wiki) + * contrib/rddsql/sqlbase.c + * contrib/rddsql/sqlmix.c + + added support to timestamp field type. + You can now use "@" in DbCreate as the timestamp field type. + Thanks to Grigory Filatov for fixing crash! + 2024-12-17 03:07 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl) * contrib/gtqtc/gtqtc.hbc ! fixed dependency macros - hbmk2 defines HB_HAS_* only for optional packages diff --git a/contrib/rddsql/sqlbase.c b/contrib/rddsql/sqlbase.c index f4acf4cfaa..84232bfb04 100644 --- a/contrib/rddsql/sqlbase.c +++ b/contrib/rddsql/sqlbase.c @@ -533,6 +533,7 @@ static HB_ERRCODE sqlbasePutValue( SQLBASEAREAP pArea, HB_USHORT uiIndex, PHB_IT errCode = HB_SUCCESS; pField = pArea->area.lpFields + ( uiIndex - 1 ); + if( ( ( HB_IS_MEMO( pItem ) || HB_IS_STRING( pItem ) ) && ( pField->uiType == HB_FT_STRING || pField->uiType == HB_FT_MEMO ) ) || ( HB_IS_DATE( pItem ) && pField->uiType == HB_FT_DATE ) || ( HB_IS_TIMESTAMP( pItem ) && pField->uiType == HB_FT_TIMESTAMP ) || @@ -742,6 +743,12 @@ static HB_ERRCODE sqlbaseCreate( SQLBASEAREAP pArea, LPDBOPENINFO pOpenInfo ) pItem = hb_itemPutDS( NULL, NULL ); break; + case HB_FT_TIMESTAMP: + { + pItem = hb_itemPutTDT( NULL, 0, 0 ); + break; + } + case HB_FT_LOGICAL: pItem = hb_itemPutL( NULL, HB_FALSE ); break; diff --git a/contrib/rddsql/sqlmix.c b/contrib/rddsql/sqlmix.c index d5855400f4..84b2ab0f04 100644 --- a/contrib/rddsql/sqlmix.c +++ b/contrib/rddsql/sqlmix.c @@ -1597,6 +1597,11 @@ static HB_ERRCODE sqlmixOrderCreate( SQLMIXAREAP pArea, LPDBORDERCREATEINFO pOrd uiLen = 8; break; + case HB_IT_TIMESTAMP: + bType = '@'; + uiLen = 26; + break; + case HB_IT_LOGICAL: bType = 'L'; uiLen = 1;