The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

getID, or "SQL-based version control"!

Last post 06-17-2009 6:10 PM by morbiuswilters. 19 replies.
Page 1 of 1 (20 items)
Sort Posts: Previous Next
  • 06-16-2009 4:20 PM

    getID, or "SQL-based version control"!

    Poking through some offshored VB.NET code to fix a few bugs, I found this gem:

    qry = "select max(b.idimage) from image a, image b where a.image_name=b.image_name and a.idimage=" & imageid

     It was inside a function called "getID"...

    So let me get this straight, this function, you pass in an ID... and it gives you an ID back... what exactly is the point of that anyway? The only use I could imagine is that since it calls a max function on the second instance of the image table, that it's some sort of hacky "version control" system - you put in an ID, it gives you the newest item with the same name!

  • 06-16-2009 4:45 PM In reply to

    Re: getID, or "SQL-based version control"!

    You may laugh, but I have seen SQL-based version control for source code before.  Turns out the dev thought CVS and SVN were too confusing, so he just inserted a row containing the filename in one column, the entire file in a TEXT column and an incrementing version number in a third.  To get the latest version, he just selected MAX(version_number) WHERE filename = "foo".

  • 06-16-2009 5:24 PM In reply to

    Re: getID, or "SQL-based version control"!

    The sad part is that I think that some version control software actually uses a database for the file storage.
  • 06-16-2009 6:20 PM In reply to

    Re: getID, or "SQL-based version control"!

    henke37:
    The sad part is that I think that some version control software actually uses a database for the file storage.
    Subversion does. Well, FSFS has been the default for quite a while, but the Berkley DB option is still available.
    ╩юфют√ь ёЄЁрэшЎрь яюЁр эр яхэёш■.

    #TDWTF @ SlashNET was merged into #codelove @ the same network. You're still welcome to drop by. I guess.
  • 06-16-2009 8:38 PM In reply to

    Re: getID, or "SQL-based version control"!

    Seeing as how filesystems are by their very nature databases, I would think that all RCS are database-oriented.

    You have a set of objects, and some relation of those objects one to another, and a set of operations on those objects.

    Sounds like a database to me.

    morbiuswilters: Oh, and this entire thread is pointless, flamebait spam. Heckuva job, drachy...
    Prepare for a life in hell, a thankless job where you service the dregs of society. Kinda like being a hooker that works in a crack house.

    "we don't appreciate political/nationalist/technology flamebaiting here, please do not do this" and this is why mods shouldn't be able to permanently delete threads... some of us can't read the historical entries and see what the problem was...
  • 06-16-2009 9:43 PM In reply to

    • Heron
    • Top 150 Contributor
    • Joined on 06-20-2007
    • Kent, WA
    • Posts 277

    Re: getID, or "SQL-based version control"!

    henke37:
    The sad part is that I think that some version control software actually uses a database for the file storage.

    Using a database for revision control is not a WTF (and if done properly is actually a smart idea).

  • 06-17-2009 3:54 AM In reply to

    • Weng
    • Top 50 Contributor
    • Joined on 03-14-2008
    • Posts 508

    Re: getID, or "SQL-based version control"!

    Heron:
    Using a database for revision control is not a WTF (and if done properly is actually a smart idea).
     

    I actually have an SVN hook on commit that keeps track of the repository, revisions, files changed per revision and optionally, depending on whether the project is flagged for it, an actual diff for each file at each revision (for big changes a text field actually isn't big enough - the damn thing had to be bigtext). This information then gets cross-referenced with the databases behind our bugtrackers, and builds a series of references based on the commit messages and any comment text in the diff itself. This is all then tied into the time and billing system - so we instantly know everything productive that a given user did while they were working.

     Would've saved me some effort if SVN could be told "Here, use this database server"

  • 06-17-2009 11:02 AM In reply to

    Re: getID, or "SQL-based version control"!

    Weng:
    I actually have an SVN hook on commit that keeps track of the repository, revisions, files changed per revision and optionally, depending on whether the project is flagged for it, an actual diff for each file at each revision (for big changes a text field actually isn't big enough - the damn thing had to be bigtext).

    Dear God, why the diff?  Why not just use SVN's built-in revision comparison tools?  Why create an entire copy of the SVN repo and risk one being out of sync with the other?

  • 06-17-2009 11:06 AM In reply to

    • DOA
    • Top 25 Contributor
    • Joined on 06-26-2007
    • Posts 703

    Re: getID, or "SQL-based version control"!

    morbiuswilters:
    You may laugh, but I have seen SQL-based version control for source code before.  Turns out the dev thought CVS and SVN were too confusing, so he just inserted a row containing the filename in one column, the entire file in a TEXT column and an incrementing version number in a third.  To get the latest version, he just selected MAX(version_number) WHERE filename = "foo".
    Why is this not an OP? Better yet, did you hurt him or is he still out there doing this crap?

  • 06-17-2009 11:13 AM In reply to

    Re: getID, or "SQL-based version control"!

    DOA:

    morbiuswilters:
    You may laugh, but I have seen SQL-based version control for source code before.  Turns out the dev thought CVS and SVN were too confusing, so he just inserted a row containing the filename in one column, the entire file in a TEXT column and an incrementing version number in a third.  To get the latest version, he just selected MAX(version_number) WHERE filename = "foo".
    Why is this not an OP? Better yet, did you hurt him or is he still out there doing this crap?

    I just really love threadjacking.

     

    I've got so many WTFs that if I were to post them all it would take months.  This particular dev is still doing this kind of stuff, but I think he's mostly retired by now.  Unfortunately, most of the horrible devs I've known are still active in some capacity.  One of the worst works for $LARGE_SEARCH_ENGINE.

  • 06-17-2009 11:32 AM In reply to

    Re: getID, or "SQL-based version control"!

    morbiuswilters:
    One of the worst works for $LARGE_SEARCH_ENGINE.
    He works for Baidu?

  • 06-17-2009 11:33 AM In reply to

    Re: getID, or "SQL-based version control"!

    morbiuswilters:
    I've got so many WTFs that if I were to post them all it would take months.  This particular dev is still doing this kind of stuff, but I think he's mostly retired by now.  Unfortunately, most of the horrible devs I've known are still active in some capacity.  One of the worst works for $LARGE_SEARCH_ENGINE.
    Well get crackin!

    SpectateSwamp exposing aliens. Obviously the World needs SSDS


    [10:07] <fatdog> so from now on.. be sure to wear nice clean underwear
    [10:07] <mps> fatdog: That is simply not going to happen
    Filed under:
  • 06-17-2009 11:36 AM In reply to

    Re: getID, or "SQL-based version control"!

     

    drachenstern:
    Seeing as how filesystems are by their very nature databases, I would think that all RCS are database-oriented.

    You have a set of objects, and some relation of those objects one to another, and a set of operations on those objects.

    Sounds like a database to me.

    Ghost of TDWTF Past here, this has already been argued, and you are welcome to rehash it, but keep that discussion in this thread.

    Remind me to get old threads locked before I link them.

    SpectateSwamp exposing aliens. Obviously the World needs SSDS


    [10:07] <fatdog> so from now on.. be sure to wear nice clean underwear
    [10:07] <mps> fatdog: That is simply not going to happen
    Filed under:
  • 06-17-2009 11:37 AM In reply to

    Re: getID, or "SQL-based version control"!

    bstorer:
    morbiuswilters:
    One of the worst works for $LARGE_SEARCH_ENGINE.
    He works for Baidu?
    No, obviously he meant cuil, the google killer.

    SpectateSwamp exposing aliens. Obviously the World needs SSDS


    [10:07] <fatdog> so from now on.. be sure to wear nice clean underwear
    [10:07] <mps> fatdog: That is simply not going to happen
    Filed under:
  • 06-17-2009 11:52 AM In reply to

    Re: getID, or "SQL-based version control"!

    belgariontheking:
    Ghost of TDWTF Past here, this has already been argued, and you are welcome to rehash it, but keep that discussion in this thread.
    Seems like a good idea to me, but it's always a question of definition, no? Like you said, the question of is a filesystem a database is a long-lived argument, so this is not the place for that discussion.

    Also, you should get that old thread locked ;)

    morbiuswilters: Oh, and this entire thread is pointless, flamebait spam. Heckuva job, drachy...
    Prepare for a life in hell, a thankless job where you service the dregs of society. Kinda like being a hooker that works in a crack house.

    "we don't appreciate political/nationalist/technology flamebaiting here, please do not do this" and this is why mods shouldn't be able to permanently delete threads... some of us can't read the historical entries and see what the problem was...
  • 06-17-2009 4:11 PM In reply to

    • Weng
    • Top 50 Contributor
    • Joined on 03-14-2008
    • Posts 508

    Re: getID, or "SQL-based version control"!

    morbiuswilters:
    Dear God, why the diff?  Why not just use SVN's built-in revision comparison tools?  Why create an entire copy of the SVN repo and risk one being out of sync with the other?

    Because a fat ugly hard drive with a fat ugly full text index on the diff column makes generating cross-references based on diff content about a million times faster. Disk space is cheap. Real cheap.

     

    And yes, it makes sure it didn't miss a revision (and if it did, it currently alerts a human to schedule a rebuild or catch-up) every time it runs - and if it stopped running altogether, we'd notice rather quickly because it integrates into the system that prints our checks.

  • 06-17-2009 4:19 PM In reply to

    Re: getID, or "SQL-based version control"!

    Weng:
    Because a fat ugly hard drive with a fat ugly full text index on the diff column makes generating cross-references based on diff content about a million times faster. Disk space is cheap. Real cheap.
    <joking>

    FAT? NOOOOOO

    FAT baaaadddd, use a journaling system...

    </joking>

    Actually, in this case, I think journaling wouldn't work as effectively, but this is so far OT that it's barely worth anyone replying to... <cue-regulars-to-mock-me>

    morbiuswilters: Oh, and this entire thread is pointless, flamebait spam. Heckuva job, drachy...
    Prepare for a life in hell, a thankless job where you service the dregs of society. Kinda like being a hooker that works in a crack house.

    "we don't appreciate political/nationalist/technology flamebaiting here, please do not do this" and this is why mods shouldn't be able to permanently delete threads... some of us can't read the historical entries and see what the problem was...
  • 06-17-2009 4:27 PM In reply to

    • Weng
    • Top 50 Contributor
    • Joined on 03-14-2008
    • Posts 508

    Re: getID, or "SQL-based version control"!

    Oh right. The word "fat" isn't supposed to be used for large things and people anymore. Obama made that law, right?

    Weng:
    Because a obese ugly hard drive with a obese ugly full text index on the diff column makes generating cross-references based on diff content about a million times faster. Disk space is cheap. Real cheap.

    Totally fixed.

  • 06-17-2009 5:54 PM In reply to

    Re: getID, or "SQL-based version control"!

    Weng:

    Weng:
    Because a horizontally challenged ugly hard drive with a horizontally challenged ugly full text index on the diff column makes generating cross-references based on diff content about a million times faster. Disk space is cheap. Real cheap.

    Totally fixed.

    TRFTFY.
    ╩юфют√ь ёЄЁрэшЎрь яюЁр эр яхэёш■.

    #TDWTF @ SlashNET was merged into #codelove @ the same network. You're still welcome to drop by. I guess.
    Filed under:
  • 06-17-2009 6:10 PM In reply to

    Re: getID, or "SQL-based version control"!

    Spectre:
    Weng:

    Weng:
    Because a horizontally challenged ugly hard drive with a horizontally challenged ugly full text index on the diff column makes generating cross-references based on diff content about a million times faster. Disk space is cheap. Real cheap.

    Totally fixed.

    TRFTFY.

    That makes me think of penises.  A better phrase might be "gravitationally challenged" or "fast-food-made disaster".  Everything wrong with the world is to blamed on big business and capitalism, not personal responsibility, right?

Page 1 of 1 (20 items)
Powered by Community Server (Non-Commercial Edition), by Telligent Systems