Skip to Content.
Sympa Menu

freetds - Re: [freetds] missing divide by zero error

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Adam Baratz <adam.baratz AT gmail.com>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] missing divide by zero error
  • Date: Tue, 11 Oct 2016 14:09:27 -0400

I dug into this issue some more. I had misread the log. There was an info
response with a "Division by zero occurred." message following the result.
My handler ignored it because it came with a severity of 0. The message
number, 3607, came through correctly.

For comparison, I tried this query:

> BEGIN TRY
> SELECT 1/0;
> END TRY
> BEGIN CATCH
> SELECT
> ERROR_NUMBER() AS ErrorNumber,
> ERROR_SEVERITY() AS ErrorSeverity,
> ERROR_STATE() AS ErrorState,
> ERROR_PROCEDURE() AS ErrorProcedure,
> ERROR_LINE() AS ErrorLine,
> ERROR_MESSAGE() AS ErrorMessage;
> END CATCH;


When run in SSMS, it produces two rowsets: one with no columns, one with
error info:

> ErrorNumber ErrorSeverity ErrorState ErrorProcedure ErrorLine ErrorMessage
> 8134 16 1 NULL 2 Divide by zero error encountered.


Interestingly, the message string is different.

When run with my code, it produces two rowsets: one with no columns, one
with a single NULL result.

It doesn't seem like FreeTDS is related to this issue. I'm wondering, more
generally now, if anyone's experienced issues like this, where queries run
over db-library return very different results, and how they've tried to
trap these differences.

Thanks,
Adam




Archive powered by MHonArc 2.6.24.

Top of Page