When Update to 0.32.1 with Data View Problem on SQL Server

System : Win 10,Java 1.8
Data On SQL Server 2008

When I update the metabase from 0.31 to 0.32.1, the data on the view is lost!
And the sql code and server source is the same!
It’s so STRANGE!!

ON v0.31

ON v0.32.1

ON SQL Server Client

Is that due to the timezone problems? Could the new answer be correct? What answer do you get when you run in SSMS?

I had config the timeozne on METABASE,but the time param in sql is just a fact of SQLServer

the last picture is on SSMS

Sorry, didn’t realise it was SSMS. My old eyes aren’t keen on white on black!
Can you see the SQL that’s being run on SQL server by Metabase. My money’s still on a timezone issue. Not my greatest strength as I have the luxury of GMT.

I use the tool SQL Server Profiler to check the code run from Metabase on SQLServer,the result is the same

Change the query so that instead of running the SELECT, it just returns the text that would have been the SELECT.

Sorry,I do not understand what you mean!

Could this be caused by something from https://github.com/metabase/metabase/issues/8326 ?
It shouldn’t be an issue, if the timezones are set correctly, but it’s one of the few SQL driver changes in 0.32.

Hopefully @flamber has pointed you in the right direction, but what I’m asking for is the last line to be changed to something that returns the text of the query rather than the result.
For example, instead of
SELECT A FROM B
I need
SELECT 'SELECT A FROM B'
more fiddly for you as you need to make the variable values work too.

Thanks! may be is not the point!
I do not use the function getdate(), just use the constant like ‘20190401’,the problem still exists !

I found a point,maybe that is it
the data lines limit 2000, on v0.31 has not this limit.
Has there any param config about connect to SQLServer about the lines?


Can I config it in someware?

@BelleChang
There has always been a limit on row count, since the beginning of Metabase.
Are you sure this is a new problem in 0.32.1 compared to 0.31.2?

Yes!I test that. Because, the questions may use the same session.

I cannot replicate your problem on SQL2008R2 - by executing a table function that has millions of records, but only return a sum.
And I don’t understand the “same session”, since running 0.31.2 and 0.32.1 would be different connections and sessions to the SQL server.

And this “SET ROWCOUNT 2000” enable the session scope. If I do something else for cache or other intermediate result set,the results alse be limited.

My old version is 0.31.0 not 0.31.2,sorry about that!


MY TEST PROCEDURE

Okay, that actually makes a difference. There was a specific change 0.31.1, which added a limit for any non-top-level queries.
https://github.com/metabase/metabase/blob/b913f5f70d8103d80255ccfcc2e09ae502c08220/src/metabase/driver/sqlserver.clj#L159-L169