Skip to content

Instantly share code, notes, and snippets.

@Noxwizard
Noxwizard / gist:1022176
Created June 13, 2011 00:49
Oracle Q&A initial configuration error
SQL ERROR [ oracle ]
ORA-00911: invalid character [911]
SQL
CREATE TABLE phpb9_captcha_questions ( question_id number(8) , strict number(1) DEFAULT '0' , lang_id number(8) DEFAULT '0' , lang_iso varchar2(30) DEFAULT '' , question_text clob DEFAULT '' , CONSTRAINT pk_phpb9_captcha_questions PRIMARY KEY (question_id) );
BACKTRACE
@Noxwizard
Noxwizard / gist:1022185
Created June 13, 2011 01:11
Oracle Q&A question submission
SQL ERROR [ oracle ]
ORA-01400: cannot insert NULL into ("PHPBB"."PHPBB_CAPTCHA_QUESTIONS"."QUESTION_ID") [1400]
SQL
INSERT INTO phpbb_captcha_questions (question_text, strict, lang_iso, lang_id) VALUES ('This is a question, type "answer"', 0, 'en', 1)
BACKTRACE
@Noxwizard
Noxwizard / Firebird.php
Created September 25, 2011 08:41
Firebird Metadata for PHPUnit's DbUnit
<?php
/**
* PHPUnit
*
* Copyright (c) 2002-2011, Sebastian Bergmann <sb@sebastian-bergmann.de>.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@Noxwizard
Noxwizard / gist:1907078
Created February 25, 2012 06:41
Firebird PDO heap corruption
<?php
try
{
$dbh = new PDO('firebird:host=localhost;dbname=C:\\phpbb_test_data\\tests.fdb', 'SYSDBA', 'masterkey');
for($i = 0; $i < 1000; $i++)
{
$statement = $dbh->prepare('INSERT INTO "PHPBB_USERS" ("USER_ID", "USERNAME", "USERNAME_CLEAN", "USER_PERMISSIONS", "USER_SIG", "USER_OCC", "USER_INTERESTS") VALUES (?, ?, ?, ?, ?, ?, ?)');
$statement->execute(array (0 => '2', 1 => 'banned', 2 => 'banned', 3 => '', 4 => '', 5 => '', 6 => ''));
echo 'Statement run: ' . $i . "\n";
}
@Noxwizard
Noxwizard / gist:1916504
Created February 26, 2012 12:32
ODBC metadata file for phpunit
<?php
/**
* Wrapper around the PDO object to be able to specify information about the underlying driver
*
* @package DbUnit
* @author Patrick Webster <noxwizard@gmail.com>
* @copyright 2002-2011 Sebastian Bergmann <sb@sebastian-bergmann.de>
* @license http://www.opensource.org/licenses/bsd-license.php BSD License
* @version Release: @package_version@
* @link http://www.phpunit.de/
@Noxwizard
Noxwizard / gist:4011094
Last active October 12, 2015 10:08
Cross compiling ownCloud's Mirall on OpenSUSE
@Noxwizard
Noxwizard / viewstate_parser.php
Created August 31, 2013 07:11
ASP viewstate token parser
<?php
function GetByte($string, $offset)
{
return Ord($string[$offset]);
}
function GetInt16($string, $offset)
{
for ($i = 0, $s = ""; $i < 2; $i++)
{
@Noxwizard
Noxwizard / gist:6396670
Created August 31, 2013 07:13
Output of viewstate_parser.php
Pair Object
(
[first] => Pair Object
(
[first] => -395001733
[second] => Pair Object
(
[first] =>
[second] => Array
(
@Noxwizard
Noxwizard / gist:6980088
Created October 14, 2013 18:41
Updating 3.0.12 MSSQL Native to 3.1.0-a1
( ! ) Fatal error: Call to a member function sql_exists() on a non-object in C:\Apache24\htdocs\phpBB3.0.12\install\update\new\phpbb\db\driver\mssqlnative.php on line 474
Call Stack
# Time Memory Function Location
1 0.0016 599576 {main}( ) ..\index.php:0
2 1.4831 13602240 module->load( ) ..\index.php:261
3 1.4831 13603488 install_update->main( ) ..\index.php:384
4 2.9940 15695128 Symfony\Component\DependencyInjection\ContainerBuilder->get( ) ..\install_update.php:85
5 2.9943 15703320 Symfony\Component\DependencyInjection\ContainerBuilder->createService( ) ..\ContainerBuilder.php:495
6 2.9947 15703808 Symfony\Component\DependencyInjection\ContainerBuilder->resolveServices( ) ..\ContainerBuilder.php:948
7 2.9955 15704904 Symfony\Component\DependencyInjection\ContainerBuilder->resolveServices( ) ..\ContainerBuilder.php:1006
@Noxwizard
Noxwizard / gist:6980565
Created October 14, 2013 19:17
MSSQL Native 3.1.0-a1 database_update
General Error
SQL ERROR [ mssqlnative ]
SQLSTATE: 42000 code: 5074 message: [Microsoft][SQL Server Native Client 11.0][SQL Server]The index 'imageset_id' is dependent on column 'imageset_id'. SQLSTATE: 42000 code: 4922 message: [Microsoft][SQL Server Native Client 11.0][SQL Server]ALTER TABLE DROP COLUMN imageset_id failed because one or more objects access this column. [4922]
SQL
ALTER TABLE [phpbb_styles] DROP COLUMN [imageset_id]
BACKTRACE