clkao / plv8js-migrated

Automatically exported from code.google.com/p/plv8js
Other
0 stars 0 forks source link

plv8.elog misbehaving with some very specific inputs of particular lengths #91

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. createdb
2. create extension plv8
3. Create simple function with plv8.elog

CREATE OR REPLACE FUNCTION disappearing_text(c text) RETURNS void AS   
$$ 
plv8.elog(INFO, '12345678' + c + '1'); 
$$ language plv8;

4. Pass specific parameter with single-quote doubling:

SELECT disappearing_text('123456789012345678901234567890123456789');

EXPECTED:

doubling=# SELECT disappearing_text('123456789012345678901234567890123456789');
INFO:  123456781234567890123456789012345678901234567891
 disappearing_text 
-------------------

ACTUAL (notice not INFO: outputted):

INFO:  
 disappearing_text 
-------------------

What version of the product are you using? On what operating system?

plv8 1.4.2

 PostgreSQL 9.3.4 on i686-pc-linux-gnu, compiled by gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, 32-bit

Please provide any additional information below.

If the input or concatenation string preprended (length=8) is any different 
length, the string outputs. 

If the postfixed string is less than 1 (empty string), the string outputs.

If the input string is less than 39, outputs ok.

Function name, parameters or return type appear to make no difference.

I can test the parameter for equality to the input string and it returns true 
even if plv8.elog returns nothing.

Note that I started playing around because I noticed random one character 
string being postfixed to the output of plv8.elog.

Original issue reported on code.google.com by rnga...@gmail.com on 14 Apr 2014 at 4:46

GoogleCodeExporter commented 9 years ago
It doesn't reproduce for me.  Which v8 are you using?

Original comment by umi.tan...@gmail.com on 19 May 2014 at 5:02

GoogleCodeExporter commented 9 years ago
Same issue here.

CREATE OR REPLACE FUNCTION disappearing_text(c text) RETURNS void AS
$$ 
plv8.elog(INFO, '12345678' + c + '1');
$$ language plv8;
SELECT disappearing_text('123456789012345678901234567890123456789');

CREATE FUNCTION
INFO:  
 disappearing_text
-------------------

(1 row)

CREATE OR REPLACE FUNCTION plv8Version() RETURNS text AS
$$
            plv8.elog(NOTICE, plv8.version);
$$          
LANGUAGE plv8;
select plv8Version();
CREATE FUNCTION
NOTICE:  1.4.0
 plv8version 
-------------

(1 row)

uname -a
Linux alpha 3.13.0-35-generic #62-Ubuntu SMP Fri Aug 15 01:58:01 UTC 2014 i686 
i686 i686 GNU/Linux

psql --version
psql (PostgreSQL) 9.3.5

Original comment by joa...@gmail.com on 14 Nov 2014 at 9:23