<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
<div dir="auto">Hi Nikolay, </div>
<div dir="auto">you made same points as I thought about.</div>
<div dir="auto">Maybe some registry anchored regex replace mechanism could be implemented, so there's something if needed. As I think you're likely right that this is at least partially related to the individual drivers. In my case the provided patch enables
 running the NonStop crosscompilers using wine for sources with embedded SQL MX. Requiring odbc for preprocessing. </div>
<div dir="auto"><br>
</div>
<div dir="auto">Regards,</div>
<div dir="auto">Florian </div>
<div><br>
</div>
<div id="ms-outlook-mobile-signature" dir="auto">--<br>
Mit freundlichen Gr��en / With kind regards<br>
Florian Manschwetus<br>
 <br>
E-Mail: manschwetus@cs-software-gmbh.de<br>
Tel.: +49-(0)611-8908534<br>
 <br>
CS Software Concepts and Solutions GmbH<br>
Gesch�ftsf�hrer / Managing director: Dr. Werner Alexi<br>
Amtsgericht Wiesbaden HRB 10004 (Commercial registry)<br>
Schiersteiner Stra�e 31<br>
D-65187 Wiesbaden<br>
Germany<br>
Tel.: 0611/8908555<br>
</div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Nikolay Sivov <nsivov@codeweavers.com><br>
<b>Sent:</b> Saturday, April 2, 2022 12:23:39 PM<br>
<b>To:</b> wine-devel@winehq.org <wine-devel@winehq.org><br>
<b>Cc:</b> manschwetus@cs-software-gmbh.de <manschwetus@cs-software-gmbh.de><br>
<b>Subject:</b> Re: [PATCH] Replace / with : in ConnectionString</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText"><br>
<br>
On 3/31/22 21:05, Florian Manschwetus wrote:<br>
> From: manschwetusCS <30724946+manschwetusCS@users.noreply.github.com><br>
><br>
> In Windows ODBC it seems to be legal to use "host/port", which is not legal with Linux ODBC.<br>
> This patch aims to find and replace such in the ConnectionString<br>
<br>
Hi, Florian.<br>
<br>
Thanks for the patch. I have a few comments.<br>
<br>
> @@ -1779,10 +1779,21 @@ SQLRETURN WINAPI SQLDriverConnect(SQLHDBC hdbc, SQLHWND hwnd, SQLCHAR *Connectio<br>
>                                     SQLCHAR *conn_str_out, SQLSMALLINT conn_str_out_max,<br>
>                                     SQLSMALLINT *ptr_conn_str_out, SQLUSMALLINT driver_completion)<br>
>   {<br>
> +    static const char *serverStr="SERVER=";<br>
>       struct SQLDriverConnect_params params = { hdbc, hwnd, ConnectionString, Length, conn_str_out,<br>
>                                                 conn_str_out_max, ptr_conn_str_out, driver_completion };<br>
>       SQLRETURN ret;<br>
><br>
> +    SQLCHAR *serverPos;<br>
> +    for (serverPos = strstr(ConnectionString,serverStr);(*serverPos != ';') && (*serverPos != '\0'); ++serverPos)<br>
> +    {<br>
> +        if (*serverPos == '/')<br>
> +        {<br>
> +           *serverPos = ':';<br>
> +           break;<br>
> +        }<br>
> +    }<br>
> +<br>
<br>
My understanding is that connection string attributes have to be passed <br>
as is to underlying driver/unixodbc proxy. If server port syntax differs <br>
between implementations, does that mean different drivers have different <br>
syntax? If that's the case I don't think you can swap one for another <br>
like that. For example I see some examples for SQL Server that are using <br>
"host,port" syntax instead.<br>
<br>
So this needs to be investigated across drivers on Windows and unixodbc <br>
to see what needs to happen exactly. Depending on syntax requirements, <br>
it's possible we need to change it only for some drivers, or maybe <br>
drivers need to be fixed.<br>
<br>
If it turns out we do need to modify connection string, cleaner way is <br>
to tokenize it fully first, then tweak parts that need tweaking, and <br>
assemble it back. In your fix you're changing original connection <br>
string, which sounds incorrect. Another thing is that attribute names <br>
are case insensitive afaik, so comparison you're using is too strict.<br>
<br>
</div>
</span></font></div>
<small>If you received this email in error, please advise the sender (by return email or otherwise) immediately.</small>
</body>
</html>