Recalling long keyfield_value gives unexpected results

classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

Recalling long keyfield_value gives unexpected results

Ari Denison
I'm working with Lasso 9.2.6 on CentOS Linux 6.4 64 bit kernel

I have table with 10 digit values for the unique key field. For example: 3763825371

When I insert a new record into this table, by any means (sql statement, classic inline) the returned keyfield_value returns something like -531141926.

On the next insert it change by one and will return -531141925

How can I work around this? Are keyfield_values limited to 9 characters?

Many thanks!
Ari

#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Recalling long keyfield_value gives unexpected results

Marc Vos
Hi Ari,

I suppose you're talking MySQL.
Check if the 'unsigned'-bit is on for that column.

- -
Regards,
Marc


On 14 aug. 2013, at 09:25, Ari Denison <[hidden email]> wrote:

> I'm working with Lasso 9.2.6 on CentOS Linux 6.4 64 bit kernel
>
> I have table with 10 digit values for the unique key field. For example: 3763825371
>
> When I insert a new record into this table, by any means (sql statement, classic inline) the returned keyfield_value returns something like -531141926.
>
> On the next insert it change by one and will return -531141925
>
> How can I work around this? Are keyfield_values limited to 9 characters?
>
> Many thanks!
> Ari
>
> #############################################################
>
> Attend the Lasso Developer Conference 2013!
> Sept 12-14, 2013 in Niagara Falls, Canada
> http://www.lassosoft.com/LDC-niagara-falls-2013
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Recalling long keyfield_value gives unexpected results

Ari Denison
Yes, MySQL

Please forgive the formatting. This is what I can determine about the id field in question.

Looks like just a bigint(20) with auto_increment set
+--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
| Field                    | Type                                                                                                                              | Null | Key | Default             | Extra          |
+--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+

| id                       | bigint(20)                                                                                                                        | NO   | PRI | NULL                | auto_increment |

On Aug 14, 2013, at 2:36 AM, Marc Vos <[hidden email]> wrote:

Hi Ari,

I suppose you're talking MySQL.
Check if the 'unsigned'-bit is on for that column.

- -
Regards,
Marc


On 14 aug. 2013, at 09:25, Ari Denison <[hidden email]> wrote:

> I'm working with Lasso 9.2.6 on CentOS Linux 6.4 64 bit kernel
>
> I have table with 10 digit values for the unique key field. For example: 3763825371
>
> When I insert a new record into this table, by any means (sql statement, classic inline) the returned keyfield_value returns something like -531141926.
>
> On the next insert it change by one and will return -531141925
>
> How can I work around this? Are keyfield_values limited to 9 characters?
>
> Many thanks!
> Ari
>
> #############################################################
>
> Attend the Lasso Developer Conference 2013!
> Sept 12-14, 2013 in Niagara Falls, Canada
> http://www.lassosoft.com/LDC-niagara-falls-2013
>
> #############################################################
> This message is sent to you because you are subscribed to
> the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
 the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>


#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Recalling long keyfield_value gives unexpected results

Ari Denison
In reply to this post by Marc Vos
I forgot to mention. This happens only on -add/insert.
-update works just fine and returns the proper and correct keyfield_value.


On Aug 14, 2013, at 2:36 AM, Marc Vos <[hidden email]> wrote:

Hi Ari,

I suppose you're talking MySQL.
Check if the 'unsigned'-bit is on for that column.

- -
Regards,
Marc


On 14 aug. 2013, at 09:25, Ari Denison <[hidden email]> wrote:

> I'm working with Lasso 9.2.6 on CentOS Linux 6.4 64 bit kernel
>
> I have table with 10 digit values for the unique key field. For example: 3763825371
>
> When I insert a new record into this table, by any means (sql statement, classic inline) the returned keyfield_value returns something like -531141926.
>
> On the next insert it change by one and will return -531141925
>
> How can I work around this? Are keyfield_values limited to 9 characters?
>
> Many thanks!
> Ari
>
> #############################################################
>
> Attend the Lasso Developer Conference 2013!
> Sept 12-14, 2013 in Niagara Falls, Canada
> http://www.lassosoft.com/LDC-niagara-falls-2013
>
> #############################################################
> This message is sent to you because you are subscribed to
> the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
 the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>


#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Recalling long keyfield_value gives unexpected results

Marc Vos
In reply to this post by Ari Denison
This shows that the field is 'signed', otherwise it would have shown under Type: bigint(20) unsigned

With a 'signed' column, you are reducing its value range from 0 to whatever (unsigned) to -whatever/2 to whatever/2 (signed): for example, a byte:

        signed: -127 to 128 -> with autoincrement to 129, it would start to return negative values.
        unsigned: 0 to 255

Try the following sql to make the column unsigned (copied from Navicat):

        ALTER TABLE `db`.`table` CHANGE COLUMN `id` `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT `unique ID`

Or use Navicat (I highly recommend the investment!) to check the 'unsigned' bit and save.

- -
Regards,
Marc



On 14 aug. 2013, at 09:43, Ari Denison <[hidden email]> wrote:

> Yes, MySQL
>
> Please forgive the formatting. This is what I can determine about the id field in question.
>
> Looks like just a bigint(20) with auto_increment set
> +--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
> | Field                    | Type                                                                                                                              | Null | Key | Default             | Extra          |
> +--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
>
> | id                       | bigint(20)                                                                                                                        | NO   | PRI | NULL                | auto_increment |
>
> On Aug 14, 2013, at 2:36 AM, Marc Vos <[hidden email]> wrote:
>
> Hi Ari,
>
> I suppose you're talking MySQL.
> Check if the 'unsigned'-bit is on for that column.
>
> - -
> Regards,
> Marc
>
>
> On 14 aug. 2013, at 09:25, Ari Denison <[hidden email]> wrote:
>
>> I'm working with Lasso 9.2.6 on CentOS Linux 6.4 64 bit kernel
>>
>> I have table with 10 digit values for the unique key field. For example: 3763825371
>>
>> When I insert a new record into this table, by any means (sql statement, classic inline) the returned keyfield_value returns something like -531141926.
>>
>> On the next insert it change by one and will return -531141925
>>
>> How can I work around this? Are keyfield_values limited to 9 characters?
>>
>> Many thanks!
>> Ari
>>
>> #############################################################
>>
>> Attend the Lasso Developer Conference 2013!
>> Sept 12-14, 2013 in Niagara Falls, Canada
>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso
>> [hidden email]
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
>
> Attend the Lasso Developer Conference 2013!
> Sept 12-14, 2013 in Niagara Falls, Canada
> http://www.lassosoft.com/LDC-niagara-falls-2013
>
> #############################################################
> This message is sent to you because you are subscribed to
> the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
>
> Attend the Lasso Developer Conference 2013!
> Sept 12-14, 2013 in Niagara Falls, Canada
> http://www.lassosoft.com/LDC-niagara-falls-2013
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Recalling long keyfield_value gives unexpected results

Marc Vos
In reply to this post by Ari Denison
It is possible that Lasso gets confused with the signed values coming from the DB into an unsigned INT variable inside Lasso.
I really do not know how Lasso 9 handles integer vars internally - never gave it any thought really - but now that you raise it, it's an interesting topic.
The vars are probably all 'signed' and maybe too small, so values become negative. But that's something for LassoSoft to clear up, I think.

- -
Regards,
Marc


On 14 aug. 2013, at 09:52, Ari Denison <[hidden email]> wrote:

> I forgot to mention. This happens only on -add/insert.
> -update works just fine and returns the proper and correct keyfield_value.
>
>
> On Aug 14, 2013, at 2:36 AM, Marc Vos <[hidden email]> wrote:
>
> Hi Ari,
>
> I suppose you're talking MySQL.
> Check if the 'unsigned'-bit is on for that column.
>
> - -
> Regards,
> Marc
>
>
> On 14 aug. 2013, at 09:25, Ari Denison <[hidden email]> wrote:
>
>> I'm working with Lasso 9.2.6 on CentOS Linux 6.4 64 bit kernel
>>
>> I have table with 10 digit values for the unique key field. For example: 3763825371
>>
>> When I insert a new record into this table, by any means (sql statement, classic inline) the returned keyfield_value returns something like -531141926.
>>
>> On the next insert it change by one and will return -531141925
>>
>> How can I work around this? Are keyfield_values limited to 9 characters?
>>
>> Many thanks!
>> Ari
>>
>> #############################################################
>>
>> Attend the Lasso Developer Conference 2013!
>> Sept 12-14, 2013 in Niagara Falls, Canada
>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso
>> [hidden email]
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
>
> Attend the Lasso Developer Conference 2013!
> Sept 12-14, 2013 in Niagara Falls, Canada
> http://www.lassosoft.com/LDC-niagara-falls-2013
>
> #############################################################
> This message is sent to you because you are subscribed to
> the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
>
> Attend the Lasso Developer Conference 2013!
> Sept 12-14, 2013 in Niagara Falls, Canada
> http://www.lassosoft.com/LDC-niagara-falls-2013
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Recalling long keyfield_value gives unexpected results

Ari Denison
In reply to this post by Marc Vos
Thanks for the explanation of unsigned vs. signed.

This is definitely strange.

I've updated the field definition to be unsigned as you suggested.

+--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
| Field                    | Type                                                                                                                              | Null | Key | Default             | Extra          |
+--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
| id                       | bigint(20) unsigned                                                                                                               | NO   | PRI | NULL                | auto_increment |

Alas, the same problem is happening.

Update works fine.

Insert returns a negative number.

I did fiddle around and determine that the difference between the actual/accurate id in the database and what lasso returns is 4294967296

So, I've got to add 4294967296 to the keyfield_value returned from lasso on Insert/Add for this table to get the accurate db number. Doesn't matter if the field is unsigned or not.





On Aug 14, 2013, at 3:01 AM, Marc Vos <[hidden email]> wrote:

This shows that the field is 'signed', otherwise it would have shown under Type: bigint(20) unsigned

With a 'signed' column, you are reducing its value range from 0 to whatever (unsigned) to -whatever/2 to whatever/2 (signed): for example, a byte:

        signed: -127 to 128 -> with autoincrement to 129, it would start to return negative values.
        unsigned: 0 to 255

Try the following sql to make the column unsigned (copied from Navicat):

        ALTER TABLE `db`.`table` CHANGE COLUMN `id` `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT `unique ID`

Or use Navicat (I highly recommend the investment!) to check the 'unsigned' bit and save.

- -
Regards,
Marc



On 14 aug. 2013, at 09:43, Ari Denison <[hidden email]> wrote:

> Yes, MySQL
>
> Please forgive the formatting. This is what I can determine about the id field in question.
>
> Looks like just a bigint(20) with auto_increment set
> +--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
> | Field                    | Type                                                                                                                              | Null | Key | Default             | Extra          |
> +--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
>
> | id                       | bigint(20)                                                                                                                        | NO   | PRI | NULL                | auto_increment |
>
> On Aug 14, 2013, at 2:36 AM, Marc Vos <[hidden email]> wrote:
>
> Hi Ari,
>
> I suppose you're talking MySQL.
> Check if the 'unsigned'-bit is on for that column.
>
> - -
> Regards,
> Marc
>
>
> On 14 aug. 2013, at 09:25, Ari Denison <[hidden email]> wrote:
>
>> I'm working with Lasso 9.2.6 on CentOS Linux 6.4 64 bit kernel
>>
>> I have table with 10 digit values for the unique key field. For example: 3763825371
>>
>> When I insert a new record into this table, by any means (sql statement, classic inline) the returned keyfield_value returns something like -531141926.
>>
>> On the next insert it change by one and will return -531141925
>>
>> How can I work around this? Are keyfield_values limited to 9 characters?
>>
>> Many thanks!
>> Ari
>>
>> #############################################################
>>
>> Attend the Lasso Developer Conference 2013!
>> Sept 12-14, 2013 in Niagara Falls, Canada
>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso
>> [hidden email]
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
>
> Attend the Lasso Developer Conference 2013!
> Sept 12-14, 2013 in Niagara Falls, Canada
> http://www.lassosoft.com/LDC-niagara-falls-2013
>
> #############################################################
> This message is sent to you because you are subscribed to
> the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
>
> Attend the Lasso Developer Conference 2013!
> Sept 12-14, 2013 in Niagara Falls, Canada
> http://www.lassosoft.com/LDC-niagara-falls-2013
>
> #############################################################
> This message is sent to you because you are subscribed to
> the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
 the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>


#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Recalling long keyfield_value gives unexpected results

Ke Carlton-3
Try testing with just SQL:

INSERT INTO mytable(column) VALUES ("xxx");
SELECT LAST_INSERT_ID() as keyvalue;


Then with Lasso:

inline(-database='db',-sql = 'the above') => {
   resultset(2) => {
      debug(column('keyvalue'))
   }
}


Then with add inline:

inline(-database='db',-table = 'mytable',-keycolumn='id', -add) => {
      debug(keycolumn_value)
      debug(action_statement)
}


If the above is wrong then maybe the connector is doing something funky
with the key value but it's unlikely as it just does the same as the first
statement.

Ke



On 14 August 2013 09:18, Ari Denison <[hidden email]> wrote:

> Thanks for the explanation of unsigned vs. signed.
>
> This is definitely strange.
>
> I've updated the field definition to be unsigned as you suggested.
>
>
> +--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
> | Field                    | Type
>
>          | Null | Key | Default             | Extra          |
>
> +--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
> | id                       | bigint(20) unsigned
>
>         | NO   | PRI | NULL                | auto_increment |
>
> Alas, the same problem is happening.
>
> Update works fine.
>
> Insert returns a negative number.
>
> I did fiddle around and determine that the difference between the
> actual/accurate id in the database and what lasso returns is 4294967296
>
> So, I've got to add 4294967296 to the keyfield_value returned from lasso
> on Insert/Add for this table to get the accurate db number. Doesn't matter
> if the field is unsigned or not.
>
>
>
>
>
> On Aug 14, 2013, at 3:01 AM, Marc Vos <[hidden email]> wrote:
>
> This shows that the field is 'signed', otherwise it would have shown under
> Type: bigint(20) unsigned
>
> With a 'signed' column, you are reducing its value range from 0 to
> whatever (unsigned) to -whatever/2 to whatever/2 (signed): for example, a
> byte:
>
>         signed: -127 to 128     -> with autoincrement to 129, it would
> start to return negative values.
>         unsigned: 0 to 255
>
> Try the following sql to make the column unsigned (copied from Navicat):
>
>         ALTER TABLE `db`.`table` CHANGE COLUMN `id` `id` bigint(20)
> UNSIGNED NOT NULL AUTO_INCREMENT COMMENT `unique ID`
>
> Or use Navicat (I highly recommend the investment!) to check the
> 'unsigned' bit and save.
>
> - -
> Regards,
> Marc
>
>
>
> On 14 aug. 2013, at 09:43, Ari Denison <[hidden email]> wrote:
>
> > Yes, MySQL
> >
> > Please forgive the formatting. This is what I can determine about the id
> field in question.
> >
> > Looks like just a bigint(20) with auto_increment set
> >
> +--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
> > | Field                    | Type
>
>            | Null | Key | Default             | Extra          |
> >
> +--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
> >
> > | id                       | bigint(20)
>
>            | NO   | PRI | NULL                | auto_increment |
> >
> > On Aug 14, 2013, at 2:36 AM, Marc Vos <[hidden email]> wrote:
> >
> > Hi Ari,
> >
> > I suppose you're talking MySQL.
> > Check if the 'unsigned'-bit is on for that column.
> >
> > - -
> > Regards,
> > Marc
> >
> >
> > On 14 aug. 2013, at 09:25, Ari Denison <[hidden email]>
> wrote:
> >
> >> I'm working with Lasso 9.2.6 on CentOS Linux 6.4 64 bit kernel
> >>
> >> I have table with 10 digit values for the unique key field. For
> example: 3763825371
> >>
> >> When I insert a new record into this table, by any means (sql
> statement, classic inline) the returned keyfield_value returns something
> like -531141926.
> >>
> >> On the next insert it change by one and will return -531141925
> >>
> >> How can I work around this? Are keyfield_values limited to 9 characters?
> >>
> >> Many thanks!
> >> Ari
> >>
> >> #############################################################
> >>
> >> Attend the Lasso Developer Conference 2013!
> >> Sept 12-14, 2013 in Niagara Falls, Canada
> >> http://www.lassosoft.com/LDC-niagara-falls-2013
> >>
> >> #############################################################
> >> This message is sent to you because you are subscribed to
> >> the mailing list Lasso
> >> [hidden email]
> >> To unsubscribe, E-mail to: <[hidden email]>
> >> Send administrative queries to  <[hidden email]>
> >
> >
> > #############################################################
> >
> > Attend the Lasso Developer Conference 2013!
> > Sept 12-14, 2013 in Niagara Falls, Canada
> > http://www.lassosoft.com/LDC-niagara-falls-2013
> >
> > #############################################################
> > This message is sent to you because you are subscribed to
> > the mailing list Lasso
> > [hidden email]
> > To unsubscribe, E-mail to: <[hidden email]>
> > Send administrative queries to  <[hidden email]>
> >
> >
> > #############################################################
> >
> > Attend the Lasso Developer Conference 2013!
> > Sept 12-14, 2013 in Niagara Falls, Canada
> > http://www.lassosoft.com/LDC-niagara-falls-2013
> >
> > #############################################################
> > This message is sent to you because you are subscribed to
> > the mailing list Lasso
> > [hidden email]
> > To unsubscribe, E-mail to: <[hidden email]>
> > Send administrative queries to  <[hidden email]>
>
>
> #############################################################
>
> Attend the Lasso Developer Conference 2013!
> Sept 12-14, 2013 in Niagara Falls, Canada
> http://www.lassosoft.com/LDC-niagara-falls-2013
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
>
> Attend the Lasso Developer Conference 2013!
> Sept 12-14, 2013 in Niagara Falls, Canada
> http://www.lassosoft.com/LDC-niagara-falls-2013
>
> #############################################################
> This message is sent to you because you are subscribed to
>   the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>

#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Recalling long keyfield_value gives unexpected results

Marc Vos
In reply to this post by Ari Denison
That is definitely a sign that Lasso uses a too small signed integer to hold the returned value.

- -
Marc

On 14 aug. 2013, at 10:18, Ari Denison <[hidden email]> wrote:

> Thanks for the explanation of unsigned vs. signed.
>
> This is definitely strange.
>
> I've updated the field definition to be unsigned as you suggested.
>
> +--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
> | Field                    | Type                                                                                                                              | Null | Key | Default             | Extra          |
> +--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
> | id                       | bigint(20) unsigned                                                                                                               | NO   | PRI | NULL                | auto_increment |
>
> Alas, the same problem is happening.
>
> Update works fine.
>
> Insert returns a negative number.
>
> I did fiddle around and determine that the difference between the actual/accurate id in the database and what lasso returns is 4294967296
>
> So, I've got to add 4294967296 to the keyfield_value returned from lasso on Insert/Add for this table to get the accurate db number. Doesn't matter if the field is unsigned or not.
>
>
>
>
>
> On Aug 14, 2013, at 3:01 AM, Marc Vos <[hidden email]> wrote:
>
> This shows that the field is 'signed', otherwise it would have shown under Type: bigint(20) unsigned
>
> With a 'signed' column, you are reducing its value range from 0 to whatever (unsigned) to -whatever/2 to whatever/2 (signed): for example, a byte:
>
> signed: -127 to 128 -> with autoincrement to 129, it would start to return negative values.
> unsigned: 0 to 255
>
> Try the following sql to make the column unsigned (copied from Navicat):
>
> ALTER TABLE `db`.`table` CHANGE COLUMN `id` `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT `unique ID`
>
> Or use Navicat (I highly recommend the investment!) to check the 'unsigned' bit and save.
>
> - -
> Regards,
> Marc
>
>
>
> On 14 aug. 2013, at 09:43, Ari Denison <[hidden email]> wrote:
>
>> Yes, MySQL
>>
>> Please forgive the formatting. This is what I can determine about the id field in question.
>>
>> Looks like just a bigint(20) with auto_increment set
>> +--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
>> | Field                    | Type                                                                                                                              | Null | Key | Default             | Extra          |
>> +--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
>>
>> | id                       | bigint(20)                                                                                                                        | NO   | PRI | NULL                | auto_increment |
>>
>> On Aug 14, 2013, at 2:36 AM, Marc Vos <[hidden email]> wrote:
>>
>> Hi Ari,
>>
>> I suppose you're talking MySQL.
>> Check if the 'unsigned'-bit is on for that column.
>>
>> - -
>> Regards,
>> Marc
>>
>>
>> On 14 aug. 2013, at 09:25, Ari Denison <[hidden email]> wrote:
>>
>>> I'm working with Lasso 9.2.6 on CentOS Linux 6.4 64 bit kernel
>>>
>>> I have table with 10 digit values for the unique key field. For example: 3763825371
>>>
>>> When I insert a new record into this table, by any means (sql statement, classic inline) the returned keyfield_value returns something like -531141926.
>>>
>>> On the next insert it change by one and will return -531141925
>>>
>>> How can I work around this? Are keyfield_values limited to 9 characters?
>>>
>>> Many thanks!
>>> Ari
>>>
>>> #############################################################
>>>
>>> Attend the Lasso Developer Conference 2013!
>>> Sept 12-14, 2013 in Niagara Falls, Canada
>>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso
>>> [hidden email]
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>
>> #############################################################
>>
>> Attend the Lasso Developer Conference 2013!
>> Sept 12-14, 2013 in Niagara Falls, Canada
>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso
>> [hidden email]
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>>
>> #############################################################
>>
>> Attend the Lasso Developer Conference 2013!
>> Sept 12-14, 2013 in Niagara Falls, Canada
>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso
>> [hidden email]
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
>
> Attend the Lasso Developer Conference 2013!
> Sept 12-14, 2013 in Niagara Falls, Canada
> http://www.lassosoft.com/LDC-niagara-falls-2013
>
> #############################################################
> This message is sent to you because you are subscribed to
> the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
>
> Attend the Lasso Developer Conference 2013!
> Sept 12-14, 2013 in Niagara Falls, Canada
> http://www.lassosoft.com/LDC-niagara-falls-2013
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Recalling long keyfield_value gives unexpected results

Marc Vos
https://www.facebook.com/pages/If-this-group-reaches-4294967296-it-might-cause-an-integer-overflow/123635097668619

- -
Marc

On 14 aug. 2013, at 11:39, Marc Vos <[hidden email]> wrote:

> That is definitely a sign that Lasso uses a too small signed integer to hold the returned value.
>
> - -
> Marc
>
> On 14 aug. 2013, at 10:18, Ari Denison <[hidden email]> wrote:
>
>> Thanks for the explanation of unsigned vs. signed.
>>
>> This is definitely strange.
>>
>> I've updated the field definition to be unsigned as you suggested.
>>
>> +--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
>> | Field                    | Type                                                                                                                              | Null | Key | Default             | Extra          |
>> +--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
>> | id                       | bigint(20) unsigned                                                                                                               | NO   | PRI | NULL                | auto_increment |
>>
>> Alas, the same problem is happening.
>>
>> Update works fine.
>>
>> Insert returns a negative number.
>>
>> I did fiddle around and determine that the difference between the actual/accurate id in the database and what lasso returns is 4294967296
>>
>> So, I've got to add 4294967296 to the keyfield_value returned from lasso on Insert/Add for this table to get the accurate db number. Doesn't matter if the field is unsigned or not.
>>
>>
>>
>>
>>
>> On Aug 14, 2013, at 3:01 AM, Marc Vos <[hidden email]> wrote:
>>
>> This shows that the field is 'signed', otherwise it would have shown under Type: bigint(20) unsigned
>>
>> With a 'signed' column, you are reducing its value range from 0 to whatever (unsigned) to -whatever/2 to whatever/2 (signed): for example, a byte:
>>
>> signed: -127 to 128 -> with autoincrement to 129, it would start to return negative values.
>> unsigned: 0 to 255
>>
>> Try the following sql to make the column unsigned (copied from Navicat):
>>
>> ALTER TABLE `db`.`table` CHANGE COLUMN `id` `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT `unique ID`
>>
>> Or use Navicat (I highly recommend the investment!) to check the 'unsigned' bit and save.
>>
>> - -
>> Regards,
>> Marc
>>
>>
>>
>> On 14 aug. 2013, at 09:43, Ari Denison <[hidden email]> wrote:
>>
>>> Yes, MySQL
>>>
>>> Please forgive the formatting. This is what I can determine about the id field in question.
>>>
>>> Looks like just a bigint(20) with auto_increment set
>>> +--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
>>> | Field                    | Type                                                                                                                              | Null | Key | Default             | Extra          |
>>> +--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
>>>
>>> | id                       | bigint(20)                                                                                                                        | NO   | PRI | NULL                | auto_increment |
>>>
>>> On Aug 14, 2013, at 2:36 AM, Marc Vos <[hidden email]> wrote:
>>>
>>> Hi Ari,
>>>
>>> I suppose you're talking MySQL.
>>> Check if the 'unsigned'-bit is on for that column.
>>>
>>> - -
>>> Regards,
>>> Marc
>>>
>>>
>>> On 14 aug. 2013, at 09:25, Ari Denison <[hidden email]> wrote:
>>>
>>>> I'm working with Lasso 9.2.6 on CentOS Linux 6.4 64 bit kernel
>>>>
>>>> I have table with 10 digit values for the unique key field. For example: 3763825371
>>>>
>>>> When I insert a new record into this table, by any means (sql statement, classic inline) the returned keyfield_value returns something like -531141926.
>>>>
>>>> On the next insert it change by one and will return -531141925
>>>>
>>>> How can I work around this? Are keyfield_values limited to 9 characters?
>>>>
>>>> Many thanks!
>>>> Ari
>>>>
>>>> #############################################################
>>>>
>>>> Attend the Lasso Developer Conference 2013!
>>>> Sept 12-14, 2013 in Niagara Falls, Canada
>>>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>>>
>>>> #############################################################
>>>> This message is sent to you because you are subscribed to
>>>> the mailing list Lasso
>>>> [hidden email]
>>>> To unsubscribe, E-mail to: <[hidden email]>
>>>> Send administrative queries to  <[hidden email]>
>>>
>>>
>>> #############################################################
>>>
>>> Attend the Lasso Developer Conference 2013!
>>> Sept 12-14, 2013 in Niagara Falls, Canada
>>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso
>>> [hidden email]
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>>
>>>
>>> #############################################################
>>>
>>> Attend the Lasso Developer Conference 2013!
>>> Sept 12-14, 2013 in Niagara Falls, Canada
>>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso
>>> [hidden email]
>>> To unsubscribe, E-mail to: <[hidden email]>
>>> Send administrative queries to  <[hidden email]>
>>
>>
>> #############################################################
>>
>> Attend the Lasso Developer Conference 2013!
>> Sept 12-14, 2013 in Niagara Falls, Canada
>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso
>> [hidden email]
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>>
>>
>> #############################################################
>>
>> Attend the Lasso Developer Conference 2013!
>> Sept 12-14, 2013 in Niagara Falls, Canada
>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso
>> [hidden email]
>> To unsubscribe, E-mail to: <[hidden email]>
>> Send administrative queries to  <[hidden email]>
>
>
> #############################################################
>
> Attend the Lasso Developer Conference 2013!
> Sept 12-14, 2013 in Niagara Falls, Canada
> http://www.lassosoft.com/LDC-niagara-falls-2013
>
> #############################################################
> This message is sent to you because you are subscribed to
>  the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to: <[hidden email]>
> Send administrative queries to  <[hidden email]>


#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>
Reply | Threaded
Open this post in threaded view
|

Re: Recalling long keyfield_value gives unexpected results

Brad Lindsay
In reply to this post by Ari Denison
Definitely email this to [hidden email]. It looks like they data
source connector treats bigints as regular ints.

Brad

On 8/14/13, 4:18 AM, Ari Denison wrote:

> Thanks for the explanation of unsigned vs. signed.
>
> This is definitely strange.
>
> I've updated the field definition to be unsigned as you suggested.
>
> +--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
> | Field                    | Type                                                                                                                              | Null | Key | Default             | Extra          |
> +--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
> | id                       | bigint(20) unsigned                                                                                                               | NO   | PRI | NULL                | auto_increment |
>
> Alas, the same problem is happening.
>
> Update works fine.
>
> Insert returns a negative number.
>
> I did fiddle around and determine that the difference between the actual/accurate id in the database and what lasso returns is 4294967296
>
> So, I've got to add 4294967296 to the keyfield_value returned from lasso on Insert/Add for this table to get the accurate db number. Doesn't matter if the field is unsigned or not.
>
>
>
>
>
> On Aug 14, 2013, at 3:01 AM, Marc Vos<[hidden email]>  wrote:
>
> This shows that the field is 'signed', otherwise it would have shown under Type: bigint(20) unsigned
>
> With a 'signed' column, you are reducing its value range from 0 to whatever (unsigned) to -whatever/2 to whatever/2 (signed): for example, a byte:
>
> signed: -127 to 128 ->  with autoincrement to 129, it would start to return negative values.
> unsigned: 0 to 255
>
> Try the following sql to make the column unsigned (copied from Navicat):
>
> ALTER TABLE `db`.`table` CHANGE COLUMN `id` `id` bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT `unique ID`
>
> Or use Navicat (I highly recommend the investment!) to check the 'unsigned' bit and save.
>
> - -
> Regards,
> Marc
>
>
>
> On 14 aug. 2013, at 09:43, Ari Denison<[hidden email]>  wrote:
>
>> Yes, MySQL
>>
>> Please forgive the formatting. This is what I can determine about the id field in question.
>>
>> Looks like just a bigint(20) with auto_increment set
>> +--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
>> | Field                    | Type                                                                                                                              | Null | Key | Default             | Extra          |
>> +--------------------------+-----------------------------------------------------------------------------------------------------------------------------------+------+-----+---------------------+----------------+
>>
>> | id                       | bigint(20)                                                                                                                        | NO   | PRI | NULL                | auto_increment |
>>
>> On Aug 14, 2013, at 2:36 AM, Marc Vos<[hidden email]>  wrote:
>>
>> Hi Ari,
>>
>> I suppose you're talking MySQL.
>> Check if the 'unsigned'-bit is on for that column.
>>
>> - -
>> Regards,
>> Marc
>>
>>
>> On 14 aug. 2013, at 09:25, Ari Denison<[hidden email]>  wrote:
>>
>>> I'm working with Lasso 9.2.6 on CentOS Linux 6.4 64 bit kernel
>>>
>>> I have table with 10 digit values for the unique key field. For example: 3763825371
>>>
>>> When I insert a new record into this table, by any means (sql statement, classic inline) the returned keyfield_value returns something like -531141926.
>>>
>>> On the next insert it change by one and will return -531141925
>>>
>>> How can I work around this? Are keyfield_values limited to 9 characters?
>>>
>>> Many thanks!
>>> Ari
>>>
>>> #############################################################
>>>
>>> Attend the Lasso Developer Conference 2013!
>>> Sept 12-14, 2013 in Niagara Falls, Canada
>>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>>
>>> #############################################################
>>> This message is sent to you because you are subscribed to
>>> the mailing list Lasso
>>> [hidden email]
>>> To unsubscribe, E-mail to:<[hidden email]>
>>> Send administrative queries to<[hidden email]>
>>
>> #############################################################
>>
>> Attend the Lasso Developer Conference 2013!
>> Sept 12-14, 2013 in Niagara Falls, Canada
>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso
>> [hidden email]
>> To unsubscribe, E-mail to:<[hidden email]>
>> Send administrative queries to<[hidden email]>
>>
>>
>> #############################################################
>>
>> Attend the Lasso Developer Conference 2013!
>> Sept 12-14, 2013 in Niagara Falls, Canada
>> http://www.lassosoft.com/LDC-niagara-falls-2013
>>
>> #############################################################
>> This message is sent to you because you are subscribed to
>> the mailing list Lasso
>> [hidden email]
>> To unsubscribe, E-mail to:<[hidden email]>
>> Send administrative queries to<[hidden email]>
>
>
> #############################################################
>
> Attend the Lasso Developer Conference 2013!
> Sept 12-14, 2013 in Niagara Falls, Canada
> http://www.lassosoft.com/LDC-niagara-falls-2013
>
> #############################################################
> This message is sent to you because you are subscribed to
>   the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to:<[hidden email]>
> Send administrative queries to<[hidden email]>
>
>
> #############################################################
>
> Attend the Lasso Developer Conference 2013!
> Sept 12-14, 2013 in Niagara Falls, Canada
> http://www.lassosoft.com/LDC-niagara-falls-2013
>
> #############################################################
> This message is sent to you because you are subscribed to
>    the mailing list Lasso
> [hidden email]
> To unsubscribe, E-mail to:<[hidden email]>
> Send administrative queries to<[hidden email]>

#############################################################

Attend the Lasso Developer Conference 2013!
Sept 12-14, 2013 in Niagara Falls, Canada
http://www.lassosoft.com/LDC-niagara-falls-2013

#############################################################
This message is sent to you because you are subscribed to
  the mailing list Lasso
[hidden email]
To unsubscribe, E-mail to: <[hidden email]>
Send administrative queries to  <[hidden email]>