accessor for database delimiter
[lhc/web/wiklou.git] / includes / db / Database.php
index a942afe..db050f2 100644 (file)
@@ -290,6 +290,13 @@ abstract class DatabaseBase implements DatabaseType {
                return $this->getServerVersion();
        }
 
+       /**
+        * @return string: command delimiter used by this database engine
+        */
+       public function getDelimiter() {
+               return $this->delimiter;
+       }
+
        /**
         * Boolean, controls output of large amounts of debug information.
         * @param $debug bool|null
@@ -1800,7 +1807,7 @@ abstract class DatabaseBase implements DatabaseType {
                                $list .= "$value";
                        } elseif ( ( $mode == LIST_AND || $mode == LIST_OR ) && is_array( $value ) ) {
                                if ( count( $value ) == 0 ) {
-                                       throw new MWException( __METHOD__ . ': empty input' );
+                                       throw new MWException( __METHOD__ . ": empty input for field $field" );
                                } elseif ( count( $value ) == 1 ) {
                                        // Special-case single values, as IN isn't terribly efficient
                                        // Don't necessarily assume the single key is 0; we don't
@@ -2992,6 +2999,12 @@ abstract class DatabaseBase implements DatabaseType {
                        } elseif( $this->mTrxAutomatic ) {
                                wfWarn( "$fname: Explicit commit of implicit transaction. Something may be out of sync!" );
                        }
+               } else {
+                       if ( !$this->mTrxLevel ) {
+                               return; // nothing to do
+                       } elseif( !$this->mTrxAutomatic ) {
+                               wfWarn( "$fname: Flushing an explicit transaction, getting out of sync!" );
+                       }
                }
 
                $this->doCommit( $fname );