[BUGFIX] ADOdb: mssqlnative driver fails to create sequences 75/39075/2
authorXavier Perseguers <xavier@typo3.org>
Thu, 30 Apr 2015 09:56:29 +0000 (11:56 +0200)
committerXavier Perseguers <xavier@typo3.org>
Thu, 30 Apr 2015 13:06:19 +0000 (15:06 +0200)
Change-Id: Ie251d2b9776be4d7c8d3a450cfa1252a57ce07a3
Resolves: #66678
Releases: master, 6.2
Reviewed-on: http://review.typo3.org/39075
Reviewed-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Tested-by: Andreas Fernandez <andreas.fernandez@aspedia.de>
Reviewed-by: Xavier Perseguers <xavier@typo3.org>
Tested-by: Xavier Perseguers <xavier@typo3.org>
typo3/sysext/adodb/Documentation/Index.rst
typo3/sysext/adodb/Documentation/typo3-adodb.diff
typo3/sysext/adodb/adodb/drivers/adodb-mssqlnative.inc.php

index fbd1478..7a4a975 100644 (file)
@@ -19,12 +19,14 @@ updated to upstream.
 - ADOdb: Set charset properly (61738_)
 - EXT:adodb: Table names in ALTER TABLE broken (63659_)
 - MSSQL native driver for ADOdb returns erroneous message (66674_)
+- ADOdb: mssqlnative driver fails to create sequences (66678_)
 
 .. [2] https://github.com/ADOdb/ADOdb/commit/85f05a98974ea85ecae943faf230a27afdbaa746
 .. _48034: https://forge.typo3.org/issues/48034
 .. _61738: https://forge.typo3.org/issues/61738
 .. _63659: https://forge.typo3.org/issues/63659
 .. _66674: https://forge.typo3.org/issues/66674
+.. _66678: https://forge.typo3.org/issues/66678
 
 
 Diff
index b41b529..8bff9bc 100644 (file)
@@ -210,6 +210,52 @@ diff --git a/drivers/adodb-mssqlnative.inc.php b/drivers/adodb-mssqlnative.inc.p
 index b10d555..21cfc69 100644
 --- a/drivers/adodb-mssqlnative.inc.php
 +++ b/drivers/adodb-mssqlnative.inc.php
+@@ -209,10 +209,10 @@ class ADODB_mssqlnative extends ADOConnection {
+               switch($this->mssql_version){
+               case 9:
+               case 10:
+-                      return $this->GenID2008();
++                      return $this->GenID2008($seq, $start);
+                       break;
+               case 11:
+-                      return $this->GenID2012();
++                      return $this->GenID2012($seq, $start);
+                       break;
+               }
+       }
+@@ -225,10 +225,10 @@ class ADODB_mssqlnative extends ADOConnection {
+               switch($this->mssql_version){
+               case 9:
+               case 10:
+-                      return $this->CreateSequence2008();
++                      return $this->CreateSequence2008($seq, $start);
+                       break;
+               case 11:
+-                      return $this->CreateSequence2012();
++                      return $this->CreateSequence2012($seq, $start);
+                       break;
+               }
+@@ -287,7 +287,7 @@ class ADODB_mssqlnative extends ADOConnection {
+               }
+               $num = $this->GetOne("select id from $seq");
+               sqlsrv_commit($this->_connectionID);
+-              return true;
++              return $num;
+       }
+       /**
+        * Only available to Server 2012 and up
+
+@@ -311,7 +311,7 @@ class ADODB_mssqlnative extends ADOConnection {
+               }
+               if (!is_array($this->sequences)
+               || is_array($this->sequences) && !in_array($seq,$this->sequences)){
+-                      $this->CreateSequence2012($seq='adodbseq',$start=1);
++                      $this->CreateSequence2012($seq, $start);
+               }
+               $num = $this->GetOne("SELECT NEXT VALUE FOR $seq");
+
 @@ -459,7 +459,7 @@ class ADODB_mssqlnative extends ADOConnection {
                                $this->_errorMsg .= "Message: ".$arrError[ 'message']."\n";
                        }
@@ -219,3 +265,4 @@ index b10d555..21cfc69 100644
                }
                return $this->_errorMsg;
        }
+
index 21cfc69..8de4844 100644 (file)
@@ -209,10 +209,10 @@ class ADODB_mssqlnative extends ADOConnection {
                switch($this->mssql_version){
                case 9:
                case 10:
-                       return $this->GenID2008();
+                       return $this->GenID2008($seq, $start);
                        break;
                case 11:
-                       return $this->GenID2012();
+                       return $this->GenID2012($seq, $start);
                        break;
                }
        }
@@ -225,10 +225,10 @@ class ADODB_mssqlnative extends ADOConnection {
                switch($this->mssql_version){
                case 9:
                case 10:
-                       return $this->CreateSequence2008();
+                       return $this->CreateSequence2008($seq, $start);
                        break;
                case 11:
-                       return $this->CreateSequence2012();
+                       return $this->CreateSequence2012($seq, $start);
                        break;
                }
 
@@ -287,7 +287,7 @@ class ADODB_mssqlnative extends ADOConnection {
                }
                $num = $this->GetOne("select id from $seq");
                sqlsrv_commit($this->_connectionID);
-               return true;
+               return $num;
        }
        /**
         * Only available to Server 2012 and up
@@ -311,7 +311,7 @@ class ADODB_mssqlnative extends ADOConnection {
                }
                if (!is_array($this->sequences)
                || is_array($this->sequences) && !in_array($seq,$this->sequences)){
-                       $this->CreateSequence2012($seq='adodbseq',$start=1);
+                       $this->CreateSequence2012($seq, $start);
 
                }
                $num = $this->GetOne("SELECT NEXT VALUE FOR $seq");