sql: rename changes() to row_count()
changes() is legacy function which came from SQLite. However, its name is not perfect since it's "number of rows affected", not"number of rows changed". Moreover, to make it real row count, we are nullifying counter representing it in case operation is not accounted for DML or DDL. For example, before this patch behavior was like: INSERT INTO t VALUES (1), (2), (3); START TRANSACTION; SELECT changes(); --- - - [3] ... As one can see, row counter remained unchanged from last INSERT operation. However, now START TRANSACTION set it to 0 and as a consequence row_count() also returns 0. Closes #2181
Showing
- src/box/execute.c 1 addition, 1 deletionsrc/box/execute.c
- src/box/sql/func.c 1 addition, 16 deletionssrc/box/sql/func.c
- src/box/sql/main.c 5 additions, 12 deletionssrc/box/sql/main.c
- src/box/sql/sqliteInt.h 8 additions, 3 deletionssrc/box/sql/sqliteInt.h
- src/box/sql/vdbeaux.c 8 additions, 7 deletionssrc/box/sql/vdbeaux.c
- test/sql/row-count.result 157 additions, 0 deletionstest/sql/row-count.result
- test/sql/row-count.test.lua 55 additions, 0 deletionstest/sql/row-count.test.lua
Loading
Please register or sign in to comment