[SOVLED] Mysql inccorect results?

Hello everyone !

I have a pretty weird problem. I use the server-side “pcel:mysql” package.
When I run my SQL query, I get data with an unexpected result, while when I run the same query on PhpMyAdmin, I get the right results!

I don’t understand what the problem is. I followed some topics like: Nested Function Return Values, Where I am wrong in this code?
which speak of aynschrone query, I used meteor wrap and fibers but without any correct result !

Here is my server side test query :

Meteor.methods({
    'test':  function(){

        // use the node fibers npm
        let Future = require('fibers/future');

        // make some new future
        let fut =  new Future();

         sql.query('SELECT H.ref AS href, H.jour AS hjour, H.fiable AS fiable, H.htd AS hhtd, H.had AS hhad, H.hta AS hhta, A.mnemol AS numeroArret, A.nom AS nomArret, L.mnemoCom AS numeroVehicule, D.nom AS nomDestination, D.sens AS sens FROM HORAIRE H INNER JOIN ARRETCHN AC ON H.arretchn=AC.ref INNER JOIN ARRET A ON AC.arret=A.ref INNER JOIN COURSE CS ON H.course=CS.ref INNER JOIN CHAINAGE C ON AC.chainage=C.ref INNER JOIN LIGNE L ON C.ligne=L.ref INNER JOIN DEST D ON C.dest=D.ref AND C.dest=D.ref WHERE A.mnemol=648 AND H.jour="2018-06-30" AND CS.type="C" AND C.type="C" AND A.nom<>D.nom AND D.nom<>"SANS VOYAGEURS" AND D.nom NOT LIKE "ESSAIS%" AND D.sens=C.sens GROUP BY H.ref, H.jour ORDER BY H.ref ASC LIMIT 5', function(err, rows, fields) {
            if (err) throw err;
             console.log(rows);

            // when this callback eventually happen, returns rows
             fut.return(rows);
        });

        // wait for something from the future
        return fut.wait();
    }

});

Meteor.call('test');

Result :

[ RowDataPacket {  
href: 1152921504606849300,
hjour: 2018-06-30T00:00:00.000Z,
fiable: 'T',
hhtd: '05:47:51',
hhad: '05:47:51',
hhta: '05:47:51',
numeroArret: '648',
nomArret: 'TARN',
numeroVehicule: '10',
nomDestination: 'GARE CENTRALE',
sens: 'R' },

RowDataPacket {
href: 1152921504606849500,
hjour: 2018-06-30T00:00:00.000Z,
fiable: 'T',
hhtd: '07:25:08',
hhad: '07:25:08',
hhta: '07:25:08',
numeroArret: '648',
nomArret: 'TARN',
numeroVehicule: '10',
nomDestination: 'GARE CENTRALE',
sens: 'R' },

RowDataPacket {
href: 1152921504606849500,
hjour: 2018-06-30T00:00:00.000Z,
fiable: 'T',
hhtd: '09:12:08',
hhad: '09:12:08',
hhta: '09:12:08',
numeroArret: '648',
nomArret: 'TARN',
numeroVehicule: '10',
nomDestination: 'GARE CENTRALE',
sens: 'R' },

RowDataPacket {
href: 1152921504606849500,
hjour: 2018-06-30T00:00:00.000Z,
iable: 'T',
hhtd: '10:57:08',
hhad: '10:57:08',
hhta: '10:57:08',
numeroArret: '648',
nomArret: 'TARN',
numeroVehicule: '10',
nomDestination: 'GARE CENTRALE',
sens: 'R' },

RowDataPacket {
href: 1152921504606849500,
hjour: 2018-06-30T00:00:00.000Z,
fiable: 'T',
hhtd: '12:42:08',
hhad: '12:42:08',
hhta: '12:42:08',
numeroArret: '648',
nomArret: 'TARN',
numeroVehicule: '10',
nomDestination: 'GARE CENTRALE',
sens: 'R' } ]

And same query in PhpMyAdmin (correct data) :

{"href":"1152921504606849386",
"hjour":"2018-06-30",
"fiable":"T",
"hhtd":"05:47:51",
"hhad":"05:47:51",
"hhta":"05:47:51",
"numeroArret":"648",
"nomArret":"TARN",
"numeroVehicule":"10",
"nomDestination":"GARE CENTRALE",
"sens":"R"}, 

{"href":"1152921504606849452",
"hjour":"2018-06-30",
"fiable":"T",
"hhtd":"07:25:08",
"hhad":"07:25:08",
"hhta":"07:25:08",
"numeroArret":"648",
"nomArret":"TARN",
"numeroVehicule":"10",
"nomDestination":"GARE CENTRALE",
"sens":"R"}, 

{"href":"1152921504606849518",
"hjour":"2018-06-30",
"fiable":"T",
"hhtd":"09:12:08",
"hhad":"09:12:08",
"hhta":"09:12:08",
"numeroArret":"648",
"nomArret":"TARN",
"numeroVehicule":"10",
"nomDestination":"GARE CENTRALE",
"sens":"R"}, 

{"href":"1152921504606849584",
"hjour":"2018-06-30",
"fiable":"T",
"hhtd":"10:57:08",
"hhad":"10:57:08",
"hhta":"10:57:08",
"numeroArret":"648",
"nomArret":"TARN",
"numeroVehicule":"10",
"nomDestination":"GARE CENTRALE",
"sens":"R"}, 
{"href":"1152921504606849650",
"hjour":"2018-06-30",
"fiable":"T",
"hhtd":"12:42:08",
"hhad":"12:42:08",
"hhta":"12:42:08",
"numeroArret":"648",
"nomArret":"TARN",
"numeroVehicule":"10",
"nomDestination":"GARE CENTRALE",
"sens":"R"}

As you can see, the only difference is on the column “href” !
Do you have any idea why?
On phpmyAdmin I have the right data with the same sql query :frowning:

Thank you for your help.

OK solved.
In the connection options, simply add :
supportBigNumbers: true <3

1 Like