Signed-off-by: Alistair Leslie-Hughes leslie_alistair@hotmail.com --- dlls/msdasql/session.c | 2 +- dlls/msdasql/tests/provider.c | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/msdasql/session.c b/dlls/msdasql/session.c index 3829f8f946f..196fd1c6b81 100644 --- a/dlls/msdasql/session.c +++ b/dlls/msdasql/session.c @@ -910,7 +910,7 @@ static HRESULT WINAPI command_GetCommandText(ICommandText *iface, GUID *dialect, if (!command->query) return DB_E_NOCOMMAND;
- if (!IsEqualGUID(&DBGUID_DEFAULT, dialect)) + if (dialect && !IsEqualGUID(&DBGUID_DEFAULT, dialect)) { *dialect = DBGUID_DEFAULT; hr = DB_S_DIALECTIGNORED; diff --git a/dlls/msdasql/tests/provider.c b/dlls/msdasql/tests/provider.c index 37230be04cb..a0b11194f2b 100644 --- a/dlls/msdasql/tests/provider.c +++ b/dlls/msdasql/tests/provider.c @@ -265,6 +265,12 @@ if (0) hr = ICommandText_SetCommandText(comand_text, &DBGUID_DEFAULT, L"select * from testing"); ok(hr == S_OK, "got 0x%08x\n", hr);
+ + hr = ICommandText_GetCommandText(comand_text, NULL, &str); + ok(hr == S_OK, "got 0x%08x\n", hr); + ok (!lstrcmpW(L"select * from testing", str), "got %s\n", debugstr_w(str)); + HeapFree(GetProcessHeap(), 0, str); + /* dialect empty value */ hr = ICommandText_GetCommandText(comand_text, &dialect, &str); ok(hr == DB_S_DIALECTIGNORED, "got 0x%08x\n", hr);