Skip Menu |

This queue is for tickets about the DBD-Pg CPAN distribution.

Report information
The Basics
Id: 102444
Status: resolved
Priority: 0/
Queue: DBD-Pg

People
Owner: Nobody in particular
Requestors: xiangel1 [...] 126.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 3.6.0



Subject: number of affected rows out of integer range
hi,when i used $sth->do get insert affected rows, it return nil ,and i check the rows is out of integer(4 bytes) range. it seems to be caused by dbdimp.h int rows; /* number of affected rows */ dbdimp.c int dbd_st_execute (SV * sth, imp_sth_t * imp_sth) { int ret = -2; ... if (0 == strncmp(cmdStatus, "INSERT", 6)) { /* INSERT(space)oid(space)numrows */ for (ret=8; cmdStatus[ret-1] != ' '; ret++) { } ret = atoi(cmdStatus + ret); gotrows = DBDPG_TRUE; } return ret;
We actually use atoi in a number of places in the code to gather the number of rows. I expected this might pop up some day, but that it would be a rare bug; I will look into getting it fixed up. Right now, I cannot even get a test to work as my box runs out of memory trying even a select 1 from generate_series(1,26000000000). But a quick glance at the code suggests there is little harm in turning that int into a long.
在2015-三月-02 21:41:32 星期一时,TURNSTEP写到: Show quoted text
> We actually use atoi in a number of places in the code to gather the > number of rows. I expected this might pop up some day, but that it > would be a rare bug; I will look into getting it fixed up. Right now, > I cannot even get a test to work as my box runs out of memory trying > even a select 1 from generate_series(1,26000000000). But a quick > glance at the code suggests there is little harm in turning that int > into a long.
thank you. I use DBD:PG connect to Greenplum database .so when i initialize tables it rows may be max than integer range . now i use select count(*) get the row number from table.
I'm going to add some support by changing ints to longs, and atois to atols, but this will not work completely until libpq starts supporting rows larger than ints as well. Still, when they do, we will be ready.
Applied in 135a26261d977f1b05f0fa835b655c423bc40912
Resolved in version 3.6.0 - or at least we've done as much as we can for now.