Full Unicode/Ansi-Support in /testing branch

The alpha/beta tester's forum for ZeosLib 7.0.x series

Report problems concerning our Delphi 2009+ version and new Zeoslib 7.0 features here.

This is a forum that will be removed once the 7.X version goes into stable!!

Moderators: gto, EgonHugeist, olehs

Locked
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Post by miab3 »

EgonHugeist,

The names of procedures(MSSQL) is probably good, recognizing and returning types of parameters bad as before.
In fact, work properly only:

[dbo].CustOrderHist;1
[dbo].CustOrdersOrders;1

from Northwind Demo.

In ORACLE accuracy is not a problem but the special values.

Michal
olehs
Zeos Dev Team
Zeos Dev Team
Posts: 118
Joined: 09.11.2009, 21:05

Post by olehs »

EgonHugeist,

I saw you added GetOverloadSeparator and SupportsOverloadsInStoredProcedureName to the TZDatabaseInfo interface.

Let me give you some examples so you could think about the way of implementing overloads support (and see why I still didn't do it).

The way you are trying to do it only works with MSSQL, because overload index can be specified there right after a proc name (or can be ommited).
It could be fine with pure MSSQL driver, but miab3 is talking about ADO. I actually don't know how to determine what server we are connected to through Ado provider (it can be PostgreSQL)

Another problem is with quoted names. Let's look at pocedure like
CREATE PROCEDURE [A B T E S T]
In the GetProcedures listing it will appear like
A B T E S T;1
but to call it - you have to use
[A B T E S T];1

And another example
CREATE PROCEDURE [A B T E S T;1]
In the GetProcedures listing it will also appear like
A B T E S T;1
but it has to be call like
[A B T E S T;1] or [A B T E S T;1];1

Now about PostgreSQL.
Pg doesn't use identifiers to specify overloaded functions. It determines function to be used be types of in-parameters passed to it (like Pascal :)).
So a valid identifier would be in format that is passed to DROP FUNCTION, i.e.
set_card_data(character varying, integer, double precision)
or
set_card_data(character varying, integer, double precision, OUT character varying, OUT character varying)

But to accept this syntax from user we will need a separate parser, because
set_card_data(character varying, integer, double precision)
set_card_data(character varying, integer, double precision, OUT character varying, OUT character varying)
set_card_data(VARCHAR, INT4, double precision)
are identifiers of the same overloaded function.

Any ideas?
Oleg
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Post by miab3 »

EgonHugeist,

FLOAT_COMPARE_PRECISION = 1.0e-5;
is correct in every version of Delphi and Lazarus :)

Michal
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

miab3,

yap, that's right. Rev 1796. Also di i remove all defines as much as possible...

Michal, i made a prepareation for the ADO Callable statment. starting @line 502 ZDbcADOStatment.pas. Could you please uncomment this code, comment to TVariant part and test if the reported issue is still present?

olehs,

slightly i got the imression we pushed the big red 'Do not touch me!' 'button. :lol: !
Pg doesn't use identifiers to specify overloaded functions. It determines function to be used be types of in-parameters passed to it (like Pascal Smile).
This is good to know. So i removed PostgreSQL from the databaseinfo list.
Any ideas?
not more then 1795, Oleg. I changed the SupportsOverloadsInStoredProcedureName to SupportsOverloadPrefixInStoredProcedureName and removed the getoverloadseparator funtion.

Now i go this way: if overload prefixes are valid for stored procedure names then DO NOT QUOTE the ObjectName in GetValueList. Nothing prevents a user to do it manually in the PropertyEditor, right?

For the first i settet only the ADO protocol to this list. I have no idea ho other databases do behave for that case. BUT could it be possible that the ADO/ODBC excepts stored procedures with this overload prefix? Could that be a common issue with this protocol? What happens with other servers? IF this is the case then we can reintroduce my improvement (i left the ExtractOverload function there).
[A B T E S T;1] or [A B T E S T;1];1
As far as i understoud the ADO with MsSQL behavior was the Overload allways added. The last case was imlemented.

If this changed design isn't safe too, then whe should remove this IdentifierQuoting again, write some comments to avoid others run into the same issue..

What do you think?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Post by miab3 »

EgonHugeist,

Zeos7_branches_ testing_r1797
http://svn.code.sf.net/p/zeoslib/code-0 ... s/testing/
compiles and runs on (I have tested):

- D2006,
- D2007 -> C++,
- DXE2 32/64 -> C++32,
- Lazarus Win 1.1/fpc 2.7.1 32/64,
- Lazarus Lin 1.1/fpc 2.7.1 64 on Debian 64-bit (LMDE 201204).

Michal
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

miab3,

Thank you, Michal.

May i point you to this again:
Michal, i made a prepareation for the ADO Callable statment. starting @line 502 ZDbcADOStatment.pas. Could you please uncomment this code, comment to TVariant part and test if the reported issue is still present?
I have still no ADO running...
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Post by miab3 »

EgonHugeist,

It did not change anything.

The messages I got when compiling:
[DCC Warning] ZDbcAdoStatement.pas(514): W1057 Implicit string cast from 'AnsiString' to 'string'
[DCC Hint] ZDbcAdoStatement.pas(491): H2164 Variable 'Stream' is declared but never used in 'TZAdoCallableStatement.GetOutParam'

Michal
Last edited by miab3 on 14.09.2012, 14:47, edited 1 time in total.
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Post by miab3 »

EgonHugeist,

Do you really need the override in file ZAbstractRODataset.pas line 327:

Code: Select all

{$IFDEF WITH_TRECORDBUFFER}
    procedure ClearCalcFields(Buffer: TRecordBuffer); // M.A. override;
{$ELSE}
    procedure ClearCalcFields(Buffer: PChar);override;
{$ENDIF}
Michal
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

miab3,

Question: What is the effect of this patch? overriding virtual defined procedure is a clean code otherwise we got a compiler-warning...

Code: Select all

The messages I got when compiling:
[DCC Warning] ZDbcAdoStatement.pas(514): W1057 Implicit string cast from 'AnsiString' to 'string'
[DCC Hint] ZDbcAdoStatement.pas(491): H2164 Variable 'Stream' is declared but never used in 'TZAdoCallableStatement.GetOutParam'
yes these warnings are right! stream could be removed, but then the binaries are added....
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Post by miab3 »

EgonHugeist,

I wrote, any changes.
In the same situations the same erroneous behavior.

Michal
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

miab3,

Got now an ADO Server running and i use the 'ABTEST' procedure.

Found and fixed several issues. Also can i confirm the string returning issue after a second execution...
I played a while, but i've no solution. The out integer values are right. Also are the strings not trunced (i thought before). Actually i can't say what's wrong....

Michael did you test the procedure with another component/app+ADO then Zeos?
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Post by miab3 »

EgonHugeist,

Zeos7_branches_ testing_r1828
http://svn.code.sf.net/p/zeoslib/code-0 ... s/testing/
compiles and runs on (I have tested):

- D2006,
- D2007 -> C++,
- DXE2 32/64 -> C++32,
- Lazarus Win 1.1/fpc 2.7.1 32/64,
- Lazarus Lin 1.1/fpc 2.7.1 64 on Debian 64-bit (LMDE 201204).

Michal
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Post by miab3 »

EgonHugeist, olehs,

I think I explained why PostgreSQL is so heavy.
6.X (7.x) does not support Cursor Fetch.
http://grokbase.com/p/postgresql/pgsql- ... or-gui-rad
A Zeos 5.5 so.

It is found in ZDirPgSql.pas in 5.5

Code: Select all

procedure TDirPgSqlQuery.Open;
var
  Temp: string;
begin
  inherited Open;
  SetStatus(qsFail);
  FLastInsertOid := 0;
  if not Assigned(Connect) then
    DatabaseError(SConnectNotDefined);
  if not Assigned(Transact) then
    DatabaseError(STransactNotDefined);
  if not (Connect.Active and Transact.Active) then
    Exit;

  { If it's a select query in Cursor mode, declare a new cursor }
  FCursorName := '';
  if UseCursor then
  begin
    Temp := Sql;
    if StrCaseCmp(StrTok(Temp, ' '#9#13#10), 'SELECT') then
      FCursorName := 'ZeosCursor_' + CursorGenerator;
  end;

  if FCursorName <> '' then
  begin
    Temp := ClearSpaces(Format('DECLARE %s CURSOR FOR %s', [FCursorName, Trim(Sql)]));
    FHandle := PQexec(TDirPgSqlTransact(Transact).Handle, PChar(Temp));
    MonitorList.InvokeEvent(Temp, Transact.Error, not Active);

    Temp := Format('FETCH FORWARD 1 FROM %s', [FCursorName]);
    FHandle := PQexec(TDirPgSqlTransact(Transact).Handle, PChar(Temp));
    MonitorList.InvokeEvent(Temp, Transact.Error, not Active);
  end
  else
  begin
    FHandle := PQexec(TDirPgSqlTransact(Transact).Handle,
      PChar(ClearSpaces(Trim(Sql))));
  end;

  if Assigned(FHandle) then
  begin
    if Transact.Error = '' then
    begin
      SetActive(True);
      SetStatus(qsTuplesOk);
      inherited First;
    end
    else
    begin
      PQclear(FHandle);
      FHandle := nil;
    end;
  end;
  MonitorList.InvokeEvent(Sql, Transact.Error, not Active);
end;
Michal
User avatar
EgonHugeist
Zeos Project Manager
Zeos Project Manager
Posts: 1936
Joined: 31.03.2011, 22:38

Post by EgonHugeist »

miab3,

Where did you get the code from? It might be a nice proposal for Oleg..

Michal, i got a free Sybase SQL Anywhere 12 running and fixed the most issues of the ASA protocol. You can test this server too if you doubt.

Added protocol 'ASA12'
Best regards, Michael

You want to help? http://zeoslib.sourceforge.net/viewtopic.php?f=4&t=3671
You found a (possible) bug? Use the new bugtracker dude! http://sourceforge.net/p/zeoslib/tickets/

Image
miab3
Zeos Test Team
Zeos Test Team
Posts: 1310
Joined: 11.05.2012, 12:32
Location: Poland

Post by miab3 »

EgonHugeist,

ZEOS 5.5? from:
http://sourceforge.net/projects/zeoslib ... .0-stable/

How to take a free trial version of SQL Anywhere 12?

Michal
Locked