Description:
Hi,
I wanted to create an application with nodejs (with express) and mysql document store.
I have installed the npm @mysql/xdevapi (i discovered after that npm install an 8 version but i am not sure this is the problem in the package.json)
i am using mysql 5.7.17 (i know this is not the last one)
i have one very simple table
mysql> desc users;
+------------+------------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+------------------+------+-----+---------+----------------+
| id | int(10) unsigned | NO | PRI | NULL | auto_increment |
| last_name | varchar(50) | YES | | NULL | |
| first_name | varchar(50) | YES | | NULL | |
| login | varchar(50) | YES | | NULL | |
+------------+------------------+------+-----+---------+----------------+
with 2 values :
mysql> select * from users;
+----+-----------+------------+--------+
| id | last_name | first_name | login |
+----+-----------+------------+--------+
| 1 | Moreau | Nicolas | dellos |
| 2 | Moreau | Nicolas | dellos |
+----+-----------+------------+--------+
note the id...
with nodejs connector (the code is not very good)
this is the result of :
eventsCollection = schema.getTable('users').select();
var test=eventsCollection.execute(function (item) {
console.log(item);
}, function(meta) {
//console.log(meta)
});
the results :
[ -1, 'Moreau', 'Nicolas', 'dellos' ]
[ 1, 'Moreau', 'Nicolas', 'dellos' ]
id is wrong i have no negative value (my insert was done with SQL) and the column is unsigned
this is a big problem, but i may be wrong with the code (i am a dba more than a developer :)
primary key, auto_increment was added later, there is also a foreignkey pointing to id column from another table
If the connector return bad data, this is a big problem
How to repeat:
create table and insert data with the same model
use nodejs connector and sql to compare...
Description: Hi, I wanted to create an application with nodejs (with express) and mysql document store. I have installed the npm @mysql/xdevapi (i discovered after that npm install an 8 version but i am not sure this is the problem in the package.json) i am using mysql 5.7.17 (i know this is not the last one) i have one very simple table mysql> desc users; +------------+------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +------------+------------------+------+-----+---------+----------------+ | id | int(10) unsigned | NO | PRI | NULL | auto_increment | | last_name | varchar(50) | YES | | NULL | | | first_name | varchar(50) | YES | | NULL | | | login | varchar(50) | YES | | NULL | | +------------+------------------+------+-----+---------+----------------+ with 2 values : mysql> select * from users; +----+-----------+------------+--------+ | id | last_name | first_name | login | +----+-----------+------------+--------+ | 1 | Moreau | Nicolas | dellos | | 2 | Moreau | Nicolas | dellos | +----+-----------+------------+--------+ note the id... with nodejs connector (the code is not very good) this is the result of : eventsCollection = schema.getTable('users').select(); var test=eventsCollection.execute(function (item) { console.log(item); }, function(meta) { //console.log(meta) }); the results : [ -1, 'Moreau', 'Nicolas', 'dellos' ] [ 1, 'Moreau', 'Nicolas', 'dellos' ] id is wrong i have no negative value (my insert was done with SQL) and the column is unsigned this is a big problem, but i may be wrong with the code (i am a dba more than a developer :) primary key, auto_increment was added later, there is also a foreignkey pointing to id column from another table If the connector return bad data, this is a big problem How to repeat: create table and insert data with the same model use nodejs connector and sql to compare...