tarantool / tarantool-php

PECL PHP driver for Tarantool
http://tarantool.org/
Other
86 stars 24 forks source link

update and upsert - index_base is different #111

Closed bigbes closed 7 years ago

bigbes commented 7 years ago

PHP version:

PHP 5.6.29-0+deb8u1 (cli) (built: Dec 13 2016 16:02:08)
Copyright (c) 1997-2016 The PHP Group
Zend Engine v2.6.0, Copyright (c) 1998-2016 Zend Technologies
    with Zend OPcache v7.0.6-dev, Copyright (c) 1999-2016, by Zend Technologies

Test case:

<?php
$tarantool = new Tarantool('localhost');

$tarantool->upsert("server",array(1,0,0,0),
        array (
            array(
                "field" => 2,
                "op" => "+",
                "arg" => 1
            ),
            array(
                "field" => 3,
                "op" => "-",
                "arg" => 1
            )
        )
    );
# Expect [1, 0, 0, 0] got [1, 0, 0, 0]

$tarantool->update("server",1,
          array (
            array(
                "field" => 2,
                "op" => "+",
                "arg" => 1
            ),
            array(
                "field" => 3,
                "op" => "-",
                "arg" => 1
            )
        )
    );

# Expect [1, 0, 1, -1] got [1, 0, 1, -1]

$tarantool->upsert("server",array(1,0,0,0),
        array (
            array(
                "field" => 2,
                "op" => "+",
                "arg" => 1
            ),
            array(
                "field" => 3,
                "op" => "-",
                "arg" => 1
            )
        )
    );
# Expect [1, 0, 2, -2] got [1, 1, 0, -1]
?>
begetan commented 7 years ago

The same issue has been discovered in Python connector. May be the issue related to Tarantool itself.

Affected version for PHP connector: Tarantool 1.7.3-132-g5ea0e94 Tarantool 1.7.3-172-g2587f6a

bigbes commented 7 years ago

Fixed (https://github.com/tarantool/tarantool/issues/2059)