USE `mysql` fails when Unidirectional?

Discussion of open issues, suggestions and bugs regarding MyDAC (Data Access Components for MySQL) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
upscene

USE `mysql` fails when Unidirectional?

Post by upscene » Mon 02 Jan 2006 11:22

Hi there,

I'm executing these (separately) in sequence:
use `mysql`
select * from user

on a connection WITHOUT selecting a database and execute them in a TMyQuery component.

If Unidirectional and ReadOnly are FALSE, this works fine. However, when these are TRUE, it fails with:

#3D000No database selected


Any idea why?

--
Martijn Tonies
Upscene Productions

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Wed 04 Jan 2006 10:32

MyDAC automatically sets FetchAll to False after setting Unidirectional to True. To execute FetchAll = False statements MyDAC creates additional connections. As a result, for executing SELECT and USE statements two different connections to server are used.

upscene

Post by upscene » Wed 04 Jan 2006 10:35

But apparently only when executing a SELECT, cause the USE statement is executed in the primary connection??

--
Martijn Tonies
Upscene Productions

Ikar
Posts: 1693
Joined: Thu 28 Oct 2004 13:56

Post by Ikar » Wed 04 Jan 2006 14:39

Currently MyDAC doesn't use complicated algorithms to analyze necessity of creating additional connections. Now we do not have in plans to improve this behavior.

Post Reply