Index: wvdbi.cs
===================================================================
--- wvdbi.cs (revision 11823)
+++ wvdbi.cs (working copy)
@@ -19,7 +19,7 @@
{
StringDictionary sect = settings[odbcstr];
- string s =
wv.fmt("driver={{{0}}};server={1};database={2};"
+ string s =
wv.fmt("driver={0};server={1};database={2};"
+ "uid={3};pwd={4};",
sect["driver"], sect["server"],
sect["database"],
So, was that an actual bug or am I insane? Because that looks like a
rather specific thing to be an actual bug...
In .net format strings, {{ is reduced to a single { and }} is reduced
to a single }. Thus, if {0} is foo, then {{{0}}} is {foo}. It
appears that putting braces around the driver string is the way to
escape spaces, punctuation, etc. At least, at the time, that was the
only way to make it work.
That said, it might be an odbc-version-specific thing, a
mysql-specific thing, or a mono-version-specific thing. I just found
it by doing a lot of web searches at the time.
If your driver string in odbcinst.ini (I think) has no fancy
characters, it'll work without the extra braces, but you might have
broken behaviour with the "default" mysql driver name string of "MySQL
blah blah vblah.blah" or whatever it is. On the other hand, it's
annoying that it doesn't work reliably for you with the braces.
What version of mono are you using? What database type?
Have fun,
Avery
> In .net format strings, {{ is reduced to a single { and }} is reduced
> to a single }. Thus, if {0} is foo, then {{{0}}} is {foo}.
That much I had figured out.
> It appears that putting braces around the driver string is the way to
> escape spaces, punctuation, etc. At least, at the time, that was the
> only way to make it work.
That, on the other hand, doesn't seem to be true on my box...
> If your driver string in odbcinst.ini (I think) has no fancy
> characters, it'll work without the extra braces, but you might have
> broken behaviour with the "default" mysql driver name string of "MySQL
> blah blah vblah.blah" or whatever it is. On the other hand, it's
> annoying that it doesn't work reliably for you with the braces.
>
> What version of mono are you using? What database type?
I'm using Ubuntu "feisty", with everything coming from them (it's on
my desktop machine at home, which is not accessible to me at the
moment, sorry). I'm using MySQL, for which I installed the libmyodbc
package. I remember using /usr/share/libmyodbc/odbcinst.ini as the
"template file" parameter when invoking odbcinst (of note, other ODBC
driver packages on Ubuntu ran this automatically in their post-install
script, but not this one!?!). The driver name in there was just
"MySQL" (no quotes).
The mono package version is 1.2.3.1-1ubuntu1.
I would have liked to use SQLite, actually, but I figured I'd go with
MySQL first, guessing it was probably better tested...
Okay, well your system seems more sensible than mine, so feel free to
check in the fix.
The Debian/Ubuntu odbc setup stuff is a big pile of crap, so no
surprise that it didn't so anything sensible. Kind of funny that ODBC
actually *works* quite well in Unix, but setting it up (which is
technically the easy part) is such a total nightmare.
Have fun,
Avery
> Okay, well your system seems more sensible than mine, so feel free to
> check in the fix.
I guess that it's easier to add the braces in the .sched file than to
edit the source code to take them out...
Also very true. Or in wvodbc.ini (the recommended approach) for that matter.
Avery
> > I guess that it's easier to add the braces in the .sched file than to
> > edit the source code to take them out...
>
> Also very true. Or in wvodbc.ini (the recommended approach) for that matter.
Oh, yes, that's what I meant, actually.