djjudas21 / photodb-perl

App to manage a collection of film cameras & lenses
https://metacpan.org/pod/App::PhotoDB
GNU General Public License v2.0
1 stars 2 forks source link

Bug with non-numeric frame numbers #32

Closed djjudas21 closed 6 years ago

djjudas21 commented 6 years ago

Looks like something is wrong with the handling of non-numeric frame numbers

[jonathan@xps photography-database]$ ./photodb negative stats
Film ID to print from (integer) []: 276
    1   Alum Bay
    ...
    36  Cable car
    E   The O2
Please select a Frame to print from from the list, or leave blank to skip (text) []: 1
    This negative has been printed 0 times
[jonathan@xps photography-database]$ ./photodb negative stats
Film ID to print from (integer) []: 272
    0A  Royal Fort Garden daffodils
    1A  Pampas grass
    2A  Valve
    ...
    11A Water reflection
    12A People and ship at docks
    13A St Augustine's Reach
    14A Yachts
    ...
    34A Rebecca at Troopers Hill Field
    35A Rebecca at Troopers Hill Field
Please select a Frame to print from from the list, or leave blank to skip (text) []: 13A
Use of uninitialized value $neg_id in concatenation (.) or string at lib/handlers.pm line 389, <STDIN> line 2.
DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 at lib/funcs.pm line 308, <STDIN> line 2.
DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 at lib/funcs.pm line 310, <STDIN> line 2.
DBD::mysql::st fetchrow_array failed: fetch() without execute() at lib/funcs.pm line 311, <STDIN> line 2.
Use of uninitialized value $noprints in concatenation (.) or string at lib/handlers.pm line 390, <STDIN> line 2.
    This negative has been printed  times
djjudas21 commented 6 years ago

Confirmed it is not the non-numeric, but the apostrophe in the caption. Need to consider quoting, escaping, using q{} etc.

djjudas21 commented 6 years ago

In a different context, it does appear to be the non-numeric frame, rather than an apostrophe:

[jonathan@latitude photography-database]$ ./photodb negative prints
Film ID to print from (integer) []: 272
    0A  Royal Fort Garden daffodils
    1A  Pampas grass
    2A  Valve
    3A  Chemistry building
    4A  Chemistry building
    5A  Dry ivy
    6A  Dry ivy
    7A  Bulb
    8A  College Green
    9A  Bristol Movable Forest
    10A Reflection at @Bristol
    11A Water reflection
    12A People and ship at docks
    13A St Augustine's Reach
    14A Yachts
    15A Docks wide view
    16A Lloyds office
    17A Lloyds office
    18A Docks
    19A Ship
    20A Ship
    21A Ship
    22A People
    23A Arch
    24A Fountains
    25A Rebecca at Troopers Hill Field
    26A Rebecca at Troopers Hill Field
    27A Rebecca at Troopers Hill Field
    28A Rebecca at Troopers Hill Field
    29A Rebecca at Troopers Hill Field
    30A Rebecca at Troopers Hill Field
    31A Rebecca at Troopers Hill Field
    32A Rebecca at Troopers Hill Field
    33A Rebecca at Troopers Hill Field
    34A Rebecca at Troopers Hill Field
    35A Rebecca at Troopers Hill Field
Please select a Frame to print from from the list, or leave blank to skip (text) []: 20A
Use of uninitialized value $neg_id in concatenation (.) or string at lib/handlers.pm line 482, <STDIN> line 2.
Use of uninitialized value $neg_id in concatenation (.) or string at lib/handlers.pm line 482, <STDIN> line 2.
Now showing prints from negative 

DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 at lib/funcs.pm line 287, <STDIN> line 2.
DBD::mysql::st execute failed: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1 at lib/funcs.pm line 289, <STDIN> line 2.
DBD::mysql::st fetchrow_hashref failed: fetch() without execute() at lib/funcs.pm line 291, <STDIN> line 2.
djjudas21 commented 6 years ago

It's actually a bug in the lookupneg() function