The attribute of the nid field in the {comments} table (and possibly others) does not contain "unsigned", therefore nodes with nid's above 2^15-1=2147483647 can't have comments. There might also be other tables not related to the comment.module that contain nid fields without the unsigned attribute.

This is an issue only when creating nodes outside of drupal, as I did when importing an sql file into phpMyAdmin and when you hand-edit files from the module Backup and Migrate.

Comments

s.Daniel’s picture

Title: Table {comments}: nid field is not unsigned » Table {comments}: nid field is not unsigned and has wrong datatype
Version: 6.20 » 7.x-dev

This applies for D7 as well but has been fixed in D8 and will become irrelevant in D8.

type and unsigned are the important bits:

function node_schema() {
  $schema['node'] = array(
    'description' => 'The base table for nodes.',
    'fields' => array(
      'nid' => array(
        'description' => 'The primary identifier for a node.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
function comment_schema() {
  $schema['comment'] = array(
    'description' => 'Stores comments and associated data.',
....
      'nid' => array(
        'type' => 'int',
        'not null' => TRUE,
        'default' => 0,
        'description' => 'The {node}.nid to which this comment is a reply.',
      ),

Normaly this won't cause any harm but its hacky. However I am not sure if there could be situations where changing this might fail when the db has been populated.