Database warnings

engelsma - June 26, 2007 - 18:50
Project:Media Field
Version:5.x-1.0
Component:Code
Category:bug report
Priority:critical
Assigned:Unassigned
Status:closed
Description

I am using Drupal 5.1 with Postgresql 8.2. I have created a custom content type with a video field. When I try to create some content using the new content type, I get the errors/warnings below when I click the submit button:

* warning: pg_query() [function.pg-query]: Query failed: ERROR: invalid input syntax for integer: "" in /Volumes/Mac_Data/engelsma_us/drupal/includes/database.pgsql.inc on line 125.

* user warning: query: INSERT INTO content_type_video_entry (field_video_file_fid, field_video_file_fileformat, field_video_file_videox, field_video_file_videoy, field_video_file_bits_per_sample, field_video_file_videocodec, field_video_file_audiocodec, field_video_file_sample_rate, field_video_file_channel_mode, field_video_file_playtime, vid, nid) VALUES (25, 'quicktime', '', '', NULL, NULL, 'ISO/IEC 14496-3 AAC', 44100, 'stereo', '8:36', 67, 41) in /Volumes/Mac_Data/engelsma_us/drupal/includes/database.pgsql.inc on line 144.

Does media field work with Postgresql as the database server? I've attached a screenshot showing the error as well.

Thanks for your help!

AttachmentSize
Screenshot_3.jpg305.94 KB

#1

engelsma - June 26, 2007 - 20:24

The getID3() library seems to be having trouble determining the horizontal and vertical resolution (i.e. size) of the video. The video I've been trying to post is a Quicktime .mov file encoded with the H264 video codec and the AAC audio codec.

If I create content with .wmv files, there is no problem.

#2

aigeanta - June 28, 2007 - 07:03
Category:support request» bug report

I am also have database troubles, using PostgreSQL, and trying to add an audio field to my blog content type:

   * warning: pg_query() [function.pg-query]: Query failed: ERROR: syntax error at or near "unsigned" at character 66 in /var/www/aigeanta.net/includes/database.pgsql.inc on line 125.
    * user warning: query: ALTER TABLE content_type_blog ADD field_blog_audio_bitrate float unsigned in /var/www/aigeanta.net/includes/database.pgsql.inc on line 144.

#3

aigeanta - June 28, 2007 - 07:55

OK I tried attaching a video to a blog entry, and got db errors just like the initiator of this issue:

    * warning: pg_query() [function.pg-query]: Query failed: ERROR: invalid input syntax for integer: "" in /var/www/aigeanta.net/includes/database.pgsql.inc on line 125.
    * user warning: query: UPDATE content_type_blog SET field_blog_video_fid = 30, field_blog_video_fileformat = 'mpeg4', field_blog_video_videox = '', field_blog_video_videoy = '', field_blog_video_bits_per_sample = NULL, field_blog_video_videocodec = NULL, field_blog_video_audiocodec = 'ISO/IEC 14496-3 AAC', field_blog_video_sample_rate = 32000, field_blog_video_channel_mode = 'stereo', field_blog_video_playtime = '0:40' WHERE vid = 45 AND nid = 45 in /var/www/aigeanta.net/includes/database.pgsql.inc on line 144.
    * warning: pg_query() [function.pg-query]: Query failed: ERROR: column "field_blog_audio_bitrate" does not exist in /var/www/aigeanta.net/includes/database.pgsql.inc on line 125.
    * user warning: query: SELECT field_blog_audio_fid AS fid, field_blog_audio_sample_rate AS sample_rate, field_blog_audio_bitrate AS bitrate, field_blog_audio_channel_mode AS channel_mode, field_blog_audio_playtime AS playtime FROM content_type_blog WHERE vid = 45 in /var/www/aigeanta.net/includes/database.pgsql.inc on line 144.

#4

aigeanta - July 2, 2007 - 06:19
Version:5.x-1.x-dev» 5.x-1.0
Priority:normal» critical

OK I downgraded from the -dev version to the latest release, and got the same kind of warning, and a site that wouldn't load until I deleted the video file field I had added to my blog content type:

warning: pg_query() [function.pg-query]: Query failed: ERROR: invalid input syntax for integer: "" in /var/www/aigeanta.net/includes/database.pgsql.inc on line 125.
user warning: query: UPDATE content_type_blog SET field_blog_video_fid = 32, field_blog_video_fileformat = 'mpeg4', field_blog_video_videox = '', field_blog_video_videoy = '', field_blog_video_bits_per_sample = NULL, field_blog_video_videocodec = NULL, field_blog_video_audiocodec = 'ISO/IEC 14496-3 AAC', field_blog_video_sample_rate = 32000, field_blog_video_channel_mode = 'stereo', field_blog_video_playtime = '0:40' WHERE vid = 45 AND nid = 45 in /var/www/aigeanta.net/includes/database.pgsql.inc on line 144.

#5

xykon - July 10, 2007 - 20:40

The error of #2 is due to the fact that the datatype of bitrate is defined as 'float unsigned', which is a
mysql only datatype. I've changed it to the standard sql datatype 'real' and now it works for my
postgresql db. I have not tested it with mysql, but it should work there too.

Note: This will break existing audiofields, if applied on a working mysql db.

A solution might be to provide two different 'database columns' setups for postgres and mysql.

-        'bitrate' => array('type' => 'float unsigned', 'not null' => FALSE),
+        'bitrate' => array('type' => 'real', 'not null' => FALSE),

#6

stormsweeper - September 19, 2007 - 21:16

A better option would be:

'bitrate' => array('type' => 'float', unsigned => TRUE, 'not null' => FALSE),

The "real" type isn't handled by cck, so it'll do things like use strings and let your db do the conversions. The unsigned flag will be ignored for pgsql, since postgres doesn't have native unsigned types (Drupal creates unsigned integer types on install). If it's critical that negative values don't get saved here, it would be best to add that to the validation code, really.

#7

jgumpert - December 23, 2007 - 17:14

I'm having the same issue - I've tried uploading EXE, SWF, WMV, and AVI videos to my video field and they all populate the "Video" column of the content creation page with ",x,,". Could this be a Windows-specific issue? Then when I submit the form, it is the predictable database error message:

user warning: Incorrect integer value: '' for column 'field_product_demo_videox' at row 1 query: UPDATE content_type_product_spotlight SET field_product_demo_fid = 114, field_product_demo_fileformat = NULL, field_product_demo_videox = '', field_product_demo_videoy = '', field_product_demo_bits_per_sample = NULL, field_product_demo_videocodec = NULL, field_product_demo_audiocodec = NULL, field_product_demo_sample_rate = NULL, field_product_demo_channel_mode = NULL, field_product_demo_playtime = NULL WHERE vid = 177 AND nid = 177 in D:\PTC\Apache\htdocs\msdw1\includes\database.mysql.inc on line 172.

I fixed my getid3 errors earlier and the file formats are even recognized with accurate icons for some of these formats.

#8

a_c_m - June 25, 2008 - 20:08

I've just taken over maintainer of this module , this is a very old issue, if its still a problem let me know and I will take a look - otherwise please close it. No updates for 2 week = i close it.

#9

a_c_m - August 21, 2008 - 06:50
Status:active» closed
 
 

Drupal is a registered trademark of Dries Buytaert.