Skip to content

Propel ORM, schema.xml, the missing autoIncrement value and a not working "$propelObject->reload()" with mysql greater 5.1

So i had to evaluate a migration of an existing application from mysql 5.1 to mysql 5.5. Yes i know, the gap between 5.1 and 5.5 is tremendous but the system was working without any problems for a long time of periode.

After switching a test environment from 5.1 to 5.5 there was one unittest failing. What was so special in that given unittest? For a reason, we needed to execute the native propel method "reload" right after a "save". The test was failing because of an empty value for the "id". The representing database table has a column id with an autoincrement flag. With mysql 5.1, everything is working as expected. The id was available after the reload so everything was fine.

After switching to 5.5, no id was available after calling "save". This leads to the fact that propel was failing by executing the "reload" method. Switching back to mysql 5.1 and the error was gone. After search in usergroups, issuepages i still could not find any matching issue or entry. Finally i presentend my problem on the #propel channel in freenode and got some feedback. One guy had experienced the same error in the past. He could remember that this problem occures while switching to mysql 5.3 or 5.4. Niceguy exptom wrote that goosed him with my report and he will give the problem a debug session try.

On the next day, he quickly responded and presented his results. He (if he is a he and not a she) told me he could takle it down to a missleading schema.xml. The column where the error occures had a missing autoIncrement="true" value. I took a look into my current schema.xml and bam same flaw.

The rest is quite easy. Update schema.xml, rerun propel generation and testing. Everything is now working fine. Thanks to exptom again. I guess the schema.xml would have been one of the last areas i had debugged.

MySQL - While do procedure example

Just a small example of how write a procedure / function in mysql (5.x) by using a simple while loop for inserting (example testdata) into a database.

DROP PROCEDURE IF EXISTS doWhileArtodeto; DELIMITER // CREATE PROCEDURE doWhileArtodeto() BEGIN DECLARE int1 INT DEFAULT 1; DECLARE int2 INT DEFAULT 50; int1loop: WHILE int1 <= int2 DO INSERT INTO `my_db`.`my_table` (`name`,`value`) VALUES('artodeto',int1); SET v1 = int1 + 1; END WHILE int1loop; END// DELIMITER ; CALL doWhileArtodeto(); DROP PROCEDURE doWhileArtodeto;

Feel free to use. It should be self explanatory, if not, do not use it (remember, you should always know what code you copy and what you do).

If you want to know more, try the following links. Procedure tutorial Manual about while on

Sourceforge - projectlist 110823

After browsing trough the, my tab group with "software" to look at counts 15 tabs. Hopefully i can/will check this software. Otherwise, if you checked it, write a comment.

  • webmail program like roundcube
    IlohaMail is a PHP based lightweight full featured multilingual webmail program with IMAP and POP3 support. IlohaMail also includes a full-featured contacts manager, bookmarks manager, and scheduler.
  • web file management
    AjaXplorer is a PHP rich-client browser for managing files on a web server without FTP. Implements usual file actions, online zip browsing, text files edition and images preview. Users management system and multi-languages.
    ajax filemanager
  • web instant messenger
    AJAX Chat is a fully customizable web chat implemented in JavaScript, PHP and MySQL which integrates nicely with common forum systems like phpBB, MyBB, PunBB, SMF and vBulletin. A Flash and Ruby based socket connection can be used to boost performance.
  • phpFreeChat is a free, simple to install, fast and customizable chat that uses by default files for message and nickname storage. It uses AJAX to smoothly refresh and display the chat zone and the nickname zone.
  • web proxy
    Lightweight, PHP-based Web Proxy that can utilize whatever remote connecting ablities your server has to offer. It should work out of the box. No configuration needed.
  • web desktop/os
    eyeos is an open source web desktop following the cloud computing concept, written in mainly PHP and XML. It acts as a platform for web applications written using the eyeOS Toolkit. It includes a Desktop environment with 67 applications and sys utils.
  • website heatmap
    ClickHeat is a visual heatmap of clicks on a HTML page, showing hot and cold click zones. Requires Javascript on the client to track clicks, PHP and GD on the server to log clicks and generate the heatmap
  • web human resource management
    OrangeHRM is an Open Source Human Resource Management System that covers Personnel Information Management, Employee Self Service, Leave, Time & Attendance, Benefits, and Recruitment. Tags: HRM, HRMS, HCM, HRIS, EHRMS, Human Capital Management
  • open source nas system
    Openfiler is a browser-based network storage management utility. Linux-powered, Openfiler delivers file-based Network Attached Storage (NAS) and block-based SAN in a single framework. It supports CIFS, NFS, HTTP/DAV, FTP, and iSCSI.
  • application security
    The Open Web Application Security Project (OWASP) software and documentation repository.
  • running native linux code on windows with andLinux
    andLinux is a complete Ubuntu Linux system running seamlessly in Windows 2000 based systems (2000, XP, 2003, Vista, 7; 32-bit versions only). This project was started for Dynamism for the GP2X community, but its userbase far exceeds its original design. andLinux is free and will remain so, but donations are greatly needed.

mysql import big *.sql files using the cli

If you need to import big \*.sql files into your mysql dbms, just log in using the cli support on your shell.

mysql - u -p
After that, change to your database ("show databases;" and "use mydatabase") and use the following command to insert the *.sql file.
>mysql source /path/to/source.sql