Clipper On Line • Ver Tópico - Correção bug ODBC Harbour campos decimais

Correção bug ODBC Harbour campos decimais

Discussão sobre Banco de Dados e RDDs para Clipper/[x]Harbour.

Moderador: Moderadores

 

Correção bug ODBC Harbour campos decimais

Mensagempor Itamar M. Lins Jr. » 23 Fev 2015 18:09

Valeu Qatan!

Se não me engano eu também já tinha me deparado com esse bug...

Hello Przemek,

I know this update doesn’t have anything to do with the long lasting bug with hbodbc but I wanted to ask about it anyway...
Please look the attached examples (database included) and see that hbodbc fails to show numbers after the decimal point.
For example lets consider the value 1.23   - hbodbc doesn’t show the value .23...   only 1.00 so I would say it is a bug, isn’t it?
The question is: Is that possible to be fixed somehow? Do you know how to fix it? I really do not know how it could be done but for sure the bug persists since a long time.
Thanks for any reply.

Regards,

Qatan
....
2015-02-23 17:47 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
  * contrib/hbodbc/odbc.c
    * rewritten function SQLGetData() - new code is much simpler and
      fixes few bugs

  * contrib/hbodbc/todbc.prg
    % eliminated unnecessary AAdd() when final array size is already known
    ! do not round numbers read number to default number of decimal places

best regards
Przemek
....
Hello Przemek,

Wow! That’s really nice!
For years that error was annoying me...
I will test it on the next Nightly build.
Thanks for your great help.

Qatan


Saudações,
Itamar M. Lins Jr.
Avatar de usuário

Itamar M. Lins Jr.
Colaborador

Colaborador
 
Mensagens: 3676
Data de registro: 30 Mai 2007 11:31
Cidade/Estado: Ilheus Bahia
Curtiu: 125 vezes
Mens.Curtidas: 191 vezes

Correção bug ODBC Harbour campos decimais

Mensagempor Itamar M. Lins Jr. » 23 Fev 2015 20:25

Ooops!
Deu chabu no fork Harbour 3.4 do Viktor, diz ele que a solução dele é melhor.

2015-02-23 17:47 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
  * contrib/hbodbc/odbc.c
    * rewritten function SQLGetData() - new code is much simpler and
      fixes few bugs

    ; [REJECTED] Fork has a solution for this, upstream is not a clear
      step forward. It may contain parts adaptable but with no clear
      way to decide or merge. In fork SQLGetData() will return the
      proper type, while in upstream it will always return a string
      which is tweaked by the TODBC object layer. Fork supports more
      type and UNICODE.
      See also: 2014-07-06 16:40 UTC+0200 Viktor Szakats
      [vszakats]

  * contrib/hbodbc/todbc.prg
    % eliminated unnecessary AAdd() when final array size is already known
    ! do not round numbers read number to default number of decimal places

    ; [REJECTED] Fork has a solution for this, upstream is not a clear
      step forward. [vszakats]

  ; Here's the upstream diff for future reference:
    https://github.com/harbour/core/commit/0bcc223b1494e9bbc74ed61cfa7b2a10ce4e0cb8


Saudações,
Itamar M. Lins Jr.
Avatar de usuário

Itamar M. Lins Jr.
Colaborador

Colaborador
 
Mensagens: 3676
Data de registro: 30 Mai 2007 11:31
Cidade/Estado: Ilheus Bahia
Curtiu: 125 vezes
Mens.Curtidas: 191 vezes

Correção bug ODBC Harbour campos decimais

Mensagempor Itamar M. Lins Jr. » 24 Fev 2015 14:24

Os caras são F****
2015-02-24 17:49 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
  * contrib/sddfb/core.c
  * contrib/sddmy/core.c
  * contrib/sddoci/core.c
  * contrib/sddodbc/core.c
  * contrib/sddpg/core.c
  * contrib/sddsqlt3/core.c
    ! clear dbFieldInfo structure before use - it resolves problems with
      random field flags caused by uninitialized uiFlags member
    * minor cleanup in variable names
    * use hb_xgrabz()

  * contrib/sddodbc/core.c
    + added support for NULLABLE, UNICODE and BINARY field flags
    + added support for SQL_BINARY fields
    ! fixed SQL_TIME mapping to Harbour field types.
      It was mapped as HB_FT_DATE instead of HB_FT_TIME.
    ! fixed extracting integer values on on platforms where long int is
      64 bit integer (in practice all 64bit *nixes). SQL_C_LONG should be
      used with SQLINTEGER not 'long int'.

  * contrib/hbodbc/odbc.c
    + add support for different data types in SQLGetData()
      The original version was returning different types in their binary
      representation. Current implementation is based on similar one from
      Viktor's branch (2014-07-06 16:40 UTC+0200 Viktor Szakats) with
      small but important fixes.
    ! modified hb_odbcNumSetLen() to not break 64bit integers by casting
      to double value

  * contrib/hbodbc/sql.ch
    + added SQL_WCHAR

  * contrib/hbodbc/todbc.prg
    + use extended SQLGetData() and hb_odbcNumSetLen() functionality to
      extract ODBC data
    % few small optimization and casing usually based on Viktor's branch
      BTW pre incrementations/decrementations used in PUSH context are
      faster then post ones.

best regards
Przemek


Saudações,
Itamar M. Lins Jr.
Avatar de usuário

Itamar M. Lins Jr.
Colaborador

Colaborador
 
Mensagens: 3676
Data de registro: 30 Mai 2007 11:31
Cidade/Estado: Ilheus Bahia
Curtiu: 125 vezes
Mens.Curtidas: 191 vezes




Retornar para Banco de Dados

Quem está online

Usuários vendo este fórum: Nenhum usuário registrado online e 1 visitante


Ola Amigo, espero que meu site e forum tem lhe beneficiado, com exemplos e dicas de programacao.
Entao divulgue o link da Doacao abaixo para seus amigos e redes sociais ou faça uma doacao para o site forum...
MUITO OBRIGADO PELA SUA DOACAO!
Faça uma doação para o forum
v
Olá visitante, seja bem-vindo ao Fórum Clipper On Line!
Efetue o seu login ou faça o seu Registro