Rework client-side error logic for hints in updates

parent f8f6585a
...@@ -54,7 +54,7 @@ class Update implements Executable, Explainable ...@@ -54,7 +54,7 @@ class Update implements Executable, Explainable
private static $wireVersionForDocumentLevelValidation = 4; private static $wireVersionForDocumentLevelValidation = 4;
/** @var integer */ /** @var integer */
private static $wireVersionForHint = 8; private static $wireVersionForHintServerSideError = 5;
/** @var string */ /** @var string */
private $databaseName; private $databaseName;
...@@ -202,7 +202,10 @@ class Update implements Executable, Explainable ...@@ -202,7 +202,10 @@ class Update implements Executable, Explainable
throw UnsupportedException::collationNotSupported(); throw UnsupportedException::collationNotSupported();
} }
if (isset($this->options['hint']) && ! server_supports_feature($server, self::$wireVersionForHint)) { /* Server versions >= 3.4.0 raise errors for unknown update
* options. For previous versions, the CRUD spec requires a client-side
* error. */
if (isset($this->options['hint']) && ! server_supports_feature($server, self::$wireVersionForHintServerSideError)) {
throw UnsupportedException::hintNotSupported(); throw UnsupportedException::hintNotSupported();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment