clueboy / pymssql_issues

0 stars 0 forks source link

Fix a small bug in SP tests #113

Closed clueboy closed 11 years ago

clueboy commented 11 years ago

From cramm0 on February 01, 2013 13:21:23

See patch at https://github.com/ramiro/pymssql/compare/113-fix-SP-tests.patch Regards,

Original issue: http://code.google.com/p/pymssql/issues/detail?id=113

clueboy commented 11 years ago

From msabramo on March 01, 2013 17:46:52

Maybe I'm missing something or maybe something else changed that fixed the problem you saw. It looks like it's creating all of the stored procs to me.

diff --git a/tests/test_sprocs.py b/tests/test_sprocs.py
index 9575269..c1cf65a 100644
--- a/tests/test_sprocs.py
+++ b/tests/test_sprocs.py
@@ -289,6 +289,7 @@ class TestStringTypeConversion(object):
                     'name': name,
                     'identifier': identifier
                 })
+                print('*** Created stored proc: [pymssqlTest%(name)s]' % {'name': name})
             except:
                 if name == 'Text':
                     raise
@@ -296,6 +297,7 @@ class TestStringTypeConversion(object):
     def tearDown(self):
         for name, size in VARIABLE_TYPES:
             self.mssql.execute_non_query('DROP PROCEDURE [dbo].[pymssqlTest%s]' % name)
+            print('*** Deleted stored proc: [pymssqlTest%(name)s]' % {'name': name})
         self.mssql.close()

     def testChar(self):
marca@marca-mac:~/dev/git-repos/pymssql$ .tox/py26/bin/nosetests -s -v tests.test_sprocs:TestStringTypeConversion
tests.test_sprocs.TestStringTypeConversion.testChar ... *** Created stored proc: [pymssqlTestChar]
*** Created stored proc: [pymssqlTestText]
*** Created stored proc: [pymssqlTestVarChar]
*** Deleted stored proc: [pymssqlTestChar]
*** Deleted stored proc: [pymssqlTestText]
*** Deleted stored proc: [pymssqlTestVarChar]
ok
tests.test_sprocs.TestStringTypeConversion.testText ... *** Created stored proc: [pymssqlTestChar]
*** Created stored proc: [pymssqlTestText]
*** Created stored proc: [pymssqlTestVarChar]
*** Deleted stored proc: [pymssqlTestChar]
*** Deleted stored proc: [pymssqlTestText]
*** Deleted stored proc: [pymssqlTestVarChar]
ok
tests.test_sprocs.TestStringTypeConversion.testVarChar ... *** Created stored proc: [pymssqlTestChar]
*** Created stored proc: [pymssqlTestText]
*** Created stored proc: [pymssqlTestVarChar]
*** Deleted stored proc: [pymssqlTestChar]
*** Deleted stored proc: [pymssqlTestText]
*** Deleted stored proc: [pymssqlTestVarChar]
ok

----------------------------------------------------------------------
Ran 3 tests in 0.227s

OK

So it seems like it's doing everything it's supposed to?

(It's kind of weird and slightly inefficient that it creates and deletes all 3 stored procs for all 3 tests -- each test could create and delete just the one it needs -- but that's another issue)

Let me know if you think this patch is still relevant...

clueboy commented 11 years ago

From cramm0 on March 05, 2013 18:46:27

Hmm In tested this a while back using SQL Server 2000.

Only thing I remember is that it failed when trying to create the SP for the TEXT data type and then the except block was executed and the loop over VARIABLE_TYPES aborted, etc.

Could it be that such SQL Sever version didn't support TEXT as an input and/or output stored procedure parameter?

Please feel free to close this issue.

BTW, Which is the minimal supported SQL Server version?

clueboy commented 11 years ago

From msabramo on April 03, 2013 10:32:25

OK, well I don't have SQL Server 2000 so I can't verify that's the cause, but hey, that change is so innocent that I just went ahead and made it so that the TEXT stored proc test runs last like you had it. https://code.google.com/p/pymssql/source/detail?r=101d23ff5710b57b599ffc0ef1171ae5160aebe0 I'll close this issue.

Not sure what the minimal supported SQL Server version is. rsyring might know...

Thanks, Ramiro!

Status: Fixed
Owner: msabramo
Cc: rsyring